Skip to content

Commit

Permalink
Merge pull request #4092 from alisman/fixMut
Browse files Browse the repository at this point in the history
Use alteration type enum to detect mutation profile
  • Loading branch information
alisman authored Dec 16, 2021
2 parents 55d2301 + 537f902 commit 0e468b1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,8 @@ export class PatientViewPageStore {
invoke: async () =>
findMutationMolecularProfile(
this.molecularProfilesInStudy,
this.studyId
this.studyId,
AlterationTypeConstants.MUTATION_EXTENDED
),
});

Expand Down
13 changes: 5 additions & 8 deletions src/shared/lib/StoreUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1079,30 +1079,27 @@ export function isMutationProfile(profile: MolecularProfile): boolean {
export function findMutationMolecularProfile(
molecularProfilesInStudy: MobxPromise<MolecularProfile[]>,
studyId: string,
suffix: string = MOLECULAR_PROFILE_MUTATIONS_SUFFIX
type: string
) {
if (!molecularProfilesInStudy.result) {
return undefined;
}

const profile = molecularProfilesInStudy.result.find(
(p: MolecularProfile) => {
return p.molecularProfileId === `${studyId}${suffix}`;
}
const profile = molecularProfilesInStudy.result!.find(
(profile: MolecularProfile) => profile.molecularAlterationType === type
);

return profile;
}

export function findUncalledMutationMolecularProfileId(
molecularProfilesInStudy: MobxPromise<MolecularProfile[]>,
studyId: string,
suffix: string = MOLECULAR_PROFILE_UNCALLED_MUTATIONS_SUFFIX
studyId: string
) {
const profile = findMutationMolecularProfile(
molecularProfilesInStudy,
studyId,
suffix
AlterationTypeConstants.MUTATION_UNCALLED
);
if (profile) {
return profile.molecularProfileId;
Expand Down

0 comments on commit 0e468b1

Please sign in to comment.