Question: mpileup format to vcf
0
gravatar for AGE
6 months ago by
AGE20
AGE20 wrote:

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

snp samtools next-gen • 458 views
ADD COMMENTlink written 6 months ago by AGE20
1

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

ADD REPLYlink written 6 months ago by Titus900

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

ADD REPLYlink written 6 months ago by AGE20
0
gravatar for Kevin Blighe
6 months ago by
Kevin Blighe50k
Kevin Blighe50k wrote:

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 COMMENTlink written 6 months ago by Kevin Blighe50k

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 REPLYlink written 6 months ago by AGE20

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 REPLYlink written 6 months ago by Kevin Blighe50k

It worked with the pipe

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

ADD REPLYlink written 6 months ago by AGE20

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

ADD REPLYlink modified 6 months ago • written 6 months ago by Kevin Blighe50k
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: 1969 users visited in the last hour