@sjcrh/proteinpaint-server 2.139.1 → 2.140.0

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.139.1",
3
+ "version": "2.140.0",
4
4
  "type": "module",
5
5
  "description": "a genomics visualization tool for exploring a cohort's genotype and phenotype data",
6
6
  "main": "src/app.js",
package/routes/grin2.js CHANGED
@@ -203,20 +203,23 @@ function filterAndConvertSnvIndel(sampleName, entry, options) {
203
203
  return [sampleName, entry.chr, entry.pos, entry.pos, "mutation"];
204
204
  }
205
205
  function filterAndConvertCnv(sampleName, entry, options) {
206
- if (!options || options.gainThreshold === void 0 || options.lossThreshold === void 0) {
206
+ if (!options || options.gainThreshold === void 0 || options.lossThreshold === void 0 || options.maxSegLength === void 0) {
207
207
  return null;
208
208
  }
209
- const isGain = entry.value >= options.gainThreshold;
210
- const isLoss = entry.value <= options.lossThreshold;
211
- if (!isGain && !isLoss)
212
- return null;
213
- const lesionType = isGain ? "gain" : "loss";
214
209
  if (!Number.isInteger(entry.start)) {
215
210
  return null;
216
211
  }
217
212
  if (!Number.isInteger(entry.stop)) {
218
213
  return null;
219
214
  }
215
+ if (options.maxSegLength > 0 && entry.stop - entry.start > options.maxSegLength) {
216
+ return null;
217
+ }
218
+ const isGain = entry.value >= options.gainThreshold;
219
+ const isLoss = entry.value <= options.lossThreshold;
220
+ if (!isGain && !isLoss)
221
+ return null;
222
+ const lesionType = isGain ? "gain" : "loss";
220
223
  return [sampleName, entry.chr, entry.start, entry.stop, lesionType];
221
224
  }
222
225
  function filterAndConvertFusion(sampleName, entry, _options) {