From d1541a0a36ef0d6a50e9854e8fe69c92164da0e3 Mon Sep 17 00:00:00 2001 From: bprize15 Date: Tue, 1 Oct 2024 10:38:00 -0400 Subject: [PATCH 1/3] allow comma in mutation name when transcripts present --- .../shared/util/firebase/firebase-utils.tsx | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/src/main/webapp/app/shared/util/firebase/firebase-utils.tsx b/src/main/webapp/app/shared/util/firebase/firebase-utils.tsx index ef2cddc3..13a346dd 100644 --- a/src/main/webapp/app/shared/util/firebase/firebase-utils.tsx +++ b/src/main/webapp/app/shared/util/firebase/firebase-utils.tsx @@ -405,13 +405,34 @@ export const hasMultipleMutations = (mutationName: string) => { }; export const isMutationEffectCuratable = (mutationName: string) => { const multipleMuts = hasMultipleMutations(mutationName); - if (multipleMuts) { + if (multipleMuts && !areSameAlterationsWithDifferentTranscripts(mutationName)) { return false; } const excludedMutations = ['Oncogenic Mutations']; return excludedMutations.filter(mutation => mutationName.toLowerCase().includes(mutation.toLowerCase())).length === 0; }; +function areSameAlterationsWithDifferentTranscripts(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; From a14041e7aea4d786a2e5ceb39a78f381a5a0bda6 Mon Sep 17 00:00:00 2001 From: bprize15 Date: Tue, 1 Oct 2024 10:54:52 -0400 Subject: [PATCH 2/3] add missing colon --- src/main/webapp/app/shared/util/firebase/firebase-utils.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/webapp/app/shared/util/firebase/firebase-utils.tsx b/src/main/webapp/app/shared/util/firebase/firebase-utils.tsx index 13a346dd..53b9f647 100644 --- a/src/main/webapp/app/shared/util/firebase/firebase-utils.tsx +++ b/src/main/webapp/app/shared/util/firebase/firebase-utils.tsx @@ -422,7 +422,7 @@ function areSameAlterationsWithDifferentTranscripts(mutationName: string) { const alt1 = alterations[0].trim().toLowerCase(); const alt2 = alterations[1].trim().toLowerCase(); const grch37Prefix = 'grch37:'; - const grch38Prefix = 'grch38'; + const grch38Prefix = 'grch38:'; if ( (alt1.startsWith(grch37Prefix) && alt2.startsWith(grch38Prefix)) || From 43ca3b8a2d9387f1f2254868465c1d46ed4fd485 Mon Sep 17 00:00:00 2001 From: bprize15 Date: Tue, 1 Oct 2024 16:42:16 -0400 Subject: [PATCH 3/3] rename transcripts to reference genomes --- src/main/webapp/app/shared/util/firebase/firebase-utils.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/webapp/app/shared/util/firebase/firebase-utils.tsx b/src/main/webapp/app/shared/util/firebase/firebase-utils.tsx index 53b9f647..ca6d7214 100644 --- a/src/main/webapp/app/shared/util/firebase/firebase-utils.tsx +++ b/src/main/webapp/app/shared/util/firebase/firebase-utils.tsx @@ -405,14 +405,14 @@ export const hasMultipleMutations = (mutationName: string) => { }; export const isMutationEffectCuratable = (mutationName: string) => { const multipleMuts = hasMultipleMutations(mutationName); - if (multipleMuts && !areSameAlterationsWithDifferentTranscripts(mutationName)) { + if (multipleMuts && !areSameAlterationsWithDifferentReferenceGenomes(mutationName)) { return false; } const excludedMutations = ['Oncogenic Mutations']; return excludedMutations.filter(mutation => mutationName.toLowerCase().includes(mutation.toLowerCase())).length === 0; }; -function areSameAlterationsWithDifferentTranscripts(mutationName: string) { +function areSameAlterationsWithDifferentReferenceGenomes(mutationName: string) { const alterations = mutationName.split(','); if (alterations.length !== 2) {