summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
be1abba)
This should mimic the logic in the import code. Any such reads
should also be unmapped.
return NULL;
}
if (c->tid >= 0) {
return NULL;
}
if (c->tid >= 0) {
- recalculated_bin = bam_reg2bin(c->pos, bam_calend(c, bam1_cigar(b)));
+ if (c->n_cigar) {
+ recalculated_bin = bam_reg2bin(c->pos, bam_calend(c, bam1_cigar(b)));
+ } else {
+ recalculated_bin = bam_reg2bin(c->pos, c->pos + 1);
+ }
if (c->bin != recalculated_bin) {
fprintf(stderr, "[bam_index_core] read '%s' mapped to '%s' at POS %d to %d has BIN %d but should be %d\n",
bam1_qname(b), h->target_name[c->tid], c->pos + 1, bam_calend(c, bam1_cigar(b)), c->bin, recalculated_bin);
if (c->bin != recalculated_bin) {
fprintf(stderr, "[bam_index_core] read '%s' mapped to '%s' at POS %d to %d has BIN %d but should be %d\n",
bam1_qname(b), h->target_name[c->tid], c->pos + 1, bam_calend(c, bam1_cigar(b)), c->bin, recalculated_bin);