|
486 | 486 | <research-dot-plot |
487 | 487 | style="display:flex; align-self: center" |
488 | 488 | :data="markerGenes || expressionStatsAll" |
489 | | - data-blah="pct_nz_group" |
| 489 | + data-blah="pct_cells_expression" |
490 | 490 | yKey="cell_type" |
491 | 491 | xKey="gene" |
492 | 492 | yLabel="Cell Type" |
|
834 | 834 | |
835 | 835 | tableColumns: [ |
836 | 836 | {key: "tissue", label: "Tissue", class:"capitalize"}, |
837 | | - {key: "totalCells", label: "Total Cells", formatter: (val) => val.toLocaleString()} |
| 837 | + {key: "totalCells", label: "Total Cells", formatter: (val) => val?.toLocaleString()} |
838 | 838 | ], |
839 | 839 | currentDatasetsPage: 1, |
840 | 840 | totalDatasets: null, |
|
888 | 888 | sortable: true, |
889 | 889 | formatter: (val) => typeof val === 'number' ? val.toPrecision(3) : '' |
890 | 890 | },{ |
891 | | - key: 'pct_nz_group', |
| 891 | + key: 'pct_cells_expression', |
892 | 892 | label: '% Expressing', |
893 | 893 | sortable: true, |
894 | 894 | formatter: (val) => typeof val === 'number' ? (val * 100).toFixed(1) + '%' : '' |
|
1142 | 1142 | this.fields = await scUtils.fetchFields(fieldsEnpoint, this.datasetId); |
1143 | 1143 | if(this.fields){ |
1144 | 1144 | if(!this.totalCells){ |
1145 | | - this.totalCells = this.fields.NAME.length; |
| 1145 | + this.totalCells = this.fields.NAME?.length | this.fields.ID?.length; |
1146 | 1146 | } |
1147 | 1147 | llog('fields', this.fields); |
1148 | 1148 | }else{ |
|
1176 | 1176 | const markersEnpoint = this.selectedBI+this.BIendpoints.markers; |
1177 | 1177 | if(markersEnpoint){ |
1178 | 1178 | const url = markersEnpoint; |
1179 | | - this.markers = await scUtils.fetchMarkers(url, this.datasetId); |
| 1179 | + const markersRaw = await scUtils.fetchMarkers(url, this.datasetId); |
| 1180 | + //remap params to handle older/newer versions |
| 1181 | + const markersNormalized = markersRaw.map(m => ({ |
| 1182 | + ...m, |
| 1183 | + mean_expression: m.mean_expression ?? m.mean_expression_raw ?? 0, |
| 1184 | + pct_cells_expression: m.pct_cells_expression ?? m.pct_nz_group ?? 0, |
| 1185 | + // Add other fallback mappings here if needed |
| 1186 | + })); |
| 1187 | + this.markers = markersNormalized; |
1180 | 1188 | llog('markers', this.markers); |
1181 | 1189 | if(this.markers){ |
1182 | 1190 | if(Array.isArray(this.markers)){ |
|
0 commit comments