Skip to content

Commit

Permalink
Merge pull request cBioPortal#2963 from onursumer/tumor-col-formatter
Browse files Browse the repository at this point in the history
Always showing patient icons when there is an alteration

Former-commit-id: f1baff705770ca6086a2ac93879d123653ea5dff
  • Loading branch information
alisman authored Jan 2, 2020
2 parents 7541461 + 1f64458 commit 67e9f7e
Showing 1 changed file with 23 additions and 4 deletions.
27 changes: 23 additions & 4 deletions src/pages/patientView/mutation/column/TumorColumnFormatter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,29 +33,48 @@ export default class TumorColumnFormatter {
const entrezGeneId = mutations[0].entrezGeneId;
const mutatedSamples = TumorColumnFormatter.getPresentSamples(mutations);
const profiledSamples = TumorColumnFormatter.getProfiledSamplesForGene(entrezGeneId, sampleIds, sampleToGenePanelId, genePanelIdToGene);
const notProfiledText = 'This gene was not profiled for this sample (absent from gene panel)';

const tdValue = samples.map((sample:any) => {
// hide labels for non-existent mutation data
// decreased opacity for uncalled mutations
// show not-profiled icon when gene was not analyzed
const isMutated = sample.id in mutatedSamples;
const isProfiled = sample.id in profiledSamples && profiledSamples[sample.id];


let extraTooltipText = '';

// mutations can be read which are not part of the target of the gene panel
// therefore a sample can still have mutations even if the gene was not profiled
if (isMutated) {
if(!mutatedSamples[sample.id]) {
extraTooltipText = "Mutation has supporting reads, but wasn't called. ";
}
if (!isProfiled) {
extraTooltipText = `${extraTooltipText}${notProfiledText}`;
}
}
else {
if (!isProfiled) {
extraTooltipText = `${notProfiledText}. It is unknown whether it is mutated.`
}
}

return (
<li className={isProfiled && !isMutated? 'invisible' : ''}>
{isProfiled?
{isMutated?
sampleManager.getComponentForSample(
sample.id,
(mutatedSamples[sample.id]) ? 1 : 0.1,
(mutatedSamples[sample.id]) ? '' : "Mutation has supporting reads, but wasn't called",
extraTooltipText,
null,
onSelectGenePanel,
disableTooltip
)
:
<SampleInline
sample={sample}
extraTooltipText={'This gene was not profiled for this sample (absent from gene panel). It is unknown whether it is mutated.'}
extraTooltipText={extraTooltipText}
onSelectGenePanel={onSelectGenePanel}
disableTooltip={disableTooltip} >
<SampleLabelNotProfiled
Expand Down

0 comments on commit 67e9f7e

Please sign in to comment.