Skip to content

Commit

Permalink
Ignore unmapped reads when reading input file - #68
Browse files Browse the repository at this point in the history
  • Loading branch information
emi80 committed Aug 2, 2021
1 parent dc1b10c commit 39c5826
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ggsashimi.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,15 @@ def read_bam(f, c, s):
if s != "NONE":
a["-"] = [0] * (end - start)
junctions["-"] = OrderedDict()

samfile = pysam.AlignmentFile(f)

for read in samfile.fetch(chr, start, end):


# Move forward if read is unmapped
if read.is_unmapped:
continue

samflag, read_start, CIGAR = read.flag, read.reference_start+1, read.cigarstring

# Ignore reads with more exotic CIGAR operators
Expand Down

0 comments on commit 39c5826

Please sign in to comment.