Skip to content

Commit 2837f4a

Browse files
committed
#1135 Handle legitimate genotypes of "0", "1", "2", etc. that occur in mitochondrial DNA and non-par regions of X and Y. "0" designates homozygous ref, "1", homozygous ref.
1 parent fb08bc7 commit 2837f4a

4 files changed

Lines changed: 39 additions & 9 deletions

File tree

client/app/globals/GlobalApp.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class GlobalApp {
99
this.tour = "";
1010
this.completedTour = "";
1111

12-
this.version = "4.11.3";
12+
this.version = "4.11.4";
1313

1414
this.IOBIO_SERVICES = null;
1515
this.HTTP_SERVICES = null;

client/app/models/Vcf.iobio.js

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -484,6 +484,11 @@ export default function vcfiobio(theGlobalApp) {
484484
return str.indexOf(suffix, str.length - suffix.length) !== -1;
485485
}
486486

487+
function isIntegerString(str) {
488+
const num = parseInt(str, 10);
489+
return !isNaN(num) && num.toString() === str;
490+
}
491+
487492
exports.setSamples = function(sampleNames) {
488493
samples = sampleNames;
489494
}
@@ -3402,14 +3407,25 @@ exports._parseClinInfoDeprecated = function(rec, clinvarMap) {
34023407
}
34033408

34043409

3405-
3410+
//
34063411
// Only keep the alt if we have a genotype that matches.
34073412
// For example
3408-
// A->G 0|1 keep
3409-
// A->G,C 0|1 keep A->G, but bypass A->C
3410-
// A->G,C 0|2 bypass A->G, keep A->C
3411-
// A->G,C 1|2 keep A->G, keep A->C
3412-
// unknown . bypass
3413+
// A->G 0|1 keep (phased)
3414+
// A->G 0/1 keep (unphased)
3415+
// A->G 0/0 bypass (homozygous ref for this sample)
3416+
//
3417+
// multi-allelic
3418+
// A->G,C 0|1 keep A->G, but bypass A->C
3419+
// A->G,C 0|2 bypass A->G, keep A->C
3420+
// A->G,C 1|2 keep A->G, keep A->C
3421+
//
3422+
// non-diploid
3423+
// A->G 1 keep (homozygous alt non-diploid)
3424+
// A->G 0 bypass (homozygous ref non-diploid)
3425+
//
3426+
// unspecified
3427+
// A->G . bypass (assumed homozygousref)
3428+
//
34133429
var delim = null;
34143430

34153431
if (gt.gt.indexOf("|") > 0) {
@@ -3421,6 +3437,20 @@ exports._parseClinInfoDeprecated = function(rec, clinvarMap) {
34213437
} else if (gt.gt == ".") {
34223438
gt.keep = false;
34233439
gt.zygosity = "HOMREF";
3440+
} else if (isIntegerString(gt.gt) && parseInt(gt.gt, 10) == 0) {
3441+
// when a single number is present, this is a non-diploid genotype
3442+
// when set to 0, this is homozygous ref
3443+
gt.keep = false;
3444+
gt.zygosity = "HOMREF";
3445+
} else if (isIntegerString(gt.gt) && parseInt(gt.gt, 10) > 0) {
3446+
// when a single number is present, this is a non-diploid genotype
3447+
// when >= to 1 , this is homozygous alt
3448+
gt.keep = true;
3449+
gt.zygosity = "HOM";
3450+
if (isEduMode) {
3451+
gt.eduGenotype = rec.ref + " " + alt;
3452+
gt.eduGenotypeReversed = globalApp.utility.switchGenotype(gt.eduGenotype);
3453+
}
34243454
} else {
34253455
gt.keep = false;
34263456
gt.zygosity = "gt_unknown";

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "gene-iobio-vue",
3-
"version": "4.11.3",
3+
"version": "4.11.4",
44
"scripts": {
55
"start": "DEBUG=http ./node_modules/nodemon/bin/nodemon.js --inspect --ignore client/ www.js",
66
"build": "./node_modules/webpack/bin/webpack.js",

0 commit comments

Comments
 (0)