bcftools FORMAT/FOO annotation to specific sample in multiple sample VCF
1
0
Entering edit mode
5.7 years ago
ShahiRB ▴ 30

Hi,

I wonder what do we have to modify in this command "bcftools annotate -a annots.tsv.gz -h annots.hdr -c CHROM,FROM,TO,FMT/FOO,BAR in.vcf" if we want to annotate FMT/FOO to SAMPLE2 (let's say the in.vcf has two samples) but not to SAMPLE1.

I did like this "bcftools annotate -s SAMPLE2 -a annots.tsv.gz -h annots.hdr -c CHROM,FROM,TO,FMT/FOO,BAR in.vcf" but it again annotated FMT/FOO to SAMPLE1 instead of SAMPLE2.

KR, Rajendra

next-gen • 2.3k views
ADD COMMENT
2
Entering edit mode

not clear, provide an example of input/ouput.

ADD REPLY
0
Entering edit mode

Hi @Pierre Lindenbaum,

I think these steps [A-E] will help to illustrate more. (SAMPLE2 that has to be annotated with "FooValue1" and "FooValue2", see in bold)

A].

zcat annots.tsv.gz
1   752567  752567  FooValue1   12345
1   752722  752722  FooValue2   67890

B].

zcat annots.hdr
##FORMAT=<ID=FOO,Number=1,Type=String,Description="Some description">
##INFO=<ID=BAR,Number=1,Type=Integer,Description="Some description">

C].

cat in.vcf
#fileformat=VCFv4.1
##contig=<ID=1,length=249250621,assembly=b37>
#CHROM  POS ID  REF ALT QUAL    FILTER  INFO    FORMAT  SAMPLE1 SAMPLE2
1   752567  .   A   C   .   .   BAR=12345   FOO .   .
1   752722  .   G   A   .   .   BAR=67890   FOO .   .

D]. command:

bcftools annotate -s SAMPLE2 -a annots.tsv.gz -h annots.hdr -c CHROM,FROM,TO,FMT/FOO,BAR in.vcf>in_annoted.vcf

E].

cat in_annoted.vcf
##fileformat=VCFv4.1
##contig=<ID=1,length=249250621,assembly=b37>
##FORMAT=<ID=FOO,Number=1,Type=String,Description="Some description">
##INFO=<ID=BAR,Number=1,Type=Integer,Description="Some description">
##bcftools_annotateVersion=1.8+htslib-1.8
##bcftools_annotateCommand=annotate -s SAMPLE2 -a annots.tsv.gz -h annots.hdr -c CHROM,FROM,TO,FMT/FOO,BAR in.vcf; Date=Thu Jun 14 20:17:43 2018
#CHROM  POS ID  REF ALT QUAL    FILTER  INFO    FORMAT  SAMPLE1 SAMPLE2
1   752567  .   A   C   .   .   BAR=12345   FOO .   FooValue1
1   752722  .   G   A   .   .   BAR=67890   FOO .   FooValue2

Thanx,

ADD REPLY
1
Entering edit mode

Hello ShahiRB ,

Please use the formatting bar (especially the code option) to present your post better. I've done it for you this time.
code_formatting

Thank you!

ADD REPLY
0
Entering edit mode

is "E" here (in_annoted.vcf) the expected output, or the output currently given by the program?

ADD REPLY
1
Entering edit mode

Its expected output and if you run the latest bcftools you will get the output in that format.

ADD REPLY
0
Entering edit mode
5.6 years ago
ShahiRB ▴ 30

Developer/s told me (https://github.com/samtools/bcftools/issues/998) that the bug mentioned above is fixed in the latest version.

ADD COMMENT

Login before adding your answer.

Traffic: 1666 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6