Merge branch '19566-glm'
[lightning.git] / cwl / preprocess / chrmvcf / change_gt_chrM.js
1 # Copyright (C) The Lightning Authors. All rights reserved.
2 #
3 # SPDX-License-Identifier: AGPL-3.0
4
5 function record() {
6   if (CHROM == 'chrM') {
7     var inputGT = SAMPLES[0].GT;
8     if (inputGT.indexOf('/') == -1 && inputGT.indexOf('|') == -1 ) {
9       SAMPLES[0].GT = inputGT + "/" + inputGT;
10     } else if (inputGT.indexOf('/') != -1 && inputGT.split('/')[0] != inputGT.split('/')[1]) {
11       return false;
12     } else if (inputGT.indexOf('|') != -1 && inputGT.split('|')[0] != inputGT.split('|')[1]) {
13       return false;
14     }
15   }
16 }