Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
rraadd88 committed Jan 19, 2024
1 parent de1fa2d commit f620fa3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
3 changes: 2 additions & 1 deletion chrov/viz/chrom.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ def plot_arm(
y: float = 0,
lw: float = 10,
ec: str='k',
color_centromer='#dbc1c1',
pi_span: float=1,
pi_start: int=0,
pi_end: int=None,
Expand Down Expand Up @@ -253,7 +254,7 @@ def plot_arm(
*_pre_xys([x[col_start],x[col_end]],[y,y],**kws_pre_xys),

lw=lw*0.75,solid_capstyle='butt',
color='lightcoral', ##F5B8B7
color=color_centromer,#'lightcoral', ##F5B8B7
zorder=2,clip_on=False,
),axis=1)
## outlines
Expand Down
10 changes: 9 additions & 1 deletion chrov/viz/ranges.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def plot_ranges(
col_sortby: str=None,
show_labels: str= True,
col_label: str=None,
col_label_right: str=None,
colors: dict=None,
palette: str= None,
hue_lim: list= [],
Expand All @@ -49,6 +50,7 @@ def plot_ranges(
col_groupby (str, optional): column to group by. Defaults to None.
col_sortby (str, optional): column to sort by. Defaults to None.
col_label (str, optional): column with labels. Defaults to None.
col_label_right (str, optional): column with labels to be shown on the right side of the ranges. Defaults to None.
colors (dict, optional): colors. Defaults to None.
lw (int, optional): line width. Defaults to 10.
zorders (dict, optional): z-orders. Defaults to None.
Expand Down Expand Up @@ -125,9 +127,15 @@ def plot_ranges(
if kind in [None,'split','separate']:
if not col_sortby is None:
df1=df1.sort_values(col_sortby,ascending=False)
_=df1.apply(lambda x: ax.text(x=x[col_start],y=x[y],s=f"{x[col_label]} ",ha='right',va='center',
_=df1.apply(lambda x: ax.text(x=x[col_start],y=x[y],s=f"{x[col_label]} ",
ha='right',va='center',
# color=x['label_color'],
),axis=1)
if not col_label_right is None:
_=df1.apply(lambda x: ax.text(x=x[col_end],y=x[y],s=f"{x[col_label_right]} ",
ha='left',va='center',
# color=x['label_color'],
),axis=1)
elif kind=='joined':
_=df1.loc[:,[col_label,y]].drop_duplicates().apply(lambda x: ax.text(x=start,y=x[y],s=f"{x[col_label]} ",ha='right',va='center',
# color=x['label_color'],
Expand Down

0 comments on commit f620fa3

Please sign in to comment.