igv-rails 1.0.9.2 → 1.0.9.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6a5dbe3828688651aa7157649f1106742360b272
4
- data.tar.gz: a6e3774cae9aa7c5268a2bb3bdcb5908b27dc85a
3
+ metadata.gz: e41e71ec86fc4750c6e787e26956d1d377bb5c53
4
+ data.tar.gz: 67e4aa36df01edd7e27bf9a30a2b636d430c8eff
5
5
  SHA512:
6
- metadata.gz: 8ac3aaf2ade3a241a57b3de31c69d44cbed2dba49aefcb4b99318b60e01b33a87ac8f02cad69e562253dfd44087f113d50e9cd16abd8d674bbf657cc01eb7727
7
- data.tar.gz: 1c81199d7fb94493e7bc2b4012ac7363944fc973ae5793e33a7b5d4021535bb5b5b0ff851d66c9d06b1f716f08aa822a25dfe2853ec11b62eda0c4a308188013
6
+ metadata.gz: 1ef0d543d13439794623a3c1309e00f91ded938e4e869750aa4115479101b0f9a288b92e77594aefcb18bf087db3411b76717ee6afdab3744e78267f1ba0ea93
7
+ data.tar.gz: d37f2aa24171507dd7d6ea336541c78441436a31d490a6bce3a22dec739fd2aabacbc595fe6c322f361e2f9a003d3e5188ee9d68c896ee9bbf2061c92414fa97
data/README.md CHANGED
@@ -89,9 +89,9 @@ This is [igv-web](https://www.broadinstitute.org/software/igv/home) GEMified for
89
89
  bundle gem igv-rails
90
90
  cd igv-rails
91
91
  mkdir -p vendor/assets/javascripts
92
- curl https://igv.org/web/beta/igv-all.js -o vendor/assets/javascripts/igv.js
92
+ curl https://igv.org/web/beta/igv-beta.js -o vendor/assets/javascripts/igv.js
93
93
  mkdir -p vendor/assets/stylesheets
94
- curl https://igv.org/web/beta/igv.css -o vendor/assets/stylesheets/igv.css
94
+ curl https://igv.org/web/beta/igv-beta.css -o vendor/assets/stylesheets/igv.css
95
95
  echo "" >> README.md; echo "# igv appended README #" >> README.md; echo "" >> README.md
96
96
  curl https://github.com/broadinstitute/igv-web/blob/master/README.md >> README.md
97
97
  echo "" >> LICENSE; echo "# igv appended LICENSE #" >> LICENSE; echo "" >> LICENSE
@@ -1,5 +1,5 @@
1
1
  module Igv
2
2
  module Rails
3
- VERSION = "1.0.9.2"
3
+ VERSION = "1.0.9.3"
4
4
  end
5
5
  end
@@ -2776,7 +2776,7 @@ var igv = (function (igv) {
2776
2776
  .then(function (chrToIndex) {
2777
2777
 
2778
2778
  var chrId, queryChr, alignmentContainer;
2779
-
2779
+
2780
2780
  queryChr = self.chrAliasTable.hasOwnProperty(chr) ? self.chrAliasTable[chr] : chr;
2781
2781
 
2782
2782
  chrId = chrToIndex[queryChr];
@@ -2816,7 +2816,7 @@ var igv = (function (igv) {
2816
2816
  .then(function (compressed) {
2817
2817
 
2818
2818
  var ba = new Uint8Array(igv.unbgzf(compressed)); //new Uint8Array(igv.unbgzf(compressed)); //, c.maxv.block - c.minv.block + 1));
2819
- igv.BamUtils.decodeBamRecords(ba, c.minv.offset, alignmentContainer, bpStart, bpEnd, chrId, self.indexToChr[chrId], self.filter);
2819
+ igv.BamUtils.decodeBamRecords(ba, c.minv.offset, alignmentContainer, bpStart, bpEnd, chrId, self.indexToChr, self.filter);
2820
2820
 
2821
2821
  fulfill(alignmentContainer);
2822
2822
 
@@ -3361,16 +3361,6 @@ var igv = (function (igv) {
3361
3361
 
3362
3362
  };
3363
3363
 
3364
- igv.BAMTrack.prototype.popupData = function (genomicLocation, xOffset, yOffset, referenceFrame) {
3365
-
3366
- if (yOffset >= this.coverageTrack.top && yOffset < this.coverageTrack.height) {
3367
- return this.coverageTrack.popupData(genomicLocation, xOffset, this.coverageTrack.top, referenceFrame);
3368
- } else {
3369
- return this.alignmentTrack.popupData(genomicLocation, xOffset, yOffset - this.alignmentTrack.top, referenceFrame);
3370
- }
3371
-
3372
- };
3373
-
3374
3364
  igv.BAMTrack.prototype.popupDataWithConfiguration = function (config) {
3375
3365
 
3376
3366
  if (config.y >= this.coverageTrack.top && config.y < this.coverageTrack.height) {
@@ -3871,7 +3861,6 @@ var igv = (function (igv) {
3871
3861
  function drawPairConnector(alignment, yRect, alignmentHeight) {
3872
3862
 
3873
3863
  var alignmentColor = getAlignmentColor.call(self, alignment.firstAlignment),
3874
- outlineColor = 'alignmentColor',
3875
3864
  xBlockStart = (alignment.connectingStart - bpStart) / bpPerPixel,
3876
3865
  xBlockEnd = (alignment.connectingEnd - bpStart) / bpPerPixel,
3877
3866
  yStrokedLine = yRect + alignmentHeight / 2;
@@ -3884,7 +3873,7 @@ var igv = (function (igv) {
3884
3873
  alignmentColor = igv.addAlphaToRGB(alignmentColor, "0.15");
3885
3874
  }
3886
3875
 
3887
- igv.graphics.setProperties(ctx, {fillStyle: alignmentColor, strokeStyle: outlineColor});
3876
+ igv.graphics.setProperties(ctx, {fillStyle: alignmentColor, strokeStyle: alignmentColor});
3888
3877
 
3889
3878
  igv.graphics.strokeLine(ctx, xBlockStart, yStrokedLine, xBlockEnd, yStrokedLine);
3890
3879
 
@@ -4446,7 +4435,7 @@ var igv = (function (igv) {
4446
4435
  } else {
4447
4436
  qualArray = [];
4448
4437
  for (j = 0; j < lseq; ++j) {
4449
- qualArray.push(ba[p + j] - 33);
4438
+ qualArray.push(ba[p + j]);
4450
4439
  }
4451
4440
  }
4452
4441
  p += lseq;
@@ -6837,7 +6826,7 @@ var igv = (function (igv) {
6837
6826
  trackView = new igv.TrackView(this, $(this.trackContainerDiv), track);
6838
6827
  this.trackViews.push(trackView);
6839
6828
  this.reorderTracks();
6840
- trackView.resize();
6829
+ trackView.update();
6841
6830
  };
6842
6831
 
6843
6832
  igv.Browser.prototype.reorderTracks = function () {
@@ -11269,6 +11258,8 @@ var igv = (function (igv) {
11269
11258
  }
11270
11259
  } else if (config.sourceType === "bigquery") {
11271
11260
  this.reader = new igv.BigQueryFeatureReader(config);
11261
+ } else if (config.sourceType === 'ucscservice') {
11262
+ this.reader = new igv.UCSCServiceReader(config.source);
11272
11263
  } else if (config.source !== undefined) {
11273
11264
  this.reader = new igv.CustomServiceReader(config.source);
11274
11265
  }
@@ -11597,7 +11588,7 @@ var igv = (function (igv) {
11597
11588
  }
11598
11589
  this.maxRows = config.maxRows;
11599
11590
 
11600
- if ( config.url &&
11591
+ if (config.url &&
11601
11592
  (
11602
11593
  igv.filenameOrURLHasSuffix(config.url, '.bigbed') || igv.filenameOrURLHasSuffix(config.url, '.bb')
11603
11594
  ||
@@ -11616,13 +11607,14 @@ var igv = (function (igv) {
11616
11607
  this.render = renderVariant;
11617
11608
  this.homvarColor = "rgb(17,248,254)";
11618
11609
  this.hetvarColor = "rgb(34,12,253)";
11619
- }
11620
- else if ("FusionJuncSpan" === config.type) {
11610
+ } else if ("FusionJuncSpan" === config.type) {
11621
11611
  this.render = renderFusionJuncSpan;
11622
11612
  this.height = config.height || 50;
11623
11613
  this.autoHeight = false;
11624
- }
11625
- else {
11614
+ } else if ("snp" === config.type) {
11615
+ // TODO -- snp specific render function
11616
+ this.render = renderFeature;
11617
+ } else {
11626
11618
  this.render = renderFeature;
11627
11619
  this.arrowSpacing = 30;
11628
11620
 
@@ -11682,6 +11674,7 @@ var igv = (function (igv) {
11682
11674
  * @returns {*}
11683
11675
  */
11684
11676
  igv.FeatureTrack.prototype.computePixelHeight = function (features) {
11677
+ var height;
11685
11678
 
11686
11679
  if (this.displayMode === "COLLAPSED") {
11687
11680
  return this.variantHeight;
@@ -11691,11 +11684,15 @@ var igv = (function (igv) {
11691
11684
  if (features && (typeof features.forEach === "function")) {
11692
11685
  features.forEach(function (feature) {
11693
11686
 
11694
- if (feature.row && feature.row > maxRow) maxRow = feature.row;
11687
+ if (feature.row && feature.row > maxRow) {
11688
+ maxRow = feature.row;
11689
+ }
11695
11690
 
11696
11691
  });
11697
11692
  }
11698
- return Math.max(this.variantHeight, (maxRow + 1) * (this.displayMode === "SQUISHED" ? this.squishedCallHeight : this.expandedCallHeight));
11693
+
11694
+ height = Math.max(this.variantHeight, (maxRow + 1) * ("SQUISHED" === this.displayMode ? this.squishedCallHeight : this.expandedCallHeight));
11695
+ return height;
11699
11696
 
11700
11697
  }
11701
11698
 
@@ -11726,7 +11723,7 @@ var igv = (function (igv) {
11726
11723
  if (gene.end < bpStart) continue;
11727
11724
  if (gene.start > bpEnd) break;
11728
11725
 
11729
- if(!selectedFeature && selectedFeatureName && selectedFeatureName === gene.name.toUpperCase()) {
11726
+ if (!selectedFeature && selectedFeatureName && selectedFeatureName === gene.name.toUpperCase()) {
11730
11727
  selectedFeature = gene;
11731
11728
  }
11732
11729
  else {
@@ -11734,7 +11731,7 @@ var igv = (function (igv) {
11734
11731
  }
11735
11732
  }
11736
11733
 
11737
- if(selectedFeature) {
11734
+ if (selectedFeature) {
11738
11735
  c = selectedFeature.color;
11739
11736
  selectedFeature.color = "rgb(255,0,0)";
11740
11737
  track.render.call(this, selectedFeature, bpStart, bpPerPixel, pixelHeight, ctx, options);
@@ -11761,30 +11758,51 @@ var igv = (function (igv) {
11761
11758
  // feature is not already loaded this won't work, but the user wouldn't be mousing over it either.
11762
11759
  if (this.featureSource.featureCache) {
11763
11760
 
11764
- var chr = referenceFrame.chrName,
11765
- tolerance = 2 * referenceFrame.bpPerPixel, // We need some tolerance around genomicLocation, start with +/- 2 pixels
11766
- featureList = this.featureSource.featureCache.queryFeatures(chr, genomicLocation - tolerance, genomicLocation + tolerance),
11767
- row;
11761
+ var tolerance,
11762
+ featureList,
11763
+ row,
11764
+ popupData,
11765
+ ss,
11766
+ ee,
11767
+ str,
11768
+ filtered,
11769
+ mapped;
11770
+
11771
+ // We need some tolerance around genomicLocation, start with +/- 2 pixels
11772
+ tolerance = 2 * referenceFrame.bpPerPixel;
11773
+ ss = genomicLocation - tolerance;
11774
+ ee = genomicLocation + tolerance;
11775
+ featureList = this.featureSource.featureCache.queryFeatures(referenceFrame.chrName, ss, ee);
11768
11776
 
11769
11777
  if ('COLLAPSED' !== this.displayMode) {
11770
- row = 'SQUISHED' === this.displayMode ? Math.floor(yOffset / this.squishedCallHeight) : Math.floor(yOffset / this.expandedCallHeight);
11778
+ row = 'SQUISHED' === this.displayMode ? Math.floor((yOffset - 2)/this.expandedCallHeight) : Math.floor((yOffset - 5)/this.squishedCallHeight);
11771
11779
  }
11772
11780
 
11773
11781
  if (featureList && featureList.length > 0) {
11774
11782
 
11783
+ // filtered = _.filter(featureList, function (ff) {
11784
+ // return ff.end >= ss && ff.start <= ee;
11785
+ // });
11786
+ //
11787
+ // mapped = _.map(filtered, function (f) {
11788
+ // return f.row;
11789
+ // });
11790
+ //
11791
+ // str = mapped.join(' ');
11775
11792
 
11776
- var popupData = [];
11793
+ popupData = [];
11777
11794
  featureList.forEach(function (feature) {
11778
- if (feature.end >= genomicLocation - tolerance &&
11779
- feature.start <= genomicLocation + tolerance) {
11795
+ var featureData;
11796
+
11797
+ if (feature.end >= ss && feature.start <= ee) {
11798
+
11799
+ // console.log('row ' + row + ' feature-rows ' + str + ' features ' + _.size(featureList));
11780
11800
 
11781
- // If row number is specified use it
11782
11801
  if (row === undefined || feature.row === undefined || row === feature.row) {
11783
- var featureData;
11802
+
11784
11803
  if (feature.popupData) {
11785
11804
  featureData = feature.popupData(genomicLocation);
11786
- }
11787
- else {
11805
+ } else {
11788
11806
  featureData = extractPopupData(feature);
11789
11807
  }
11790
11808
  if (featureData) {
@@ -11831,7 +11849,7 @@ var igv = (function (igv) {
11831
11849
 
11832
11850
  menuItems.push(igv.colorPickerMenuItem(popover, this.trackView));
11833
11851
 
11834
- mapped = _.map(["COLLAPSED", "SQUISHED", "EXPANDED"], function(displayMode, index) {
11852
+ mapped = _.map(["COLLAPSED", "SQUISHED", "EXPANDED"], function (displayMode, index) {
11835
11853
  return {
11836
11854
  object: $(markupStringified(displayMode, index, self.displayMode)),
11837
11855
  click: function () {
@@ -11850,17 +11868,17 @@ var igv = (function (igv) {
11850
11868
  chosen;
11851
11869
 
11852
11870
  lut =
11853
- {
11854
- "COLLAPSED": "Collapse",
11855
- "SQUISHED": "Squish",
11856
- "EXPANDED": "Expand"
11857
- };
11871
+ {
11872
+ "COLLAPSED": "Collapse",
11873
+ "SQUISHED": "Squish",
11874
+ "EXPANDED": "Expand"
11875
+ };
11858
11876
 
11859
11877
  chosen = (0 === index) ? '<div class="igv-track-menu-border-top">' : '<div>';
11860
11878
  if (displayMode === selfDisplayMode) {
11861
- return chosen + '<i class="fa fa-check fa-check-shim"></i>' + lut[ displayMode ] + '</div>'
11879
+ return chosen + '<i class="fa fa-check fa-check-shim"></i>' + lut[displayMode] + '</div>'
11862
11880
  } else {
11863
- return chosen + '<i class="fa fa-check fa-check-shim fa-check-hidden"></i>' + lut[ displayMode ] + '</div>';
11881
+ return chosen + '<i class="fa fa-check fa-check-shim fa-check-hidden"></i>' + lut[displayMode] + '</div>';
11864
11882
  }
11865
11883
 
11866
11884
  }
@@ -12039,10 +12057,9 @@ var igv = (function (igv) {
12039
12057
  }
12040
12058
 
12041
12059
 
12042
-
12043
12060
  textFitsInBox = (boxX1 - boxX) > ctx.measureText(feature.name).width;
12044
12061
 
12045
- if ( (feature.name !== undefined && feature.name.toUpperCase() === selectedFeatureName) ||
12062
+ if ((feature.name !== undefined && feature.name.toUpperCase() === selectedFeatureName) ||
12046
12063
  ((textFitsInBox || geneColor) && this.displayMode !== "SQUISHED" && feature.name !== undefined)) {
12047
12064
  geneFontStyle = {
12048
12065
  font: '10px PT Sans',
@@ -12205,6 +12222,144 @@ var igv = (function (igv) {
12205
12222
  })
12206
12223
  (igv || {});
12207
12224
 
12225
+ /*
12226
+ * The MIT License (MIT)
12227
+ *
12228
+ * Copyright (c) 2016-2017 The Regents of the University of California
12229
+ * Author: Jim Robinson
12230
+ *
12231
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
12232
+ * of this software and associated documentation files (the "Software"), to deal
12233
+ * in the Software without restriction, including without limitation the rights
12234
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12235
+ * copies of the Software, and to permit persons to whom the Software is
12236
+ * furnished to do so, subject to the following conditions:
12237
+ *
12238
+ * The above copyright notice and this permission notice shall be included in
12239
+ * all copies or substantial portions of the Software.
12240
+ *
12241
+ *
12242
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12243
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
12244
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
12245
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
12246
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
12247
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
12248
+ * THE SOFTWARE.
12249
+ */
12250
+
12251
+ /**
12252
+ * Created by jrobinso on 9/25/17.
12253
+ */
12254
+
12255
+ var igv = (function (igv) {
12256
+
12257
+
12258
+ igv.FeatureUtils = {
12259
+
12260
+ packFeatures: function (features, maxRows, sorted) {
12261
+
12262
+ var start;
12263
+ var end;
12264
+
12265
+ if (!features) return;
12266
+
12267
+ maxRows = maxRows || 10000;
12268
+
12269
+ if(!sorted) {
12270
+ features.sort(function (a, b) {
12271
+ return a.start - b.start;
12272
+ });
12273
+ }
12274
+
12275
+
12276
+
12277
+ if (features.length === 0) {
12278
+ return [];
12279
+
12280
+ } else {
12281
+
12282
+ var bucketList = [],
12283
+ allocatedCount = 0,
12284
+ lastAllocatedCount = 0,
12285
+ nextStart,
12286
+ row,
12287
+ index,
12288
+ bucket,
12289
+ feature,
12290
+ gap = 2,
12291
+ packedRows = [],
12292
+ bucketStart;
12293
+
12294
+ start = features[0].start;
12295
+ end = features[features.length - 1].start;
12296
+
12297
+ bucketStart = Math.max(start, features[0].start);
12298
+ nextStart = bucketStart;
12299
+
12300
+ features.forEach(function (alignment) {
12301
+
12302
+ var buckListIndex = Math.max(0, alignment.start - bucketStart);
12303
+ if (bucketList[buckListIndex] === undefined) {
12304
+ bucketList[buckListIndex] = [];
12305
+ }
12306
+ bucketList[buckListIndex].push(alignment);
12307
+ });
12308
+
12309
+
12310
+ row = 0;
12311
+
12312
+ while (allocatedCount < features.length && packedRows.length < maxRows) {
12313
+
12314
+
12315
+ while (nextStart <= end) {
12316
+
12317
+ bucket = undefined;
12318
+
12319
+ while (!bucket && nextStart <= end) {
12320
+
12321
+ index = nextStart - bucketStart;
12322
+ if (bucketList[index] === undefined) {
12323
+ ++nextStart; // No buckets at this index
12324
+ } else {
12325
+ bucket = bucketList[index];
12326
+ }
12327
+
12328
+ } // while (bucket)
12329
+
12330
+ if (!bucket) {
12331
+ break;
12332
+ }
12333
+ feature = bucket.pop();
12334
+ if (0 === bucket.length) {
12335
+ bucketList[index] = undefined;
12336
+ }
12337
+
12338
+ feature.row = row;
12339
+
12340
+ nextStart = feature.end + gap;
12341
+ ++allocatedCount;
12342
+
12343
+ } // while (nextStart)
12344
+
12345
+ row++;
12346
+ nextStart = bucketStart;
12347
+
12348
+ if (allocatedCount === lastAllocatedCount) break; // Protect from infinite loops
12349
+
12350
+ lastAllocatedCount = allocatedCount;
12351
+
12352
+ } // while (allocatedCount)
12353
+
12354
+ }
12355
+ }
12356
+
12357
+ }
12358
+
12359
+
12360
+ return igv;
12361
+ })(igv || {});
12362
+
12208
12363
  /*
12209
12364
  * The MIT License (MIT)
12210
12365
  *
@@ -13208,6 +13363,69 @@ var igv = (function (igv) {
13208
13363
  return igv;
13209
13364
  })(igv || {});
13210
13365
 
13366
+ /*
13367
+ * The MIT License (MIT)
13368
+ *
13369
+ * Copyright (c) 2016-2017 The Regents of the University of California
13370
+ * Author: Jim Robinson
13371
+ *
13372
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
13373
+ * of this software and associated documentation files (the "Software"), to deal
13374
+ * in the Software without restriction, including without limitation the rights
13375
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13376
+ * copies of the Software, and to permit persons to whom the Software is
13377
+ * furnished to do so, subject to the following conditions:
13378
+ *
13379
+ * The above copyright notice and this permission notice shall be included in
13380
+ * all copies or substantial portions of the Software.
13381
+ *
13382
+ *
13383
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13384
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13385
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
13386
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
13387
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
13388
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
13389
+ * THE SOFTWARE.
13390
+ */
13391
+
13392
+ var igv = (function (igv) {
13393
+
13394
+ igv.UCSCServiceReader = function (config) {
13395
+ this.config = config;
13396
+ };
13397
+
13398
+ igv.UCSCServiceReader.prototype.readFeatures = function (chr, start, end) {
13399
+ var self = this,
13400
+ url = this.config.url + '&table=' + this.config.tableName + '&chr=' + chr + '&start=' + start + '&end=' + end;
13401
+
13402
+ return new Promise(function (fulfill, reject) {
13403
+ igv.xhr.loadJson(url, self.config)
13404
+ .then(function (data) {
13405
+ if (data) {
13406
+ data.forEach(function (json) {
13407
+ decodeJson(json);
13408
+ });
13409
+ fulfill(data);
13410
+ } else {
13411
+ fulfill(null);
13412
+ }
13413
+ })
13414
+ .catch(function (error) {
13415
+ reject(error);
13416
+ });
13417
+ });
13418
+ };
13419
+
13420
+ // TODO -- generalize
13421
+ function decodeJson(feature) {
13422
+ if(feature.start) feature.start = Number.parseInt(feature.start);
13423
+ if(feature.end) feature.end = Number.parseInt(feature.end);
13424
+ }
13425
+
13426
+ return igv;
13427
+ })(igv || {});
13428
+
13211
13429
  /*
13212
13430
  * The MIT License (MIT)
13213
13431
  *
@@ -13916,7 +14134,7 @@ var igv = (function (igv) {
13916
14134
 
13917
14135
  return new Promise(function (fulfill, reject) {
13918
14136
 
13919
- getChrNameMap().then(function (chrAliasTable) {
14137
+ getChrAliasTable().then(function (chrAliasTable) {
13920
14138
 
13921
14139
  var queryChr = chrAliasTable.hasOwnProperty(chr) ? chrAliasTable[chr] : chr,
13922
14140
  readURL = self.url + "/reads/search";
@@ -13937,7 +14155,7 @@ var igv = (function (igv) {
13937
14155
 
13938
14156
  }).catch(reject);
13939
14157
 
13940
- function getChrNameMap() {
14158
+ function getChrAliasTable() {
13941
14159
 
13942
14160
  if (self.chrAliasTable) {
13943
14161
  return Promise.resolve(self.chrAliasTable);
@@ -13983,7 +14201,7 @@ var igv = (function (igv) {
13983
14201
  else {
13984
14202
 
13985
14203
  // Try hardcoded constants -- workaround for non-compliant data at Google
13986
- populateChrNameMap(self.chrAliasTable, self.config.datasetId);
14204
+ populateChrAliasTable(self.chrAliasTable, self.config.datasetId);
13987
14205
 
13988
14206
  fulfill(self.chrAliasTable);
13989
14207
  }
@@ -14241,10 +14459,10 @@ var igv = (function (igv) {
14241
14459
  /**
14242
14460
  * Hardcoded hack to work around some non-compliant google datasets
14243
14461
  *
14244
- * @param chrNameMap
14462
+ * @param chrAliasTable
14245
14463
  * @param datasetId
14246
14464
  */
14247
- function populateChrNameMap(chrNameMap, datasetId) {
14465
+ function populateChrAliasTable(chrAliasTable, datasetId) {
14248
14466
  var i;
14249
14467
  if ("461916304629" === datasetId || "337315832689" === datasetId) {
14250
14468
  for (i = 1; i < 23; i++) {
@@ -14638,7 +14856,7 @@ var igv = (function (igv) {
14638
14856
 
14639
14857
  self.readHeader().then(function (header) {
14640
14858
 
14641
- getChrNameMap().then(function (chrNameMap) {
14859
+ getChrAliasTable().then(function (chrAliasTable) {
14642
14860
 
14643
14861
  var queryChr = chrAliasTable.hasOwnProperty(chr) ? chrAliasTable[chr] : chr,
14644
14862
  readURL = self.url + "/variants/search";
@@ -14669,7 +14887,7 @@ var igv = (function (igv) {
14669
14887
  });
14670
14888
 
14671
14889
 
14672
- function getChrNameMap() {
14890
+ function getChrAliasTable() {
14673
14891
 
14674
14892
  return new Promise(function (fulfill, reject) {
14675
14893
 
@@ -23224,12 +23442,12 @@ var igv = (function (igv) {
23224
23442
  if (undefined === igv.browser || undefined === igv.browser.formats) {
23225
23443
  return undefined;
23226
23444
  } else {
23227
- return igv.browser.formats[ name ];
23445
+ return igv.browser.formats[name];
23228
23446
  }
23229
23447
 
23230
23448
  };
23231
23449
 
23232
- igv.createTrackWithConfiguration = function(conf) {
23450
+ igv.createTrackWithConfiguration = function (conf) {
23233
23451
 
23234
23452
  var type = (undefined === conf.type) ? 'unknown_type' : conf.type.toLowerCase();
23235
23453
 
@@ -23239,6 +23457,7 @@ var igv = (function (igv) {
23239
23457
  break;
23240
23458
 
23241
23459
  case "annotation":
23460
+ case "snp":
23242
23461
  case "genes":
23243
23462
  case "fusionjuncspan":
23244
23463
  return new igv.FeatureTrack(conf);
@@ -23279,7 +23498,7 @@ var igv = (function (igv) {
23279
23498
 
23280
23499
  };
23281
23500
 
23282
- igv.inferTrackTypes = function(config) {
23501
+ igv.inferTrackTypes = function (config) {
23283
23502
 
23284
23503
  function translateDeprecatedTypes(config) {
23285
23504
 
@@ -23437,7 +23656,7 @@ var igv = (function (igv) {
23437
23656
 
23438
23657
  track.height = config.height || ('wig' === config.type ? 50 : 100);
23439
23658
 
23440
- if(config.autoHeight === undefined) config.autoHeight = config.autoheight; // Some case confusion in the initial releasae
23659
+ if (config.autoHeight === undefined) config.autoHeight = config.autoheight; // Some case confusion in the initial releasae
23441
23660
 
23442
23661
  track.autoHeight = config.autoHeight === undefined ? (config.height === undefined) : config.autoHeight;
23443
23662
  track.minHeight = config.minHeight || Math.min(50, track.height);
@@ -23447,7 +23666,7 @@ var igv = (function (igv) {
23447
23666
  track.visibilityWindow = config.visibilityWindow;
23448
23667
  }
23449
23668
 
23450
- if(track.type === undefined) {
23669
+ if (track.type === undefined) {
23451
23670
  track.type = config.type;
23452
23671
  }
23453
23672
 
@@ -23466,7 +23685,7 @@ var igv = (function (igv) {
23466
23685
  }
23467
23686
  };
23468
23687
 
23469
- igv.inferIndexPath = function(url, extension) {
23688
+ igv.inferIndexPath = function (url, extension) {
23470
23689
 
23471
23690
  var path, idx;
23472
23691
 
@@ -23474,7 +23693,7 @@ var igv = (function (igv) {
23474
23693
  throw new Error("Cannot infer an index path for a local File. Please select explicitly")
23475
23694
  }
23476
23695
 
23477
- if(url.includes("?")) {
23696
+ if (url.includes("?")) {
23478
23697
  idx = url.indexOf("?");
23479
23698
  return url.substring(0, idx) + "." + extension + url.substring(idx);
23480
23699
  } else {
@@ -23563,13 +23782,13 @@ var igv = (function (igv) {
23563
23782
  menuItems;
23564
23783
 
23565
23784
  config =
23566
- {
23567
- popover: popover,
23568
- viewport:viewport,
23569
- genomicLocation: genomicLocation,
23570
- x: xOffset,
23571
- y: yOffset
23572
- };
23785
+ {
23786
+ popover: popover,
23787
+ viewport: viewport,
23788
+ genomicLocation: genomicLocation,
23789
+ x: xOffset,
23790
+ y: yOffset
23791
+ };
23573
23792
 
23574
23793
  menuItems = [];
23575
23794
  if (viewport.trackView.track.popupMenuItemList) {
@@ -23633,7 +23852,7 @@ var igv = (function (igv) {
23633
23852
 
23634
23853
  all = [];
23635
23854
  if (trackView.track.menuItemList) {
23636
- all = menuItems.concat( igv.trackMenuItemListHelper(trackView.track.menuItemList(popover)) );
23855
+ all = menuItems.concat(igv.trackMenuItemListHelper(trackView.track.menuItemList(popover)));
23637
23856
  }
23638
23857
 
23639
23858
  if (trackView.track.removable !== false) {
@@ -23653,13 +23872,13 @@ var igv = (function (igv) {
23653
23872
  return all;
23654
23873
  };
23655
23874
 
23656
- igv.trackMenuItemListHelper = function(itemList) {
23875
+ igv.trackMenuItemListHelper = function (itemList) {
23657
23876
 
23658
23877
  var list = [];
23659
23878
 
23660
23879
  if (_.size(itemList) > 0) {
23661
23880
 
23662
- list = _.map(itemList, function(item, i) {
23881
+ list = _.map(itemList, function (item, i) {
23663
23882
  var $e;
23664
23883
 
23665
23884
  if (item.name) {
@@ -23677,7 +23896,7 @@ var igv = (function (igv) {
23677
23896
  $e.click(item.click);
23678
23897
  }
23679
23898
 
23680
- return { object: $e, init: (item.init || undefined) };
23899
+ return {object: $e, init: (item.init || undefined)};
23681
23900
  });
23682
23901
  }
23683
23902
 
@@ -23708,7 +23927,7 @@ var igv = (function (igv) {
23708
23927
  $e.text(menuItemLabel);
23709
23928
 
23710
23929
 
23711
- clickHandler = function(){
23930
+ clickHandler = function () {
23712
23931
  var $element = $(trackView.trackDiv);
23713
23932
  igv.dialog.configure(dialogLabelHandler, dialogInputValue, dialogClickHandler, undefined, undefined);
23714
23933
  igv.dialog.show($element);
@@ -23717,7 +23936,7 @@ var igv = (function (igv) {
23717
23936
 
23718
23937
  $e.click(clickHandler);
23719
23938
 
23720
- return { object: $e, init: undefined };
23939
+ return {object: $e, init: undefined};
23721
23940
  };
23722
23941
 
23723
23942
  igv.dataRangeMenuItem = function (popover, trackView) {
@@ -23736,7 +23955,7 @@ var igv = (function (igv) {
23736
23955
 
23737
23956
  $e.click(clickHandler);
23738
23957
 
23739
- return { object: $e, init: undefined };
23958
+ return {object: $e, init: undefined};
23740
23959
  };
23741
23960
 
23742
23961
  igv.colorPickerMenuItem = function (popover, trackView) {
@@ -23758,13 +23977,13 @@ var igv = (function (igv) {
23758
23977
  defaultColor = trackView.track.config.color || igv.browser.constants.defaultColor;
23759
23978
 
23760
23979
  offset =
23761
- {
23762
- left: ($(trackView.trackDiv).offset().left + $(trackView.trackDiv).width()) - igv.colorPicker.$container.width(),
23763
- top: $(trackView.trackDiv).offset().top
23764
- };
23980
+ {
23981
+ left: ($(trackView.trackDiv).offset().left + $(trackView.trackDiv).width()) - igv.colorPicker.$container.width(),
23982
+ top: $(trackView.trackDiv).offset().top
23983
+ };
23765
23984
 
23766
23985
  colorUpdateHandler = function (color) {
23767
- trackView.setColor( color )
23986
+ trackView.setColor(color)
23768
23987
  };
23769
23988
 
23770
23989
  igv.colorPicker.configure(trackView, color, defaultColor, offset, colorUpdateHandler);
@@ -23776,7 +23995,7 @@ var igv = (function (igv) {
23776
23995
 
23777
23996
  $e.click(clickHandler);
23778
23997
 
23779
- return { object: $e, init: undefined };
23998
+ return {object: $e, init: undefined};
23780
23999
 
23781
24000
  };
23782
24001
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: igv-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.9.2
4
+ version: 1.0.9.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Van Etten, PhD
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-09-25 00:00:00.000000000 Z
11
+ date: 2017-09-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties