vibansal / HapCUT2

software tools for haplotype assembly from sequence data
BSD 2-Clause "Simplified" License
207 stars 36 forks source link

Skip non-diploid or other invalid variants instead of raising error #128

Open pontushojer opened 1 year ago

pontushojer commented 1 year ago

I run into this error when running extractHairs

ERROR: Non-diploid VCF entry detected. Each VCF entry must have a diploid genotype (GT) field consisting of two 
alleles in the set {0,1,2} separated by either '/' or '|'. For example, "1/1", "0/1", and "0|2" are valid diploid 
genotypes for HapCUT2, but "1", "0/3", and "0/0/1" are not.
The invalid entry is: 

chr1    1396190 .       GAA     G,GA,GAAA       22.10   PASS    .       GT:GQ:DP:AD:VAF:PL      1/3:2:34:7,5,4,9:0.147059,0.117647,0.264706:16,1,37,2,34,34,2,0,2,29

Would it be possible to instead of raising an error here, just skipping these invalid variants. Maybe just output a warning instead. Since I would need to go back and filter out this variant its a bit annoying for the program to stop here.