igv 3.7.2 → 3.7.3

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/dist/igv.js CHANGED
@@ -14771,13 +14771,12 @@
14771
14771
 
14772
14772
  const transcriptTypes = new Set(['transcript', 'primary_transcript', 'processed_transcript', 'mRNA', 'mrna',
14773
14773
  'lnc_RNA', 'miRNA', 'ncRNA', 'rRNA', 'scRNA', 'snRNA', 'snoRNA', 'tRNA']);
14774
- const cdsTypes = new Set(['CDS', 'cds']);
14775
- const codonTypes = new Set(['start_codon', 'stop_codon']);
14774
+ const cdsTypes = new Set(['CDS', 'cds', 'start_codon', 'stop_codon']);
14776
14775
  const utrTypes = new Set(['5UTR', '3UTR', 'UTR', 'five_prime_UTR', 'three_prime_UTR', "3'-UTR", "5'-UTR"]);
14777
14776
  const exonTypes = new Set(['exon', 'coding-exon']);
14778
14777
 
14779
14778
  const transcriptPartTypes = new Set();
14780
- for (let cltn of [cdsTypes, codonTypes, utrTypes, exonTypes]) {
14779
+ for (let cltn of [cdsTypes, utrTypes, exonTypes]) {
14781
14780
  for (let t of cltn) {
14782
14781
  transcriptPartTypes.add(t);
14783
14782
  }
@@ -14792,7 +14791,7 @@
14792
14791
  }
14793
14792
 
14794
14793
  function isCoding(type) {
14795
- return cdsTypes.has(type) || codonTypes.has(type)
14794
+ return cdsTypes.has(type)
14796
14795
  }
14797
14796
 
14798
14797
  function isUTR(type) {
@@ -14972,12 +14971,17 @@
14972
14971
  if (exon) {
14973
14972
  exon.cdStart = exon.cdStart ? Math.min(cds.start, exon.cdStart) : cds.start;
14974
14973
  exon.cdEnd = exon.cdEnd ? Math.max(cds.end, exon.cdEnd) : cds.end;
14975
- exon.readingFrame = cds.readingFrame;
14976
- // TODO -- merge attributes?
14974
+ if (cds.readingFrame !== undefined) {
14975
+ if (exon.readingFrame === undefined) {
14976
+ exon.readingFrame = cds.readingFrame;
14977
+ } else {
14978
+ // Keep reading frame of first CDS in direction of transcription
14979
+ if (this.strand === '+') ; else {
14980
+ exon.readingFrame = cds.readingFrame;
14981
+ }
14982
+ }
14983
+ }
14977
14984
  } else {
14978
- // cds.cdStart = cds.start
14979
- // cds.cdEnd = cds.end
14980
- // exons.push(cds)
14981
14985
  console.error("No exon found spanning " + cds.start + "-" + cds.end);
14982
14986
  }
14983
14987
 
@@ -14989,6 +14993,11 @@
14989
14993
  this.cdEnd = this.cdEnd ? Math.max(cds.end, this.cdEnd) : cds.end;
14990
14994
  }
14991
14995
 
14996
+ addTerminalCodon(codon) {
14997
+ // Treat terminal codons as CDS
14998
+ this.addCDS(codon);
14999
+ }
15000
+
14992
15001
  addUTR(utr) {
14993
15002
 
14994
15003
  let exon;
@@ -15009,7 +15018,10 @@
15009
15018
  if (utr.end < exon.end) {
15010
15019
  exon.cdStart = utr.end;
15011
15020
  }
15012
- if (utr.start > exon.start) {
15021
+ // Do not "backup" the cdEnd based on a UTR record. A stop_codon might extend cdEnd into the UTR, and we
15022
+ // don't want to quash that with the UTR. Although stop codons are not translated, visually
15023
+ // they appear as part exonic coding sequence. This is a long established convention,
15024
+ if (exon.cdEnd === undefined || utr.start > exon.cdEnd) {
15013
15025
  exon.cdEnd = utr.start;
15014
15026
  }
15015
15027
  }
@@ -35766,6 +35778,11 @@
35766
35778
  }
35767
35779
 
35768
35780
  if (remainder) {
35781
+
35782
+ if (!riteExon) {
35783
+ return undefined
35784
+ }
35785
+
35769
35786
  stringA = sequenceInterval.getSequence(remainder.start, remainder.end);
35770
35787
 
35771
35788
  if (!stringA) {
@@ -50539,19 +50556,26 @@
50539
50556
 
50540
50557
  class BamFilter {
50541
50558
  constructor(options) {
50542
- if (!options) options = {};
50543
- this.vendorFailed = options.vendorFailed = false !== options.vendorFailed;
50544
- this.duplicate = options.duplicate = false !== options.duplicate;
50559
+ options = options || {};
50560
+
50561
+ // Default to true unless explicitly set to false
50562
+ this.vendorFailed = options.vendorFailed !== false;
50563
+
50564
+ // Support both 'duplicate' and 'duplicates' as synonyms
50565
+ const duplicateValue = options.duplicate !== undefined ? options.duplicate : options.duplicates;
50566
+ this.duplicate = duplicateValue !== false;
50567
+
50545
50568
  this.secondary = options.secondary || false;
50546
50569
  this.supplementary = options.supplementary || false;
50547
50570
  this.mq = options.mq || 0;
50571
+
50548
50572
  if (options.readgroups) {
50549
50573
  this.readgroups = new Set(options.readgroups);
50550
50574
  }
50551
50575
  }
50552
50576
 
50553
50577
  pass(alignment) {
50554
- if(!alignment.isMapped()) return false
50578
+ if (!alignment.isMapped()) return false
50555
50579
  if (this.vendorFailed && alignment.isFailsVendorQualityCheck()) return false
50556
50580
  if (this.duplicate && alignment.isDuplicate()) return false
50557
50581
  if (this.secondary && alignment.isSecondary()) return false
@@ -76656,7 +76680,7 @@ ${indent}columns: ${matrix.columns}
76656
76680
  })
76657
76681
  }
76658
76682
 
76659
- const _version = "3.7.2";
76683
+ const _version = "3.7.3";
76660
76684
  function version() {
76661
76685
  return _version
76662
76686
  }