igv-rails 1.0.9.6 → 1.0.9.7

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: 13bd75480e38855d195faab0a32943d8e3208554
4
- data.tar.gz: bdd708cf6cf4adb74b233596ba132f65e4e2bceb
3
+ metadata.gz: 2ef4d62bc474ad69828211316b07b63b320618a1
4
+ data.tar.gz: a52d1f87db393300eb6dd2ab4a7b71f493f77a1c
5
5
  SHA512:
6
- metadata.gz: aca0fc1568a097ef11416ccbd76f7ef15a3814942bf71e94e74e246862a3ec53a70e5c484bd1ab932e7e2557ee0ede79a1c43b3a501d1b465b3ae1be912d1426
7
- data.tar.gz: f9780e347f50f757da29a3ab944e341cd2ce50d907c7022b4c8ccc48269f9a4da4c702f9e09ab5e06f5870cd2f754a351758c09ed72aa54b6663d26962adfb4c
6
+ metadata.gz: a3318858803119a783e17bbf0c1f2733bf3040320a9b3a4983d7beb5445b083016208725034ec5094523cedfdbfebb005f255a7a1636222f99b99ac3c0d34d64
7
+ data.tar.gz: 21e1dc94eba08a8f8ce87f39ed41e1357e3f3934ad5e464c4d46462f3f440687d7769019aa32b4a2e68482d043bcf60833aa9cc9259e5aa9e018b37ce35feca8
@@ -1,5 +1,5 @@
1
1
  module Igv
2
2
  module Rails
3
- VERSION = "1.0.9.6"
3
+ VERSION = "1.0.9.7"
4
4
  end
5
5
  end
@@ -29831,6 +29831,8 @@ var igv = (function (igv) {
29831
29831
  return false; // Unknown chromosome
29832
29832
  }
29833
29833
  locusObject.chromosome = chromosome; // Map chr to offical name from possible alias
29834
+ locusObject.start = 0;
29835
+ locusObject.end = chromosome.bpLength;
29834
29836
  }
29835
29837
 
29836
29838
  // if just a chromosome name we are done
