Repository navigation
fix(counting): claim a chromosome name mismatch only when names don't overlap - #176
Draft
NicoDeVeaux wants to merge 2 commits into
Draft
NicoDeVeaux wants to merge 2 commits into
NicoDeVeaux wants to merge 2 commits into
Conversation
…mosome names When mapped reads exist but none lands in a gene, `count_reads` reports "Chromosome name mismatch" without comparing names. These tests fail where the BAM and GTF share a name (directly, or through chromosome_prefix) and keep the mismatch message for disjoint names. All three expect a non-zero exit: whether to abort on this input is a separate question. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… overlap When mapped reads exist but none is assigned to a gene, check whether any alignment chromosome (after chromosome_prefix / chromosome_mapping) is a GTF chromosome. If one is, report that no reads could be assigned to any gene instead of "Chromosome name mismatch" and its chromosome_mapping advice. The run still fails in both cases; only the diagnostic changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix(counting): claim a chromosome name mismatch only when names don't overlap
What
When mapped reads exist but none is assigned to a gene,
count_readsnow checks whether any alignment chromosome, afterchromosome_prefix/chromosome_mapping, is a GTF chromosome. If one is, it reports:Only when no name is shared does it keep the existing "Chromosome name mismatch" message and its
chromosome_mappingadvice. The run still exits non-zero in both cases.Why
The condition (
src/rna/dupradar/counting.rs:1646-1652) only tests "mapped reads > 0 and no gene has a read"; it never compares names, so it tells users to add achromosome_mappingthat cannot help. Minimal input: one mapped read at chr1:11, one gene at chr1:900-3000 (a second gene on chr2).mainprints:How tested
Integration tests (one mapped read outside the only gene):
test_no_genic_reads_with_shared_names_is_not_a_name_mismatch(BAM and GTF bothchr1): fails atmain, passes here.test_no_genic_reads_with_prefix_mapped_names_is_not_a_name_mismatch(BAM1, GTFchr1, configchromosome_prefix: "chr"): fails atmain, passes here.test_no_genic_reads_with_disjoint_names_is_a_name_mismatch(BAM1, GTFchr1, no config): passes on both; guards the existing message.All three assert a non-zero exit.
cargo test --release --locked --offline: 200 unit, 12 bin, 21 integration, 2 doc tests pass.cargo fmt --checkpasses.cargo clippy -- -D warningsreports the same threeneedless_range_looperrors as unmodifiedmainwith the local toolchain (clippy 0.1.90); with that lint allowed,--all-targetsis clean. The formal-review harness'sedge_inputs.pyshows only E2 (mapped read outside genes) changing, from "Chromosome name mismatch" to the new message; E1, E3-E5 are unchanged.Not changed, and why
chromosome_mappingexample still pairs the first five names of each file by position; it is unchanged.🤖 Generated with Claude Code