Question: Snp Calling With Bcftools Using Pileup File Format Instead Of Bcf
1
gravatar for Justin
6.3 years ago by
Justin440
United States
Justin440 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 • 4.5k views
ADD COMMENTlink modified 4.8 years ago by Biostar ♦♦ 20 • written 6.3 years ago by Justin440
4
gravatar for BruceB
6.3 years ago by
BruceB330
Cambridge, UK
BruceB330 wrote:

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

Usage: sam2vcf.pl [OPTIONS] < in.pileup > out.vcf
    Options:
       -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 6.3 years ago by BruceB330
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: 874 users visited in the last hour