So here is my perplexing question.
When I used to run my pipeline on the same input files but using BWA for the mapping, the pileup step took less than 1 hour.
I switched to stampy for the mapping and now the pileup step takes 23 hours. Nothing else has changed.
I'm using an old version of samtools (Version: 0.1.7 (r510)) that we need for compatibility with other downstream programs, but if you guys think it would help, I'd consider upgrading samtools.
Other info: sim_w501.fastq is about a 6GB file. The paerent.fa file is about 136MB.
Here are the calls I make in the pipeline:
#Quality trim the reads
python TQSfastq.py -f sim_w501.fastq -t 20 -c 30 -q -o sim_w501.fastq
#Stampy still requires a bwa index. Generate that for my reference genome
bwa index -a bwtsw parent1.fa
#Generate stampy hashes
stampy.py -G parent1.stampy.msg parent1.fa
stampy.py -g parent1.stampy.msg -H parent1.stampy.msg
#Run stampy
stampy.py --bwaoptions="-q10 parent1.fa" -g parent1.stampy.msg -h parent1.stampy.msg -M sim_w501.fastq -o update_reads-aligned-parent1.sam
#Convert the output to BAM (from SAM)
samtools view -bhS -o update_reads-aligned-parent1.bam update_reads-aligned-parent1.sam
#Convert the output from SAM to BAM
samtools view -h -o update_reads-aligned-parent1.sam update_reads-aligned-parent1.stampy.bam
#Remove any bad reads that couldn't be mapped
filter-sam.py -i update_reads-aligned-parent1.sam -o update_reads-aligned-parent1.filtered.sam -a aln -s 1
#Convert back to BAM format
samtools view -b -o update_reads-aligned-parent1.bam update_reads-aligned-parent1.filtered.sam
#Sort the BAM file as it speeds up the next calmd step significantly
samtools sort update_reads-aligned-parent1.bam update_reads-aligned-parent1.bam.sorted
#Add in MD tags, stampy leaves these out
samtools calmd -b update_reads-aligned-parent1.bam.sorted.bam parent1.fa > update_reads-aligned-parent1.sorted.calmd.bam
#I'm not sure what this step is for
samtools index update_reads-aligned-parent1.bam.sorted.calmd.bam
#Run the pileup
samtools pileup -f parent1.fa update_reads-aligned-parent1.sorted.calmd.bam -c > update_reads-aligned-parent1.pileup
you are running an old version of samtools. "pileup" has been deprecated .