What Better Way To Get Consensus Sequence Of Mapping Against Reference Genome Using Samtools Mpileup?
2
2
Entering edit mode
11.0 years ago
thiagomafra ▴ 70

Hi people,

I have a set of reads mapped against a reference genome and need take consensus sequence using samtools mpileup. I used the command:

samtools mpileup -AuDS -Q 10 -q 10 -d 10000 -f <reference.fasta> <file.sorted.bam> | bcftools view -gc - | vcfutils.pl vcf2fq | perl fastq2fasta.pl cns.fasta &

Someone uses other parameters in samtools mpileup?

consensus mpileup reference • 13k views
ADD COMMENT
1
Entering edit mode
ADD REPLY
2
Entering edit mode
10.9 years ago

you could also try not using samtools but GATK instead, which allows selecting better calling algorithms than samtools (UnifiedGenotyper and HaplotypeCaller). the underlying idea would be first to perform the variant calling, and then to generate the fasta file:

java -jar GenomeAnalysisTK.jar -R hg19.fa -T HaplotypeCaller -I sample.bam -o sample.vcf
java -jar GenomeAnalysisTK.jar -R hg19.fa -T FastaAlternateReferenceMaker -o sample.fa --variant sample.vcf
ADD COMMENT
1
Entering edit mode
10.9 years ago
Joseph Hughes ★ 3.0k

I use the following command in samtools Version: 0.1.18:

samtools mpileup -E -uf <reference.fasta> <file.sorted.bam> | bcftools view -cg - | vcfutils.pl vcf2fq > cns.fastq

The -E option helps with sensitivity especially if you have sites with multiple nucleotide polymorphisms.

ADD COMMENT

Login before adding your answer.

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