tgen / vcfMerger2

Dynamic vcfMerger for 2 to N somatic variants vcf files
Other
5 stars 1 forks source link

TYPE is a key word for bcftools variant type and should be renamed VTYPE #18

Closed ChristopheLegendre closed 4 years ago

ChristopheLegendre commented 4 years ago

It has been found that TYPE flag found in INFO field is a reserved word for bcftools which does not recognize the value "ins" as a valid value;

Should we rename the TYPE flag to VTYPE?

Note: renaming the header and the records with VTYPE works; It has been tested on UTJMM merged vcf file.

ChristopheLegendre commented 4 years ago

@PedalheadPHX. bcftools has a specific way of dealing with the keyword "TYPE".

TYPE for variant type in REF,ALT columns (indel,snp,mnp,ref,bnd,other,overlap). Use the regex operator "\~" to require at least one allele of the given type or the equal sign "=" to require that all alleles are of the given type. Compare
TYPE="snp"
TYPE~"snp"
TYPE!="snp"
TYPE!~"snp"

Here are the values for the current TYPE keyword we have in our merged VCFs: bcftools query -f '%INFO/TYPE\n' ${VCF} | sortu outputs is:

I tried to use it with one of our UTJMM merged vcf and here the errors I got: bcftools filter -i 'TYPE="ins"' ${VCF} The type "ins" not recognised: TYPE="ins" bcftools filter -i 'TYPE="snv"' ${VCF} The type "snv" not recognised: TYPE="snv"

But if we use the expected bcftools' keyword for yhe type of variant, it works: bcftools filter -i 'TYPE="indel"' ${VCF} or bcftools filter -i 'TYPE="snp"' ${VCF}

In order to avoid keyword overlapping and confusion, I would, therefore, suggest we modify the current keyword TYPEwe have in vcfMerger2 with the keyword VTYPE.

Do you agree?

PedalheadPHX commented 4 years ago

Yes please fix

ChristopheLegendre commented 4 years ago
bcftools filter -i 'TYPE=="snp"' VTYPE_TEST/OutputUniTest_vcfMerger2.vcf | grepvp | wl
875
$ bcftools filter -i 'TYPE=="indel"' VTYPE_TEST/OutputUniTest_vcfMerger2.vcf | grepvp | wl
62
bcftools filter -i 'TYPE=="mnp"' VTYPE_TEST/OutputUniTest_vcfMerger2.vcf | grepvp | wl
49
bcftools filter -i 'TYPE=="snv"' VTYPE_TEST/OutputUniTest_vcfMerger2.vcf | grepvp | wl
The type "snv" not recognised: TYPE=="snv"
0

bcftools filter -i 'VTYPE=="snv"' VTYPE_TEST/OutputUniTest_vcfMerger2.vcf | grepvp | wl
875
bcftools filter -i 'VTYPE=="ins"' VTYPE_TEST/OutputUniTest_vcfMerger2.vcf | grepvp | wl
44
bcftools filter -i 'VTYPE=="del"' VTYPE_TEST/OutputUniTest_vcfMerger2.vcf | grepvp | wl
48
ChristopheLegendre commented 4 years ago

Fix added to v0.8.5