Snp Calling With Bcftools Using Pileup File Format Instead Of Bcf
1
1
Entering edit mode
10.8 years ago
Justin ▴ 460

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?

bcftools snp calling • 6.4k views
ADD COMMENT
4
Entering edit mode
10.8 years ago
BruceB ▴ 340

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 COMMENT

Login before adding your answer.

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