Skip to content

Commit

Permalink
2.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
telatin committed Dec 23, 2021
1 parent 7ec0332 commit 51f1cdf
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions src/bamtocounts.nim
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,6 @@ proc alignments_count(table: var OrderedTable[string, stranded_counts], bam:Bam,
if debug:
stderr.writeLine("[alignments_count] Got chrom: ", chrom, " tot=", len(regions))
for aln in bam.query(chrom):
if debug:
stderr.writeLine("[alignments_count] Got aln ", aln.start)
if not regions.contains(chrom) or regions[chrom].len == 0:
continue

Expand All @@ -120,15 +118,14 @@ proc alignments_count(table: var OrderedTable[string, stranded_counts], bam:Bam,
# stderr.writeLine("[alignments_count] Warning: unknown feature: ", interval.label.l2)
# table[interval.label.l2] = (fwd: 0, rev: 0)

try:
table[interval.label.l2].inc(aln.flag.reverse)
except Exception as e:
stderr.writeLine("[alignments_count] Error key table: ", e.msg)
#try:
table[interval.label.l2].inc(aln.flag.reverse)
#except Exception as e:
# stderr.writeLine("[alignments_count] Error key table: ", e.msg)

if debug:
stderr.writeLine("[alignments_count]\t\tdone ", interval.label.l2)

except Exception:
# ⛔️ ERROR TODO FIXME ALOHA [index not in ...]
# ⛔️ [index not in ...]
if debug:
stderr.writeLine("[alignments_count] intersections loop broken at chr=", chrom, " aln=", aln.qname, " last=", s, " c=", c)

Expand Down

0 comments on commit 51f1cdf

Please sign in to comment.