Skip to content

fix: only relabel whitelisted 5'Flank mutations as "Promoter" with custom filters (#65)#159

Open
officialasishkumar wants to merge 1 commit into
cBioPortal:mainfrom
officialasishkumar:fix/mutation-filter-promoter-consistency
Open

fix: only relabel whitelisted 5'Flank mutations as "Promoter" with custom filters (#65)#159
officialasishkumar wants to merge 1 commit into
cBioPortal:mainfrom
officialasishkumar:fix/mutation-filter-promoter-consistency

Conversation

@officialasishkumar
Copy link
Copy Markdown

Summary

MutationFilter.acceptMutation() relabels 5'Flank mutations' protein change to "Promoter" inconsistently, depending on whether a custom filtered-mutations list (sequenced_samples/variant_classification_filter in the meta file) is supplied:

Path Whitelisted gene (e.g. TERT) Other gene
Default filter (no custom list) relabeled "Promoter", accepted rejected
Custom filter (before this PR) relabeled "Promoter", accepted relabeled "Promoter", accepted

So the exact same 5'Flank mutation on a non-whitelisted gene is labeled "Promoter" or not purely based on the filter configuration. The "Promoter" convention is specific to whitelisted promoter genes (currently only TERT, Entrez 7015), so labeling arbitrary genes' 5'Flank mutations as promoter mutations misrepresents them. This was reported in #65 as an unintended asymmetry.

Changes

src/main/java/org/mskcc/cbio/portal/scripts/MutationFilter.java: in the custom-filter branch, gate the "Promoter" relabeling by the promoter whitelist, exactly as the default-filter branch already does:

if (safeStringTest(mutation.getMutationType(), "5'Flank")
        && whiteListGenesForPromoterMutations.contains(mutation.getEntrezGeneId())) {
    mutation.setProteinChange("Promoter");
}

The accept/reject contract of custom filters is intentionally unchanged: a 5'Flank type that is not in the custom list is still accepted (a custom list only excludes the types it names); it is simply no longer relabeled "Promoter" unless its gene is whitelisted.

Tests

Added TestMutationFilterPromoter, a focused unit test (the filtering logic is self-contained and does not touch the database) covering both filter modes for whitelisted (TERT) and non-whitelisted genes:

mvn -Dtest=TestMutationFilterPromoter test
Tests run: 5, Failures: 0, Errors: 0, Skipped: 0
BUILD SUCCESS

The existing TestMutationFilter only exercises the default filter path and is unaffected.

Fixes #65

…stom filters

MutationFilter.acceptMutation() handled the "Promoter" protein-change relabeling
inconsistently depending on whether a custom filtered-mutations list was used:

- Default filter (no custom list): a 5'Flank mutation is relabeled "Promoter"
  only when its gene is on the promoter whitelist (currently TERT); for any
  other gene the mutation is rejected.
- Custom filter: every accepted 5'Flank mutation was relabeled "Promoter",
  regardless of the gene.

As a result, the same 5'Flank mutation on a non-whitelisted gene could be
labeled "Promoter" or not purely depending on the filter configuration, which
misrepresents the mutation (the "Promoter" convention is specific to whitelisted
promoter genes such as TERT).

Gate the relabeling in the custom-filter branch by the promoter whitelist, so it
matches the default-filter branch. The accept/reject behavior of custom filters
is unchanged: a 5'Flank type that is not in the custom list is still accepted; it
is simply no longer relabeled as a promoter mutation unless the gene is
whitelisted.

Adds TestMutationFilterPromoter covering both filter modes for whitelisted and
non-whitelisted genes.

Fixes cBioPortal#65
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.

Inconsistent Handling of 5'Flank Mutation Type with Custom Filtered Mutations

1 participant