Skip to content

test(solo): a fixture the CellRanger flags can fail (#172) - #243

Open
BenjaminDEMAILLE wants to merge 1 commit into
mainfrom
test/solo-cellranger-flags-fixture
Open

test(solo): a fixture the CellRanger flags can fail (#172)#243
BenjaminDEMAILLE wants to merge 1 commit into
mainfrom
test/solo-cellranger-flags-fixture

Conversation

@BenjaminDEMAILLE

Copy link
Copy Markdown
Contributor

Addresses the fourth item of #172, and answers the first two.

What #172 asked for

Replace the three-entry differential with this fixture, so a regression in any of the above fails a test rather than being found by hand.

The existing CellRanger test has three non-zero matrix entries, every barcode an exact whitelist hit and every UMI unique, so none of the populations the CellRanger flags act on is present and the test passes whatever those flags do.

What this adds

Two tests, each planting exactly the population its flag decides:

  • multi_gene_umi_cr_removes_a_tied_umi_from_the_matrix: one UMI shared between two genes with tied read support, which STAR gives to nobody, plus a clean UMI per gene so the matrix is not empty afterwards. The assertion is exact: the total drops by precisely 2, the tied UMI's molecule in each gene.
  • an_n_containing_barcode_is_decided_by_the_cb_match_type: half the reads carry a barcode with an N one substitution from the whitelist entry. Exact cannot place them, 1MM_multi_Nbase_pseudocounts can.

What they say about the two "inert" flags

Both are live on current main. The tied UMI's two molecules disappear under MultiGeneUMI_CR, and the N-barcode half contributes a molecule under 1MM_multi_Nbase_pseudocounts that Exact does not (1 → 2). So items 1 and 2 of #172 were fixed by work merged since it was filed; these tests are what keeps them fixed. Item 3, STAR's validation pairing of MultiGeneUMI_CR with --soloUMIdedup 1MM_CR, is also on main already.

Two fixture corrections worth recording

Both would have produced a test that passes for the wrong reason, which is the failure mode this issue is about:

  1. The N-barcode halves first shared their UMIs, so a rescued read folded into the molecule the clean read already contributed and the totals agreed whether or not the flag did anything (measured: 2 and 2).
  2. The assertion was >= rather than >, which those equal totals satisfied.

With distinct UMIs and a strict comparison, the numbers separate: 1 against 2.

This is the small-fixture version. The 20 000-read fixture in #172 with the real 3M-february-2018 whitelist stays the right tool for measuring the residual against STAR; it needs a 26 MB whitelist that should not be vendored, so it belongs behind a skip-if-absent guard rather than in the default suite.

cargo test, cargo clippy --all-targets -- -D warnings on a cold cache, and cargo fmt --check are green.

🤖 Generated with Claude Code

#172 measured --soloUMIfiltering MultiGeneUMI_CR and --soloCBmatchWLtype
1MM_multi_Nbase_pseudocounts changing nothing while still being accepted, and
noted that the existing differential could not see it: three non-zero matrix
entries, every barcode an exact hit, every UMI unique.

These two tests plant exactly the populations those flags act on. One UMI is
shared between two genes with tied read support, which MultiGeneUMI_CR gives
to nobody; half the reads carry a barcode with an N one substitution from the
whitelist, which only the 1MM match types can place.

Both flags are live on current main: the tied UMI's two molecules disappear
under MultiGeneUMI_CR, and the N-barcode half contributes a molecule under
1MM_multi_Nbase_pseudocounts that Exact does not (1 -> 2).

Getting there took two fixture corrections worth recording, because both would
have produced a test that passes for the wrong reason: the N-barcode groups
first shared their UMIs, so a rescued read folded into the molecule the clean
read already contributed and the totals agreed either way; and the assertion
was >= rather than >, which the equal totals satisfied.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant