bcftools: how to annotate a file with a larger file using bcftools annotate?
2
0
Entering edit mode
6.8 years ago
Thebralyt • 0

Hi I'm really new to bioinformatics, but I'm trying to learn how to use Docker to use linux and bcftools.

I need some help annotating a smaller .vcf file using the INFO column of a larger .vcf file. The manual for bcftools is not really clear to me on what options I need and the syntax for those options. I believe I need to create a file that just says "INFO" in it to take all the info from that file and annotate the smaller one but I don't think that's correct. I'm not sure what file type it's supposed to be, could someone help me out with this?

I think the syntax is: bcftools annotate -c largefile.vcf infofile.vcf smallfile.vcf right?

Honestly, I'm lost. I really need some help quick.

Thanks so much.

bcftools linux centos samtools htslib • 4.3k views
ADD COMMENT
1
Entering edit mode
6.8 years ago
John Ma ▴ 310

It's actually more of bcftools annotate -a largefile.vcf -c [comma separated of INFO tags you want to transfer in the form of DST_TAG:=SRC_TAG] smallfile.vcf

ADD COMMENT
0
Entering edit mode
6.8 years ago
Thebralyt • 0

Thanks so much for the clarification! I was so confused.

Another problem has appeared now, unfortunately. It seems that I now can't even view my vcf files that I previously could. It's nothing to do with the annotation. From command line, I run a new container in the image and mounted a directory to be accessed in the container, a folder DFiles on my desktop, with docker run -it -v /Users/BralK/Desktop/DFiles tools

But when I try to view a file, I can't. It gives me [E::hts_open_format] Failed to open file OCT1.genome_min.vcf Failed to open OCT1.genome_min.vcf: No such file or directory Obviously I'm not accessing this folder properly. Can you also help me figure out how to successfully view my files? I've tried it with many other files and get the same response.

Please let me know if you need any more information.

Thanks so much for your help it really means a lot.

ADD COMMENT
1
Entering edit mode

What exactly was the command line you used? bcftools output gzipped vcf by default, so try renaming OCT1.genome_min.vcf to OCT1.genome_min.vcf.gz and retry.

ADD REPLY
0
Entering edit mode

It was

bcftools view -H OCT1.genome_min.vcf

I tried renaming it and running it again but got the same error.

ADD REPLY
1
Entering edit mode

I mean the bcftools annotate command line.

ADD REPLY
0
Entering edit mode

Oh, sorry. I haven't run a complete one yet. I'm trying to figure out which INFO tags I want to carry over from one file to the other, which is why I'm trying to view it.

EDIT Never mind! All good now

ADD REPLY
0
Entering edit mode

Wait a minute, now if I try it, it gives me the error: Failed to open smallfile.vcf: unknown file type. Am I supposed to be doing something that I'm not doing?

ADD REPLY
0
Entering edit mode

If you did that successfully on a different file yesterday, then check whether the smallfile.vcf you're using today have been indexed.

ADD REPLY
0
Entering edit mode

ahh okay it's good now. thanks

ADD REPLY

Login before adding your answer.

Traffic: 1619 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