@@ -1093,7 +1093,7 @@ export class ResultsViewPageStore extends AnalysisStore
1093
1093
this . studyIds ,
1094
1094
this . clinicalAttributes_profiledIn ,
1095
1095
this . clinicalAttributes_comparisonGroupMembership ,
1096
- this . clinicalAttributes_customCharts ,
1096
+ this . customAttributes ,
1097
1097
this . samples ,
1098
1098
this . patients ,
1099
1099
] ,
@@ -1142,7 +1142,7 @@ export class ResultsViewPageStore extends AnalysisStore
1142
1142
...specialAttributes ,
1143
1143
...this . clinicalAttributes_profiledIn . result ! ,
1144
1144
...this . clinicalAttributes_comparisonGroupMembership . result ! ,
1145
- ...this . clinicalAttributes_customCharts . result ! ,
1145
+ ...this . customAttributes . result ! ,
1146
1146
] ;
1147
1147
} ,
1148
1148
} ) ;
@@ -1187,7 +1187,7 @@ export class ResultsViewPageStore extends AnalysisStore
1187
1187
this . studyToDataQueryFilter ,
1188
1188
this . clinicalAttributes_profiledIn ,
1189
1189
this . clinicalAttributes_comparisonGroupMembership ,
1190
- this . clinicalAttributes_customCharts ,
1190
+ this . customAttributes ,
1191
1191
] ,
1192
1192
invoke : async ( ) => {
1193
1193
let clinicalAttributeCountFilter : ClinicalAttributeCountFilter ;
@@ -1270,7 +1270,7 @@ export class ResultsViewPageStore extends AnalysisStore
1270
1270
) ;
1271
1271
}
1272
1272
// add counts for custom chart clinical attributes
1273
- for ( const attr of this . clinicalAttributes_customCharts . result ! ) {
1273
+ for ( const attr of this . customAttributes . result ! ) {
1274
1274
ret [ attr . clinicalAttributeId ] = attr . data ! . filter (
1275
1275
d => d . value !== 'NA'
1276
1276
) . length ;
@@ -2723,7 +2723,64 @@ export class ResultsViewPageStore extends AnalysisStore
2723
2723
default : [ ] ,
2724
2724
} ) ;
2725
2725
2726
- readonly clinicalAttributes_customCharts = remoteData ( {
2726
+ readonly plotClinicalAttributes = remoteData < ExtendedClinicalAttribute [ ] > ( {
2727
+ await : ( ) => [
2728
+ this . studyIds ,
2729
+ this . clinicalAttributes_profiledIn ,
2730
+ this . clinicalAttributes_comparisonGroupMembership ,
2731
+ this . samples ,
2732
+ this . patients ,
2733
+ ] ,
2734
+ invoke : async ( ) => {
2735
+ const serverAttributes = await client . fetchClinicalAttributesUsingPOST (
2736
+ {
2737
+ studyIds : this . studyIds . result ! ,
2738
+ }
2739
+ ) ;
2740
+ const specialAttributes = [
2741
+ {
2742
+ clinicalAttributeId : SpecialAttribute . MutationSpectrum ,
2743
+ datatype : CLINICAL_ATTRIBUTE_FIELD_ENUM . DATATYPE_COUNTS_MAP ,
2744
+ description :
2745
+ 'Number of point mutations in the sample counted by different types of nucleotide changes.' ,
2746
+ displayName : 'Mutation spectrum' ,
2747
+ patientAttribute : false ,
2748
+ studyId : '' ,
2749
+ priority : '0' , // TODO: change?
2750
+ } as ClinicalAttribute ,
2751
+ ] ;
2752
+ if ( this . studyIds . result ! . length > 1 ) {
2753
+ // if more than one study, add "Study of Origin" attribute
2754
+ specialAttributes . push ( {
2755
+ clinicalAttributeId : SpecialAttribute . StudyOfOrigin ,
2756
+ datatype : CLINICAL_ATTRIBUTE_FIELD_ENUM . DATATYPE_STRING ,
2757
+ description : 'Study which the sample is a part of.' ,
2758
+ displayName : 'Study of origin' ,
2759
+ patientAttribute : false ,
2760
+ studyId : '' ,
2761
+ priority : '0' , // TODO: change?
2762
+ } as ClinicalAttribute ) ;
2763
+ }
2764
+ if ( this . samples . result ! . length !== this . patients . result ! . length ) {
2765
+ // if different number of samples and patients, add "Num Samples of Patient" attribute
2766
+ specialAttributes . push ( {
2767
+ clinicalAttributeId : SpecialAttribute . NumSamplesPerPatient ,
2768
+ datatype : CLINICAL_ATTRIBUTE_FIELD_ENUM . DATATYPE_NUMBER ,
2769
+ description : 'Number of queried samples for each patient.' ,
2770
+ displayName : '# Samples per Patient' ,
2771
+ patientAttribute : true ,
2772
+ } as ClinicalAttribute ) ;
2773
+ }
2774
+ return [
2775
+ ...serverAttributes ,
2776
+ ...specialAttributes ,
2777
+ ...this . clinicalAttributes_profiledIn . result ! ,
2778
+ ...this . clinicalAttributes_comparisonGroupMembership . result ! ,
2779
+ ] ;
2780
+ } ,
2781
+ } ) ;
2782
+
2783
+ readonly customAttributes = remoteData ( {
2727
2784
await : ( ) => [ this . sampleMap ] ,
2728
2785
invoke : async ( ) => {
2729
2786
let ret : ExtendedClinicalAttribute [ ] = [ ] ;
@@ -5693,7 +5750,7 @@ export class ResultsViewPageStore extends AnalysisStore
5693
5750
this . coverageInformation ,
5694
5751
this . filteredSampleKeyToSample ,
5695
5752
this . filteredPatientKeyToPatient ,
5696
- this . clinicalAttributes_customCharts
5753
+ this . customAttributes
5697
5754
) ;
5698
5755
5699
5756
public mutationCache = new MobxPromiseCache <
0 commit comments