Implement -filter for features(-type=>'coverage')
Created by: jmarshall
At present, using features(-type=>'coverage', -filter => sub { … })
ends up with your filter subroutine being silently ignored. This fixes that, implementing it as a filter that is called once for each read that (now optionally) goes into the pileup from which coverage is calculated.
Also some minor warning and leak fixes. This took rather longer than I anticipated as it took a long time to figure out what the bam_dup1()
in hts_fetch_fun()
was all about, so I have expanded on the comments there to hopefully clarify this.