• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pirl-unc / tcrsift / 25815465724

13 May 2026 05:29PM UTC coverage: 70.878% (+0.01%) from 70.864%
25815465724

push

github

web-flow
Warn when load_cellranger_gex drops >50% of cells (closes #41) (#47)

Follow-up to #39. The QC filter is correctly applied now, but the only
signal that bounds ate most of the sample is a verbose=True info log:

  QC: 27,231 -> 23,401 cells pass (dropped 3,830)

Routine drop rates are fine. But typos like `--min-mito 1.0` (meant
10) or running a sheet against a dataset with different chemistry can
silently keep a few percent of cells, and downstream artifacts just
look "weird" rather than fail clearly.

Adds `logger.warning` when pass_rate < 0.5, naming the relevant
flags so the user knows what to inspect:

  QC dropped 95% of cells (19,000/20,000) — check --min-genes/
  --max-genes/--min-counts/--max-counts/--min-mito/--max-mito if
  this is unexpected.

50% is a defensible threshold: peripheral blood routinely passes
90%+, tumor samples sit around 70%, below half is almost always
a config mistake or a dataset-mismatch issue worth flagging.

## Tests

- New `test_load_gex_warns_on_low_pass_rate` exercises the mock
  fixture with min_genes=20 (the fixture's n_genes ~9), confirms a
  WARNING-level record fires and names --min-genes and --min-mito
  in the message.
- New `test_load_gex_no_warning_at_normal_pass_rate` confirms the
  permissive-bounds path stays quiet.

Both use the established caplog.at_level(WARNING, logger=...)
pattern from test_filter.

## Behavior change scope

This is a strict log-level addition — no functional behavior changes,
no cell-count changes, no CLI surface changes. Existing pipelines see
exactly the same outputs.

Version 0.8.8 (patch).

Note: filed issue #46 separately for the test isolation gap that
turned up while running tests locally — three CLI tests pick up
the developer's ~/.cache/tcrsift contents (added by PR #33's cache
fallback) and hit a pre-existing column-name bug in annotate. Not
caused by or affected by this PR; CI is green because CI has no
cache. Reproducer in #46.

4651 of 6562 relevant lines covered (70.88%)

2.83 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

89.25
/loader.py


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc