Skip to content

Commit

Permalink
Update manuscript figures.
Browse files Browse the repository at this point in the history
  • Loading branch information
emunozdc authored and emunozdc committed Jun 19, 2024
1 parent 3230e1f commit e19926b
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 15 deletions.
Binary file added examples/fig_2a.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/fig_2b.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/fig_3a.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/fig_3b.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/fig_3c.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions examples/pr_figs_results.py → examples/pr_fig_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@
id_col="Parent",
thick_cds=True,
text=False,
to_file="fig2_1.png",
file_size=(5, 3),
to_file=("fig_2a.png", (500, 300)),
arrow_size=0.04,
)

# show introns off and save png (Figure 2.2)
prp.plot(
gr_1,
id_col="transcript_id",
shrink=True,
to_file="fig2_2.png",
file_size=(5, 3),
to_file=("fig_2b.png", (500, 300)),
arrow_size=0.04,
)
5 changes: 3 additions & 2 deletions examples/pr_fig_a.py → examples/pr_fig_3a.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
prp.set_engine("plt")
cmap = builtin_themes["Mariotti_lab"]["colormap"]
cmap += ["lightpink", "lightyellow"]
prp.set_options("colormap", cmap)

prp.plot(
[
g,
Expand All @@ -57,8 +57,9 @@
id_col="transcript_id",
title_chr=" ",
limits=(-15, None),
to_file=("fig3_1.png", (700, 500)),
to_file=("fig_3a.png", (700, 500)),
text=True,
text_pad=0.05,
theme="Mariotti_lab",
colormap=cmap,
)
2 changes: 1 addition & 1 deletion examples/pr_fig_b.py → examples/pr_fig_3b.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
exon_border="black",
title_chr=" ",
limits=(-8, None),
to_file=("fig3_2.png", (700, 400)),
to_file=("fig_3b.png", (700, 400)),
text=True,
text_pad=0.05,
theme="Mariotti_lab",
Expand Down
8 changes: 6 additions & 2 deletions examples/pr_fig_c.py → examples/pr_fig_3c.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@

# Get plot
prp.set_engine("plt")
# customize left margin to fit titles
ori_margin = plt.rcParams["figure.subplot.left"]
plt.rcParams["figure.subplot.left"] = 0.4 # Adjust the left margin
prp.plot(
[
Expand All @@ -71,10 +73,12 @@
],
title_chr=" ",
warnings=False,
to_file=("fig3_3.png", (800, 400)),
to_file=("fig_3c.png", (800, 400)),
color_col="to_color",
arrow_color="black",
arrow_line_width=0.5,
# arrow_size=3,
theme="Mariotti_lab",
)

# reset rcparams
plt.rcParams["figure.subplot.left"] = ori_margin
6 changes: 3 additions & 3 deletions src/pyranges_plot/matplotlib_base/data2plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def plot_direction(

if strand:
# create and plot direction lines
if item_size > item_threshold:
if item_size <= item_threshold:
dir_flag = 1
##diagonal_line = OX arrow extension(item middle point +- incl), OY arrow extension (item middle point + half of exon width)
top_plus = (
Expand Down Expand Up @@ -242,7 +242,7 @@ def plot_row(
plot_direction(
ax,
strand,
incl,
incl * 2,
stop - start, # itself as threshold
start,
stop,
Expand Down Expand Up @@ -367,8 +367,8 @@ def apply_plot_intron(row):
plot_direction(
ax,
strand,
intron_size,
arrow_size,
intron_size,
start,
stop,
incl,
Expand Down
6 changes: 3 additions & 3 deletions src/pyranges_plot/plotly_base/data2plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def plot_direction(

if strand:
# create and plot direction lines
if item_size > item_threshold:
if item_size <= item_threshold:
dir_flag = 1
##diagonal_line = OX arrow extension(item middle point +- incl), OY arrow extension (item middle point + half of exon width)
top_plus = (
Expand Down Expand Up @@ -262,7 +262,7 @@ def plot_row(
fig,
strand,
genename,
incl,
incl * 2,
stop - start, # itself as threshold
start,
stop,
Expand Down Expand Up @@ -393,8 +393,8 @@ def apply_plot_intron(row):
fig,
strand,
genename,
intron_size,
arrow_size, # size of arrow as threshold
intron_size,
start,
stop,
incl,
Expand Down

0 comments on commit e19926b

Please sign in to comment.