Skip to content

Commit

Permalink
Fixes #64
Browse files Browse the repository at this point in the history
  • Loading branch information
David Jones committed Nov 13, 2017
1 parent 35772ac commit 4c7dded
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/bam_access.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ int bam_access_get_avg_readlength_from_bam(htsFile *sf){
bam1_t *b = bam_init1();
int ret;
while ((ret = sam_read1(sf, head, b)) >= 0 && read_count < 100) {
if((b->core.flag & BAM_FSECONDARY)
|| (b->core.flag & BAM_FSUPPLEMENTARY)
|| (b->core.flag & BAM_FQCFAIL)){
continue;
}
read_count++;
read_length_sum += b->core.l_qseq;
}
Expand Down

0 comments on commit 4c7dded

Please sign in to comment.