Question: Snp Calling With Bcftools Using Pileup File Format Instead Of Bcf
gravatar for Justin
7.4 years ago by
United States
Justin450 wrote:

Usually when I do SNP calling, I do this:

samtools mpileup -g -f Ref.fa File.bam | bcftools view -cv -

where samtools outputs a bcf file and bcftools does the SNP calling.


I can also get a pileup file by running (no bcf output):

samtools mpileup -f Ref.fa File.bam

which is basically a list of nucleotide positions and their bases and errors.

Now I'm playing around with SNP calling and I'd like to call bcftools on a modified pileup file.

Is it possible to call bcftools with a pileup file and not a bcf file? Or do I need to use another SNP caller?

calling bcftools snp • 5.0k views
ADD COMMENTlink modified 5.9 years ago by Biostar ♦♦ 20 • written 7.4 years ago by Justin450
gravatar for BruceB
7.4 years ago by
Cambridge, UK
BruceB330 wrote:

Convert the pileup file to VCF using, which is located in samtools bin folder:

Usage: [OPTIONS] < in.pileup > out.vcf
       -h, -?, --help                  This help message.
       -i, --indels-only               Ignore SNPs.
       -r, --refseq <file.fa>          The reference sequence, required when indels are present.
       -R, --keep-ref                  Print reference alleles as well.
       -s, --snps-only                 Ignore indels.
       -t, --column-title <string>     The column title.

You can then convert this to BCF using bcftools.

ADD COMMENTlink written 7.4 years ago by BruceB330
Please log in to add an answer.


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