Question: bcftools: how to annotate a file with a larger file using bcftools annotate?
0
gravatar for Thebralyt
2.2 years ago by
Thebralyt0
Thebralyt0 wrote:

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.

ADD COMMENTlink modified 2.2 years ago • written 2.2 years ago by Thebralyt0
1
gravatar for MMa
2.2 years ago by
MMa280
MMa280 wrote:

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 COMMENTlink written 2.2 years ago by MMa280
0
gravatar for Thebralyt
2.2 years ago by
Thebralyt0
Thebralyt0 wrote:

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 COMMENTlink written 2.2 years ago by Thebralyt0
1

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 REPLYlink written 2.2 years ago by MMa280

It was

bcftools view -H OCT1.genome_min.vcf

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

ADD REPLYlink written 2.2 years ago by Thebralyt0
1

I mean the bcftools annotate command line.

ADD REPLYlink written 2.2 years ago by MMa280

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 REPLYlink modified 2.2 years ago • written 2.2 years ago by Thebralyt0

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 REPLYlink written 2.2 years ago by Thebralyt0

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

ADD REPLYlink written 2.2 years ago by MMa280

ahh okay it's good now. thanks

ADD REPLYlink written 2.2 years ago by Thebralyt0
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1166 users visited in the last hour