samtools / bcftools

This is the official development repository for BCFtools. See installation instructions and other documentation here http://samtools.github.io/bcftools/howtos/install.html
http://samtools.github.io/bcftools/
Other
678 stars 240 forks source link

option to include custom lines in vcf using norm command #625

Closed ghost closed 7 years ago

ghost commented 7 years ago

In the below vcf lines that are processed using the norm command have the last 4 fields -tab-delimited- (GOOD 136 hom 23) removed from the processed vcf. These 4 fields are needed for annotation, is there a way to include them or an option to using the norm command? These fields will be different in each vcf. Thank you.

vcf before norm command: #CHROM POS ID REF ALT QUAL FILTER INFO FORMAT xxxx chr1 948846 . T TA 775.313 PASS AF=1;AO=126;DP=143;FAO=136;FDP=136;FR=.;FRO=0;FSAF=73;FSAR=63;FSRF=0;FSRR=0;FWDB=-0.00636315;FXX=0.00729874;HRUN=1;LEN=1;MLLD=23.3748;OALT=A;OID=.;OMAPALT=TA;OPOS=948847;OREF=-;PB=.;PBP=.;QD=22.8033;RBI=0.0179706;REFB=0;REVB=0.0168064;RO=9;SAF=65;SAR=61;SRF=8;SRR=1;SSEN=0;SSEP=0;SSSB=-0.0472671;STB=0.5;STBP=1;TYPE=ins;VARB=0.000608613 GT:GQ:DP:FDP:RO:FRO:AO:FAO:AF:SAR:SAF:SRF:SRR:FSAR:FSAF:FSRF:FSRR:QT 1/1:164:143:136:9:0:126:136:1:61:65:8:1:63:73:0:0:1 GOOD 136 hom 23 vcf after norn command:

bcftools_normVersion=1.3.1+htslib-1.3.1

bcftools_normCommand=norm -m-both -o split.vcf add.vcf.gz

#CHROM POS ID REF ALT QUAL FILTER INFO FORMAT xxxxx chr1 948846 . T TA 775.313 PASS AF=1;AO=126;DP=143;FAO=136;FDP=136;FR=.;FRO=0;FSAF=73;FSAR=63;FSRF=0;FSRR=0;FWDB=-0.00636315;FXX=0.00729874;HRUN=1;LEN=1;MLLD=23.3748;OALT=A;OID=.;OMAPALT=TA;OPOS=948847;OREF=-;PB=.;PBP=.;QD=22.8033;RBI=0.0179706;REFB=0;REVB=0.0168064;RO=9;SAF=65;SAR=61;SRF=8;SRR=1;SSEN=0;SSEP=0;SSSB=-0.0472671;STB=0.5;STBP=1;TYPE=ins;VARB=0.000608613 GT:GQ:DP:FDP:RO:FRO:AO:FAO:AF:SAR:SAF:SRF:SRR:FSAR:FSAF:FSRF:FSRR:QT 1/1:164:143:136:9:0:126:136:1:61:65:8:1:63:73:0:0:1

pd3 commented 7 years ago

The program requires valid VCF on input, it is not possible to add arbitrary text at the end of the lines. But you could add it as a custom INFO annotation, for example using the bcftools annotate command.

ghost commented 7 years ago

So using bcftools annotate would 4 custom headers be added that are separated by a tab?

#CHROM POS ID REF ALT QUAL FILTER INFO FORMAT xxxxx custom1 custom2 custom3 custom4

or

add 4 lines as tags (though I am not sure what to call them as they are always different): `##INFO=

INFO=

INFO=

INFO=

` Thanks.

pd3 commented 7 years ago

No, they have to be part of the INFO column, separated by semicolons. The VCF specification can be found here here http://samtools.github.io/hts-specs/VCFv4.3.pdf

ghost commented 7 years ago

Thank you very much :).