Skip to content

Commit

Permalink
Also process comparisons where we only have 2 conditions: control vs …
Browse files Browse the repository at this point in the history
…enhanced OR control vs silenced.
  • Loading branch information
grexor committed Apr 24, 2017
1 parent 014aefe commit 9d8a474
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion bin/rnamotifs2.draw
Expand Up @@ -112,6 +112,12 @@ max_es = 0
for region, tree_list in configs.items():
for tree in tree_list:
fisher, h, motif_list, area, stats = tree

# if we only have s / e features, take care of the others so the drawing is done
for t in ["s", "e", "c"]:
if area.get(t, None)==None:
area[t] = [[0]*251, [0]*251, [0]*251, [0]*251]

logs, loge = rnamotifs2.compute.es(area["s"], area["e"], area["c"])
for a in range(0, 4):
max_es = max(max_es, max(pybio.utils.smooth(logs[a])), max(pybio.utils.smooth(loge[a])))
Expand All @@ -130,7 +136,7 @@ regions.sort()
for region in regions:
tree_list = configs[region]
for index, tree in enumerate(tree_list):
tree_file = "https://apa-db.org/rnamotifs2/%s/%s/%s" % (args.comps, region, "tree%s.tab" % index)
tree_file = "https://expressrna.org/rnamotifs2/%s/%s/%s" % (args.comps, region, "tree%s.tab" % index)
fisher, h, motif_list, area, stats = tree
logs, loge = rnamotifs2.compute.es(area["s"], area["e"], area["c"])

Expand Down
2 changes: 1 addition & 1 deletion draw/__init__.py
Expand Up @@ -188,7 +188,7 @@ def area_apa(motif, s, e, filename, area=None, region=None, limy=None, fisher=No
plt.gca().add_patch(p)

if fisher!=None:
plt.title("%s, p-value = %.5f" % (motif, fisher), y=1.06)
plt.title("%s, p-value = %.2e" % (motif, fisher), y=1.06)
else:
plt.title("%s, p-value = cluster manually added" % (motif))

Expand Down

0 comments on commit 9d8a474

Please sign in to comment.