@@ -49913,11 +49915,6 @@ var igv = (function (igv) {
49913
49915
 
49914
49916
  var variant = new igv.Variant();
49915
49917
 
49916
-
49917
- var self = this,
49918
- altTokens;
49919
-
49920
-
49921
49918
  variant.chr = tokens[0]; // TODO -- use genome aliases
49922
49919
  variant.pos = parseInt(tokens[1]);
49923
49920
  variant.names = tokens[2]; // id in VCF
@@ -49927,15 +49924,11 @@ var igv = (function (igv) {
49927
49924
  variant.filter = tokens[6];
49928
49925
  variant.info = getInfoObject(tokens[7]);
49929
49926
 
49930
- if (variant.info["PERIOD"]) {
49931
- variant.type = 'str';
49932
- }
49933
-
49934
- initAlleles(variant, true);
49935
-
49927
+ init(variant);
49936
49928
 
49937
49929
  return variant;
49938
49930
 
49931
+ //
49939
49932
  function getInfoObject(infoStr) {
49940
49933
 
49941
49934
  if (!infoStr) return undefined;
@@ -49956,9 +49949,9 @@ var igv = (function (igv) {
49956
49949
  var variant = new igv.Variant();
49957
49950
 
49958
49951
  variant.chr = json.referenceName;
49959
- variant.start = parseInt(json.start);
49960
- variant.end = parseInt(json.end);
49961
- variant.pos = variant.start + 1; // GA4GH is not 0 based.
49952
+ variant.start = parseInt(json.start); // Might get overriden below
49953
+ variant.end = parseInt(json.end); // Might get overriden below
49954
+ variant.pos = variant.start + 1; // GA4GH is 0 based.
49962
49955
  variant.names = arrayToCommaString(json.names);
49963
49956
  variant.referenceBases = json.referenceBases + '';
49964
49957
  variant.alternateBases = json.alternateBases + '';
@@ -49966,13 +49959,6 @@ var igv = (function (igv) {
49966
49959
  variant.filter = arrayToCommaString(json.filter);
49967
49960
  variant.info = json.info;
49968
49961
 
49969
- if(variant.pos === 155158842) {
49970
- console.log('');
49971
- }
49972
-
49973
- if (variant.info["PERIOD"]) {
49974
- variant.type = 'str';
49975
- }
49976
49962
 
49977
49963
  // Need to build a hash of calls for fast lookup
49978
49964
  // Note from the GA4GH spec on call ID:
@@ -49992,14 +49978,14 @@ var igv = (function (igv) {
49992
49978
  })
49993
49979
  }
49994
49980
 
49995
- initAlleles(variant, false);
49981
+ init(variant);
49996
49982
 
49997
49983
  return variant;
49998
49984
 
49999
49985
  }
50000
49986
 
50001
49987
 
50002
- function initAlleles(variant, computeStartEnd) {
49988
+ function init(variant) {
50003
49989
 
50004
49990
  //Alleles
50005
49991
  var altTokens = variant.alternateBases.split(","),
@@ -50007,18 +49993,27 @@ var igv = (function (igv) {
50007
49993
  maxAltLength = variant.referenceBases.length;
50008
49994
 
50009
49995
 
49996
+ if (variant.info["PERIOD"]) {
49997
+ variant.type = 'str';
49998
+ }
49999
+
50000
+
50010
50001
  variant.alleles = [];
50011
50002
 
50012
50003
  // If an STR define start and end based on reference allele. Otherwise start and end computed below based
50013
50004
  // on alternate allele type (snp, insertion, deletion)
50014
50005
 
50015
- if('str' === variant.type) {
50006
+ if ('str' === variant.type) {
50016
50007
  variant.start = variant.pos - 1;
50017
50008
  variant.end = variant.start + variant.referenceBases.length;
50009
+
50010
+ } else if (isRefBlock(variant.alternateBases)) {
50011
+ variant.type = "refblock";
50018
50012
  }
50019
50013
 
50020
- if (variant.alternateBases === ".") { // "." => no alternate alleles
50014
+ if (variant.type === "refblock" || variant.alternateBases === ".") { // "." => no alternate alleles
50021
50015
  variant.heterozygosity = 0;
50016
+
50022
50017
  } else {
50023
50018
  altTokens.forEach(function (alt) {
50024
50019
  var a, s, e, diff;
@@ -50027,7 +50022,7 @@ var igv = (function (igv) {
50027
50022
 
50028
50023
  // Adjust for padding, used for insertions and deletions, unless variant is a short tandem repeat.
50029
50024
 
50030
- if (!('str' === variant.type) && alt.length > 0 && computeStartEnd) {
50025
+ if (!("str" === variant.type) && alt.length > 0) {
50031
50026
 
50032
50027
  diff = variant.referenceBases.length - alt.length;
50033
50028
 
@@ -50122,7 +50117,8 @@ var igv = (function (igv) {
50122
50117
  return fields;
50123
50118
 
50124
50119
  };
50125
-
50120
+
50121
+
50126
50122
  function arrayToCommaString(value) {
50127
50123
  if (!(Array.isArray(value))) {
50128
50124
  return value;
@@ -50130,6 +50126,16 @@ var igv = (function (igv) {
50130
50126
  return value.join(',');
50131
50127
  }
50132
50128
 
50129
+
50130
+ function isRefBlock(altAlleles) {
50131
+
50132
+ return !altAlleles ||
50133
+ altAlleles.trim().length === 0 ||
50134
+ altAlleles === "\u003cNON_REF\u003e" ||
50135
+ altAlleles === "\u003c*\u003e";
50136
+
50137
+ }
50138
+
50133
50139
  return igv;
50134
50140
  })(igv || {});
50135
50141
 
@@ -51063,7 +51069,11 @@ var igv = (function (igv) {
51063
51069
  tokens = line.split("\t");
51064
51070
 
51065
51071
  if (tokens.length >= 8) {
51072
+
51066
51073
  variant = igv.createVCFVariant(tokens);
51074
+
51075
+ if("refblock" === variant.type) continue; // Skip reference blocks
51076
+
51067
51077
  variant.header = this.header; // Keep a pointer to the header to interpret fields for popup text
51068
51078
  allFeatures.push(variant);
51069
51079
 
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.6
4
+ version: 1.0.9.7
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-12-15 00:00:00.000000000 Z
11
+ date: 2017-12-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties