Skip to content

Commit

Permalink
Merge pull request #4083 from dippindots/fix-9076
Browse files Browse the repository at this point in the history
Returns an empty list for undefined profileIds in isSampleProfiledInMultiple function
  • Loading branch information
alisman authored Dec 14, 2021
2 parents 4872f7e + ce73db4 commit 55d2301
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions src/shared/lib/isSampleProfiled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,22 @@ export function isSampleProfiledInSomeMolecularProfile(

export function isSampleProfiledInMultiple(
uniqueSampleKey: string,
molecularProfileIds: string[],
molecularProfileIds: string[] | undefined,
coverageInformation: CoverageInformation,
hugoGeneSymbol?: string
): boolean[] {
// returns boolean[] in same order as molecularProfileIds
const profiledReport = getSampleProfiledReport(
uniqueSampleKey,
coverageInformation,
hugoGeneSymbol
);
return molecularProfileIds.map(
molecularProfileId => !!profiledReport[molecularProfileId]
);
// returns empty list if molecularProfileIds is undefined
if (!molecularProfileIds) {
return [];
} else {
// returns boolean[] in same order as molecularProfileIds
const profiledReport = getSampleProfiledReport(
uniqueSampleKey,
coverageInformation,
hugoGeneSymbol
);
return molecularProfileIds.map(
molecularProfileId => !!profiledReport[molecularProfileId]
);
}
}

0 comments on commit 55d2301

Please sign in to comment.