This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Samtools Library Source Question -- Bam_Lpileup.C Vs Bam_Pileup.C

I am interfacing with samtools' libbam via the Perl module Bio::DB::Sam.

bam_pileup.c sets the max depth at 8000, and allows it to be overridden with the maxcnt variable:

iter->maxcnt = 8000;
...
void bam_plp_set_maxcnt(bam_plp_t iter, int maxcnt)
{
        iter->maxcnt = maxcnt;
}

But bam_lpileup.c (which keeps track of the level of the read) doesn't seem to have an analogous max depth setting.

I am a little out of my element here, but I am hoping that someone who is intimately familiar with the samtools source code can suggest a way to un-limit the depth when using the lpileup function.

samtools

1 answer

I just realized, bam_lpileup calls bam_pileup - and because it doesn't pass along a max_depth setting, it thus uses the depth of 8000 that is hard-coded in bam_pileup.c.

For a work-around, I can just change the 8000 that is hard-coded in bam_pileup.c

(As if anyone else in the world is having this same problem :)

I wonder how people aren't bothered about this..

description from Bio::DB::Sam..

The Samtools library caps pileups at a set level, defaulting to 8000. There is currently no way to specify an unlimited cap.

This is outrageous.. by a cross check i luckily found the abnormal coverage(saturating @ 8000) ..a new user can easily be deceived by this big shortcoming of Bio::DB::Sam..

Log in to answer this question.