Closed ChristopheLegendre closed 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 TYPE
we have in vcfMerger2 with the keyword VTYPE
.
Do you agree?
Yes please fix
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
Fix added to v0.8.5
It has been found that
TYPE
flag found inINFO
field is a reserved word forbcftools
which does not recognize the value "ins" as a valid value;Should we rename the
TYPE
flag toVTYPE
?Note: renaming the header and the records with VTYPE works; It has been tested on UTJMM merged vcf file.