hepcat72 / vcfSampleCompare

Filter and rank variant call files (VCF) based on comparative evidence ratios between groups of samples.
GNU General Public License v3.0
2 stars 1 forks source link

Files merged via `bcftools merge` can result in errors #23

Closed hepcat72 closed 4 years ago

hepcat72 commented 4 years ago

Fatal errors occur relating to doing division with non-numeric values (e.g. '.') and warnings occur about undefined values. These are both due to the fact that bcftools merge handles records on the same coordinate from different files containing different numbers of ALT values to construct strings differently for each sample. Even though an ALT value may be for example, 'A,T', the value for AO may be '.'.

The script was not handling '.,4' to convert the dot to a 0.

The AO keys returned in the expandSampleInfo method would have missing keys because the first AO value encountered 'won'. E.g. A key of 'AO' would exist in the keys list for all samples even though the key used in recording the data for other samples may be 'AO1' and 'AO2' or vice versa and the opposing key type would not be present for that sample.

I have already fixed this.

hepcat72 commented 4 years ago

Fixed & merged