Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cna and putative driver coloring in expression tab #1377

Merged
merged 17 commits into from
Aug 23, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 5 additions & 4 deletions src/pages/resultsView/ResultsViewPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -260,13 +260,14 @@ export default class ResultsViewPage extends React.Component<IResultsViewPagePro

const store = this.resultsViewPageStore;

if (store.rnaSeqMolecularData.isComplete && store.studyIdToStudy.isComplete
&& store.mutations.isComplete && store.genes.isComplete && store.coverageInformation.isComplete) {
if (store.studyIdToStudy.isComplete
&& store.putativeDriverAnnotatedMutations.isComplete && store.genes.isComplete && store.coverageInformation.isComplete) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

putative driver contains rnaseq and mutations data?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, no I just rewrote it to use numericGeneMolecularDataCache as a data source

return <ExpressionWrapper store={store}
studyMap={store.studyIdToStudy.result}
genes={store.genes.result}
data={store.rnaSeqMolecularData.result}
mutations={store.mutations.result}
expressionProfiles={store.expressionProfiles}
numericGeneMolecularDataCache={store.numericGeneMolecularDataCache}
mutations={store.putativeDriverAnnotatedMutations.result}
RNASeqVersion={store.expressionTabSeqVersion}
coverageInformation={store.coverageInformation.result}
onRNASeqVersionChange={(version:number)=>store.expressionTabSeqVersion=version}
Expand Down
33 changes: 33 additions & 0 deletions src/pages/resultsView/ResultsViewPageStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1768,6 +1768,39 @@ export class ResultsViewPageStore {
}
});

public annotatedCnaCache =
new MobxPromiseCache<{entrezGeneId:number}, AnnotatedNumericGeneMolecularData[]>(
q=>({
await: ()=>this.numericGeneMolecularDataCache.await(
[this.studyToMolecularProfileDiscrete, this.entrezGeneIdToGene, this.getOncoKbCnaAnnotationForOncoprint, this.molecularProfileIdToMolecularProfile],
(studyToMolecularProfileDiscrete)=>{
return _.values(studyToMolecularProfileDiscrete).map(p=>({entrezGeneId: q.entrezGeneId, molecularProfileId: p.molecularProfileId}));
}),
invoke:()=>{
const results = _.flatten(this.numericGeneMolecularDataCache.getAll(
_.values(this.studyToMolecularProfileDiscrete.result!).map(p=>({entrezGeneId: q.entrezGeneId, molecularProfileId: p.molecularProfileId}))
).map(p=>p.result!));
const entrezGeneIdToGene = this.entrezGeneIdToGene.result!;
let getOncoKbAnnotation:(datum:NumericGeneMolecularData)=>IndicatorQueryResp|undefined;
if (this.getOncoKbCnaAnnotationForOncoprint.result! instanceof Error) {
getOncoKbAnnotation = ()=>undefined;
} else {
getOncoKbAnnotation = this.getOncoKbCnaAnnotationForOncoprint.result! as typeof getOncoKbAnnotation;
}
const profileIdToProfile = this.molecularProfileIdToMolecularProfile.result!;
return Promise.resolve(results.map(d=>{
return annotateMolecularDatum(
d,
getOncoKbAnnotation,
profileIdToProfile,
entrezGeneIdToGene
);
})
);
}
})
);

readonly getPutativeDriverInfo = remoteData({
await:()=>{
const toAwait = [];
Expand Down
26 changes: 2 additions & 24 deletions src/pages/resultsView/expression/ExpressionWrapper.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,37 +18,15 @@ describe('Expression Wrapper',()=>{
instance = wrapper.instance() as ExpressionWrapper;
});


it('data transformer returns correct value based on logScale state',()=>{

instance.logScale = true;
assert.equal(instance.dataTransformer({value: 100} as NumericGeneMolecularData), 6.643856189774724);

instance.logScale = false;
assert.equal(instance.dataTransformer({value: 100} as NumericGeneMolecularData), 100);

});

it('data transformer caps expression value >= constant',()=>{

instance.logScale = true;
assert.equal(instance.dataTransformer({value: 0.0001} as NumericGeneMolecularData), -6.643856189774724, 'value less than cap');
assert.equal(instance.dataTransformer({value: 0} as NumericGeneMolecularData), -6.643856189774724, 'zero value');

instance.logScale = false;
assert.equal(instance.dataTransformer({value: 0.0001} as NumericGeneMolecularData), .0001, 'non log');
assert.equal(instance.dataTransformer({value: 0} as NumericGeneMolecularData), 0, 'non log zero');
});

// this is failing. we need new data to debug
it.skip('studies are sorted properly depending on sortBy setting',()=>{
/*it.skip('studies are sorted properly depending on sortBy setting',()=>{

instance.sortBy = "alphabetic";
assert.equal(instance.sortedData[2][0].studyId, 'chol_tcga', 'sorting is alphabetical');

instance.sortBy = "median";
assert.equal(instance.sortedData[2][0].studyId, 'laml_tcga', 'sort according to median values');

});
});*/

});
Loading