Skip to content

Commit

Permalink
Returns an empty list for undefined profileIds in isSampleProfiledInM…
Browse files Browse the repository at this point in the history
…ultiple function
  • Loading branch information
Gaofei Zhao committed Dec 10, 2021
1 parent 0466640 commit ce73db4
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 ce73db4

Please sign in to comment.