@sjcrh/proteinpaint-server 2.43.1 → 2.43.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/routes/termdb.singlecellSamples.ts +10 -9
- package/server.js +1 -1
- package/server.js.map +1 -1
- package/src/serverconfig.js +9 -4
package/package.json
CHANGED
|
@@ -73,7 +73,7 @@ export async function validate_query_singleCell(ds: any, genome: any) {
|
|
|
73
73
|
if (q.data.src == 'gdcapi') {
|
|
74
74
|
gdc_validate_query_singleCell_data(ds, genome)
|
|
75
75
|
} else if (q.data.src == 'native') {
|
|
76
|
-
|
|
76
|
+
getDataNative(q.data as SingleCellDataNative, ds)
|
|
77
77
|
} else {
|
|
78
78
|
throw 'unknown singleCell.data.src'
|
|
79
79
|
}
|
|
@@ -83,14 +83,15 @@ export async function validate_query_singleCell(ds: any, genome: any) {
|
|
|
83
83
|
async function getSamplesNative(S: SingleCellSamplesNative, ds: any) {
|
|
84
84
|
// for now use this quick fix method to pull sample ids annotated by this term
|
|
85
85
|
// to support situation where not all samples from a dataset has sc data
|
|
86
|
-
const
|
|
87
|
-
if (
|
|
86
|
+
const isSamples = ds.cohort.termdb.q.getAllValues4term(S.isSampleTerm)
|
|
87
|
+
if (isSamples.size == 0) throw 'no samples found that are identified by isSampleTerm'
|
|
88
88
|
const samples = [] as any // array of samples with sc data to be sent to client and list in table; cannot use Sample type for the use of "sampleid" temp property
|
|
89
|
-
for (const sampleid of
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
89
|
+
for (const sampleid of isSamples.keys()) {
|
|
90
|
+
if (isSamples.get(sampleid) == '1')
|
|
91
|
+
samples.push({
|
|
92
|
+
sample: ds.cohort.termdb.q.id2sampleName(sampleid), // string name for display
|
|
93
|
+
sampleid // temporarily kept to assign term value to each sample
|
|
94
|
+
})
|
|
94
95
|
}
|
|
95
96
|
if (S.sampleColumns) {
|
|
96
97
|
// has optional terms to show as table columns and annotate samples
|
|
@@ -108,7 +109,7 @@ async function getSamplesNative(S: SingleCellSamplesNative, ds: any) {
|
|
|
108
109
|
}
|
|
109
110
|
}
|
|
110
111
|
|
|
111
|
-
function
|
|
112
|
+
function getDataNative(D: SingleCellDataNative, ds: any) {
|
|
112
113
|
const nameSet = new Set() // guard against duplicating plot names
|
|
113
114
|
for (const plot of D.plots) {
|
|
114
115
|
if (nameSet.has(plot.name)) throw 'duplicate plot.name'
|