@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sjcrh/proteinpaint-server",
3
- "version": "2.43.1",
3
+ "version": "2.43.2",
4
4
  "description": "a genomics visualization tool for exploring a cohort's genotype and phenotype data",
5
5
  "main": "server.js",
6
6
  "bin": "start.js",
@@ -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
- validateDataNative(q.data as SingleCellDataNative, ds)
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 samplesNotCells = ds.cohort.termdb.q.getAllValues4term(S.isSampleTerm)
87
- if (samplesNotCells.size == 0) throw 'no samples found that are identified by isSampleTerm'
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 samplesNotCells.keys()) {
90
- samples.push({
91
- sample: ds.cohort.termdb.q.id2sampleName(sampleid), // string name for display
92
- sampleid // temporarily kept to assign term value to each sample
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 validateDataNative(D: SingleCellDataNative, ds: any) {
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'