Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow comma in mutation name when transcripts present #453

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion src/main/webapp/app/shared/util/firebase/firebase-utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -405,13 +405,34 @@ export const hasMultipleMutations = (mutationName: string) => {
};
export const isMutationEffectCuratable = (mutationName: string) => {
const multipleMuts = hasMultipleMutations(mutationName);
if (multipleMuts) {
if (multipleMuts && !areSameAlterationsWithDifferentReferenceGenomes(mutationName)) {
return false;
}
const excludedMutations = ['Oncogenic Mutations'];
return excludedMutations.filter(mutation => mutationName.toLowerCase().includes(mutation.toLowerCase())).length === 0;
};

function areSameAlterationsWithDifferentReferenceGenomes(mutationName: string) {
const alterations = mutationName.split(',');

if (alterations.length !== 2) {
return false;
}

const alt1 = alterations[0].trim().toLowerCase();
const alt2 = alterations[1].trim().toLowerCase();
const grch37Prefix = 'grch37:';
const grch38Prefix = 'grch38:';

if (
(alt1.startsWith(grch37Prefix) && alt2.startsWith(grch38Prefix)) ||
(alt1.startsWith(grch38Prefix) && alt2.startsWith(grch37Prefix))
) {
return true;
}
return false;
}

export function compareMutationsByDeleted(mut1: Mutation, mut2: Mutation) {
const mut1IsDeleted = mut1.name_review?.removed || false;
const mut2IsDeleted = mut2.name_review?.removed || false;
Expand Down