1 # If you are trying to view VCF 4.2 files in IGV - you may run into issues. This function might help you.
3 # 1. Rename the file as version 4.1
4 # 2. Replace parentheses in the INFO lines (IGV doesn't like these!)
6 function vcf_downgrade
() {
8 outfile
=${outfile/.gz/}
9 outfile
=${outfile/.vcf/}
10 bcftools view
--max-alleles 2 -O v
$1 | \
11 sed "s/##fileformat=VCFv4.2/##fileformat=VCFv4.1/" | \
14 sed "s/,Version=\"3\">/>/" | \
15 bcftools view
-O z
> ${outfile}.dg.vcf.gz
16 tabix
${outfile}.dg.vcf.gz