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