This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to safely string split GT into it's own column in a vcf file by separating with delimiter ':'?

Hi,

I have a multi-sample vcf with the following information for a few thousand samples:

#CHROM  POS     ID      REF     ALT     QUAL    FILTER  INFO                                        FORMAT                                                  S001                                            S002
  1    808922  .        G       A     20035.8   PASS    ExcessHet=3.0103;FS=0;MQ=39.81;QD=31.14     GT:AD:DP:GQ:PL:SDP:RD:FREQ:PVAL:RBQ:ABQ:RDF:RDR:ADF:ADR 1/1:0,147:147:99:5958,454,0:.:.:.:.:.:.:.:.:.:. 1/1:0,163:163:99:7381,503,0:.:.:.:.:.:.:.:.:.:. 

I think the information that follows GT is throwing off some downstream bioinformatics analysis tools (especially AD with the comma). Is there a safe way to separate GT from other information? I could possibly figure out a way with library stringr and "strsplit" in R, but I was hoping for a faster and safer method through "bcftools view" or in command line.

Thanks!

bcftools vcf linux

1 answer

I think the information that follows GT is throwing off some downstream bioinformatics analysis tools (especially AD with the comma)

AD with comma is valid, you should have a look at those downstream bioinformatics analysis tools

Is there a safe way to separate GT from other information?

bcftools annotate -x '^FORMAT/GT' in.vcf

Log in to answer this question.