Skip to content

Commit

Permalink
special case handling
Browse files Browse the repository at this point in the history
  • Loading branch information
maxibor committed Oct 24, 2018
1 parent 3c398e5 commit 7124bde
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
5 changes: 4 additions & 1 deletion bin/normalizedReadCount
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,10 @@ def getNumberMappedReadsMultiprocess(bam, processes, id, commonReads=[]):
resdic = {}
resdic["bpCnt"] = 0
resdic["mappedReads"] = []
bamfile = pysam.AlignmentFile(bam, "rb")
try:
bamfile = pysam.AlignmentFile(bam, "rb")
except ValueError:
return(resdic)
chrs = bamfile.references

perChromosomePartial = partial(
Expand Down
17 changes: 9 additions & 8 deletions bin/plotAndReport
Original file line number Diff line number Diff line change
Expand Up @@ -124,19 +124,20 @@ if __name__ == "__main__":
maxratio = max(y)
minratio = min(y)
if minratio == maxratio and minratio > 0:
minratio = -1
minratio = -1.2
maxratio = maxratio
elif minratio == maxratio and minratio < 0:
minratio = minratio
maxratio = 1
maxratio = 1.2
elif maxratio < 0 and minratio < 0:
maxratio = 1.2
elif minratio > 0 and maxratio > 0:
minratio = -1.2

step = round((maxratio - minratio) / 10, 1)
if minratio < 0:
ticklist = [orga2_clean] + [str(round(x, 1)) for x in list(
np.arange(minratio, maxratio + step, step))] + [orga1_clean]
else:
ticklist = [orga2_clean] + [str(round(x, 1)) for x in list(
np.arange(-step, maxratio + step, step))] + [orga1_clean]

ticklist = [orga2_clean] + [str(round(x, 1)) for x in list(
np.arange(minratio, maxratio + step, step))] + [orga1_clean]

# plt.plot(x, y, "ro")
plt.bar(x, y)
Expand Down

0 comments on commit 7124bde

Please sign in to comment.