Commit 320b7f2d authored by bow's avatar bow
Browse files

Update flt3 plot script coordinate handling

parent 725746b8
......@@ -57,4 +57,4 @@ rule plot_sc_linear_flt3:
conda: srcdir("envs/plot_sc_linear_flt3.yml")
shell:
"python {input.scr} --sc-bg {input.bg} --min-scl-count 2 --min-insert-count 2"
" --fuzziness 12 --padding 50 {input.counts} 1680 2135 {output.png}"
" --fuzziness 12 --padding 0 {input.counts} 1787 2024 {output.png}"
......@@ -264,6 +264,8 @@ def plot_sample_df(countd, region, sc_fuzziness, sc_bg,
axes[0].xaxis.grid(False)
has_scs = False
else:
# Convert coordinate to 1-based, fully closed.
scd["pos"] = scd["pos"].apply(lambda p: p + 1)
ax1 = scd.plot.scatter(x="pos", y="sc_ratio",
marker="o", color="#4C72B0",
s=25,
......@@ -287,6 +289,10 @@ def plot_sample_df(countd, region, sc_fuzziness, sc_bg,
ax1.set_ylabel("% of Total Coverage")
for ((p0, p1), (v0, v1)) in scs_pairs.items():
# Convert coordinate to 1-based, fully closed.
p0 += 1
p1 += 1
codes = [pth.MOVETO, pth.CURVE4, pth.CURVE4, pth.CURVE4]
verts = [(p0, v0), (p0, v0+(yspan*0.3)),
(p1, v1+(yspan*0.3)), (p1, v1)]
......@@ -302,6 +308,8 @@ def plot_sample_df(countd, region, sc_fuzziness, sc_bg,
axes[1].set_yticklabels([])
axes[1].xaxis.grid(False)
else:
# Convert coordinate to 1-based, fully closed.
ind["pos"] = ind["pos"].apply(lambda p: p + 1)
ax2 = ind.plot.bar(x="insert_seq", y="insert_ratio",
width=0.9, color="#55A868",
edgecolor="none",
......@@ -361,7 +369,7 @@ def main(input, start, end, output, fuzziness, sc_bg, min_scl_count,
if end > countd["region"]["end"]:
raise click.BadParameter("Invalid end coordinate: {0!r}."
"".format(end))
region = range(max(0, start - padding),
region = range(max(0, start - padding - 1),
min(countd["region"]["end"], end + padding + 1))
plt.style.use("seaborn-colorblind")
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment