mpileup format to vcf
1
0
Entering edit mode
2.6 years ago
AGE ▴ 30

I'm wondering if there's a simple way to convert directly from mpileup format to vcf without having to go through all the steps of creating a bam files to bcf to vcf etc. https://www.ebi.ac.uk/sites/ebi.ac.uk/files/content.ebi.ac.uk/materials/2014/140217_AgriOmics/dan_bolser_snp_calling.pdf

I just want the variable sites from the mpileup file in vcf format.

I tried this and didn't work (Generating Both Pileup And Vcf/Bcf Using Samtools Mpileup)

bcftools view -v -c file.mpileup > file.vcf

next-gen snp samtools • 1.9k views
ADD COMMENT
1
Entering edit mode

What's the problem ? Do you have an error ? How do you generated this vcf ? ....

ADD REPLY
0
Entering edit mode

Yes, I got an error, saying failed to open pathto/file.mpileup

ADD REPLY
0
Entering edit mode
2.6 years ago

I think that you may need bcftools call. The typical way to call variants is to run bcftools mpileup and pipe the output into bcftools call

ADD COMMENT
0
Entering edit mode

I tried this:

bcftools call -v -c file.mpileup > file.vcf

Note: none of --samples-file, --ploidy or --ploidy-file given, assuming all sites are diploid Failed to open file.mpileup: unknown file type

ADD REPLY
0
Entering edit mode

Can you pipe the pileup into bcftools call? In the description for call, it says:

About:   SNP/indel variant calling from VCF/BCF. To be used in conjunction with samtools mpileup.
         This command replaces the former "bcftools view" caller. Some of the original
         functionality has been temporarily lost in the process of transition to htslib,
         but will be added back on popular demand. The original calling model can be
         invoked with the -c option.
ADD REPLY
0
Entering edit mode

It worked with the pipe

bcftools mpileup -f genomic.fa file.bam | bcftools call -vm > file_var.vcf

ADD REPLY
0
Entering edit mode

Strange that it has to be piped, but glad that it worked.

ADD REPLY

Login before adding your answer.

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