Skip to content

Commit

Permalink
Merge branch 'saved-commits'
Browse files Browse the repository at this point in the history
  • Loading branch information
emunozdc authored and emunozdc committed Jun 15, 2024
2 parents 7ee6fbd + 84d7359 commit 2d52091
Show file tree
Hide file tree
Showing 12 changed files with 335 additions and 519 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ prp.print_options()
| | | | Provided as a float correspondig to the plot fraction or |
| | | | percentage. |
+------------------------+-------+---------+--------------------------------------------------------------+
| shrink_threshold | 0.05 | | Minimum lenght of an intron in order for it to be shrinked |
| shrink_threshold | 0.05 | | Minimum lenght of an intron in order for it to be shrunk |
| | | | while using the shrink feature. When threshold is |
| | | | float, it represents the percentage of the plot space, |
| | | | while an int threshold represents number of positions or |
Expand Down Expand Up @@ -411,7 +411,7 @@ prp.print_options()
| | | | Provided as a float correspondig to the plot fraction or |
| | | | percentage. |
+------------------------+--------------------+---------+--------------------------------------------------------------+
| shrink_threshold | 0.05 | | Minimum lenght of an intron in order for it to be shrinked |
| shrink_threshold | 0.05 | | Minimum lenght of an intron in order for it to be shrunk |
| | | | while using the shrink feature. When threshold is |
| | | | float, it represents the percentage of the plot space, |
| | | | while an int threshold represents number of positions or |
Expand Down
7 changes: 3 additions & 4 deletions src/pyranges_plot/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,8 +367,8 @@ def format_row(key, value):
"title_color",
"grid_color",
"exon_border",
"shrinked_bkg",
"shrinked_alpha",
"shrunk_bkg",
"x_ticks",
]
)
].copy()
Expand All @@ -382,8 +382,7 @@ def format_row(key, value):
"arrow_line_width",
"arrow_color",
"arrow_size",
"arrow_size_min",
"arrow_intron_threshold",
"intron_color",
]
)
].copy()
Expand Down
8 changes: 4 additions & 4 deletions src/pyranges_plot/introns_off.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def introns_resize(df, ts_data, id_col):
assert to_shrink.sort_values(START_COL).equals(to_shrink), "PyRanges not sorted."
to_shrink[CUM_DELTA_COL] = to_shrink[DELTA_COL].cumsum()

# store adjusted coord to plot shrinked intron regions
# store adjusted coord to plot shrunk intron regions
to_shrink[ADJSTART_COL] = to_shrink[
START_COL
] - to_shrink.__cumdelta__.shift().fillna(0)
Expand All @@ -145,10 +145,10 @@ def introns_resize(df, ts_data, id_col):


def recalc_axis(ts_data, tick_pos_d, ori_tick_pos_d):
"""Calculate shrinked axis values according to original coordinates."""
"""Calculate shrunk axis values according to original coordinates."""

for chrom in ts_data.keys():
# add to-shrinked reagions limits to axis
# add to-shrunk reagions limits to axis
ori_tick_pos = []
tick_pos = []

Expand All @@ -163,7 +163,7 @@ def recalc_axis(ts_data, tick_pos_d, ori_tick_pos_d):
]
cdel = list(ts_data[chrom][CUM_DELTA_COL])

# update tick positions for shrinked regions and keep original values as names
# update tick positions for shrunk regions and keep original values as names
for i in range(len(pos)):
if i == 0:
tick_pos.append(pos[i][0])
Expand Down
Loading

0 comments on commit 2d52091

Please sign in to comment.