This is what I get when I run mpileup on individual and merged data respectively [mpileup] 1 samples in 1 input files <mpileup> Set max per-sample depth to 8000.
[mpileup] 36 samples in 1 input files
My individual data have avg coverages of roughly 10x and some bases have really high coverage(>8000 and some of them above 200).I am thinking the coverage you are talking about is the avg coverage/depth per sample but not per base position.I am still not clear about the depth constraints in samtools.
I tried samtools depth and it is giving me the expected coverage.GATK depthofcoverage and bedtools genomecoverage bed give similar results(doesn't include some of the bases though).
Just a thought but are these bams marked for duplicates?
The bams are not marked for duplicates
@Vivek, I need to ask if the bam files are marked for duplicates and then recalibrated using GATK , does not they work properly with the samtools mpileup?
That shouldn't be an issue. I use samtools mpileup all the time on GATK processed BAMs.
ok thanks probably the version of samtools am using is not updated. I will try with a newer version then. Thanks.
Can you post example command strings for each of the steps you describe? How exactly are you calculating average coverage?
Merge: samtools merge -rh rg.txt out.merged.bam *.sort.bam
mpileup on merged bam:
Average coverage calculations:
where sum/genome_length should give me the coverage
Also I am getting the following error when I run flag stat on merged bam
As far as my knowledge goes this shows up whenever I read uncompressed bam files.So,I think it is not an error and the data has been merged properly.Any ideas?
just a suggestion: I have systematically been more successful on analyzing merged bams when creating them using picard's MergeSamFiles rather than samtools' merge, although this well may be due to a wrong samtools usage on my side.