Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
rraadd88 committed Feb 8, 2024
1 parent cb03a70 commit 5d3714c
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 31 deletions.
11 changes: 9 additions & 2 deletions chrov/viz/figure.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def plot_with_chroms(
off: float=None,
offy: float=None,
chrom_y: float=0,
show_genome: bool=False,
arc: bool=True,
pi_span: float=1,
pi_start: int=0,
Expand Down Expand Up @@ -72,7 +73,9 @@ def plot_with_chroms(
ax_data_external=True
if col_start is None and xkind=='loci':
col_start=colx
cytobands=cytobands.query(expr=f"`chromosome` == {data['chromosome'].drop_duplicates().tolist()}")

if not show_genome:
cytobands=cytobands.query(expr=f"`chromosome` == {data['chromosome'].drop_duplicates().tolist()}")

# if off is None:
# if not arc:
Expand Down Expand Up @@ -170,4 +173,8 @@ def plot_with_chroms(
**kws_annot_labels,
test=test,
)
return fig
# return fig
return {"chrom":ax_chrom,'data': ax_data,}

from functools import partial
plot_with_genome=partial(plot_with_chroms, show_genome=True,)
2 changes: 2 additions & 0 deletions chrov/viz/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ def plot_seaborn(
ax.spines['right'].set_visible(False)
ax.spines['top'].set_visible(False)
else:
if pi_start==0 and pi_span==2:
ax.set_rlabel_position(0)
if pi_start==0 and pi_span>=1:
ax.set_rlabel_position(180)
else:
Expand Down
52 changes: 26 additions & 26 deletions examples/chrov_viz_figure_stem.ipynb

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions examples/chrov_viz_tests.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -764,8 +764,8 @@
}
],
"source": [
"# from chrov.viz.chrom import plot_chroms\n",
"%run ../chrov/viz/chrom.py\n",
"from chrov.viz.chrom import plot_chroms\n",
"# %run ../chrov/viz/chrom.py\n",
"ax=plot_chroms(\n",
" data=data.assign(start=1,arm='arm'),\n",
" col_end='length',\n",
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

requirements = {
'base':[
'roux @ git+https://github.com/rraadd88/roux@master#egg=roux[viz,stat]', #TODO: roux[viz,stat]
"roux @ git+https://github.com/rraadd88/roux.git@master",
## requirements from roux
'scipy',
'seaborn',
Expand Down

0 comments on commit 5d3714c

Please sign in to comment.