Skip to content

Commit 7bef7f2

Browse files
alismanfuzhaoyuan
authored andcommitted
Working everything!
1 parent 24d01d2 commit 7bef7f2

File tree

6 files changed

+24
-5
lines changed

6 files changed

+24
-5
lines changed

src/pages/resultsView/fusion/ResultViewFusionMapper.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ export default class ResultViewFusionMapper extends React.Component<
7878
await: () => [
7979
this.props.store.studyIdToStudy,
8080
this.props.store.molecularProfileIdToMolecularProfile,
81+
this.props.store.ensemblTranscripts,
82+
this.props.store.pfamDomainData,
8183
],
8284
render: () => {
8385
return this.renderComponents();

src/pages/resultsView/fusion/ResultViewFusionMapperStore.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ export class ResultViewFusionMapperStore {
125125
[]
126126
);
127127

128+
@computed
128129
get exonsChartStore(): ExonsChartStore {
129130
return new ExonsChartStore(
130131
this.gene,
@@ -156,7 +157,11 @@ export class ResultViewFusionMapperStore {
156157

157158
@computed
158159
get fusionCounts(): { [fusionLabel: string]: number } {
159-
return _.countBy(this.fusions, d => d.label);
160+
return _.countBy(this.fusions, d => {
161+
const dash = d.site1HugoSymbol && d.site2HugoSymbol ? '-' : '';
162+
return `${d.site1HugoSymbol || ''}${dash}${d.site2HugoSymbol ||
163+
''}`;
164+
});
160165
}
161166

162167
@computed

src/shared/components/exonsCharts/ExonsBarPlotStore.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* along with this program. If not, see <http://www.gnu.org/licenses/>.
2222
**/
2323

24-
import { computed } from 'mobx';
24+
import { computed, makeObservable } from 'mobx';
2525
import { EnsemblTranscriptExt } from '../../model/Fusion';
2626
import {
2727
ExonRangeExt,
@@ -38,6 +38,7 @@ export default class ExonsBarPlotStore {
3838
public referenceGeneWidth?: number
3939
) {
4040
this.divider = 0.1;
41+
makeObservable(this);
4142
}
4243

4344
@computed

src/shared/components/exonsCharts/ExonsChartStore.ts

+9-2
Original file line numberDiff line numberDiff line change
@@ -103,15 +103,19 @@ export class ExonsChartStore {
103103
}
104104

105105
addExtraFusionProps(fusion: StructuralVariantExt): StructuralVariantExt {
106+
const m = fusion.monkey;
107+
// AARON: PROBLEM IS THAT third argument is undefined
108+
// it is used internally as "breakpoint" in order to filter exons
109+
// for addition to the fusions
106110
const site1Exons = this.getExonsBySite(
107111
1,
108112
fusion.site1EnsemblTranscriptId,
109-
fusion.site1Exon
113+
fusion.site1RegionNumber
110114
);
111115
const site2Exons = this.getExonsBySite(
112116
2,
113117
fusion.site2EnsemblTranscriptId,
114-
fusion.site2Exon
118+
fusion.site2RegionNumber
115119
);
116120
const exons = site1Exons.concat(site2Exons);
117121
const totalWidth = ExonsChartStore.getTotalWidth(
@@ -300,6 +304,9 @@ export class ExonsChartStore {
300304
await: () => [this.transcripts],
301305
invoke: () => {
302306
const { result } = this.transcripts;
307+
308+
// each of the fusions in response should have their own exon collection
309+
// but they are all empty
303310
const transcripts = (result || [])
304311
.map(ExonsChartStore.addExonProps)
305312
.filter(t => t.isReferenceGene) // get only reference gene transcripts

src/shared/components/fusionCharts/FusionPieChart.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,13 @@ export default class FusionPieChart extends React.Component<
8585
}
8686

8787
getFusionCounts() {
88-
return this.props.fusionCounts
88+
const ret = this.props.fusionCounts
8989
? Object.keys(this.props.fusionCounts).map((d: string) => {
9090
return { x: d, y: this.props.fusionCounts[d] };
9191
})
9292
: [];
93+
94+
return ret;
9395
}
9496

9597
public render() {

src/shared/model/Fusion.ts

+2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import {
2525
EnsemblTranscript,
2626
Exon,
27+
PfamDomain,
2728
PfamDomainRange,
2829
} from 'genome-nexus-ts-api-client/src';
2930
import { StructuralVariant } from 'cbioportal-ts-api-client/src';
@@ -56,6 +57,7 @@ export type StructuralVariantExt = StructuralVariant & {
5657
deltaX?: number;
5758
exons?: ExonRangeExt[];
5859
label?: string;
60+
//added AARON (these are requested by code)
5961
};
6062

6163
export type EnsemblTranscriptExt = EnsemblTranscript & {

0 commit comments

Comments
 (0)