Skip to content

Commit

Permalink
Support xy label, tick stpes, motif map size, colored motifs
Browse files Browse the repository at this point in the history
  • Loading branch information
Jong-hun-Park committed Dec 21, 2023
1 parent e9db88a commit fbfc343
Show file tree
Hide file tree
Showing 2 changed files with 173 additions and 89 deletions.
24 changes: 24 additions & 0 deletions trviz/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def generate_trplot(self,

# Figure parameters
figure_size: Tuple[int, int] = None,
motif_map_size: Tuple[int, int] = None,
output_name: str = None,
dpi: int = 300,
hide_xticks: bool = False,
Expand All @@ -56,6 +57,13 @@ def generate_trplot(self,
color_palette: str = None,
colormap: ListedColormap = None,
motif_style: str = 'box',
xtick_step: int = 1,
ytick_step: int = 1,
xtick_offset: int = 0,
ytick_offset: int = 0,
xlabel: str = None,
ylabel: str = None,
colored_motifs: List[str] = None,
verbose: bool = True,
):
"""
Expand Down Expand Up @@ -104,6 +112,14 @@ def generate_trplot(self,
:param color_palette: str = None,
:param colormap: ListedColormap = None,
:param motif_style: 'box' (default), 'arrow', or 'triangle'.
:param xtick_step: x tick step (default is 1)
:param ytick_step: y tick step (default is 1)
:param xtick_offset: x tick offset (default is 0)
:param ytick_offset: y tick offset (default is 0)
:param motif_map_size: motif map size
:param colored_motifs: only these motifs will be colored in the plot. Others will have the same color.
:param ylabel: y label in the plot
:param xlabel: x lable in the plot
:param verbose: if true, output detailed information
"""

Expand Down Expand Up @@ -202,6 +218,13 @@ def generate_trplot(self,
color_palette=color_palette,
colormap=colormap,
motif_style=motif_style,
xtick_step=xtick_step,
ytick_step=ytick_step,
xtick_offset=xtick_offset,
ytick_offset=ytick_offset,
xlabel=xlabel,
ylabel=ylabel,
colored_motifs=colored_motifs,
)

# 6. Motif map
Expand All @@ -210,4 +233,5 @@ def generate_trplot(self,
self.visualizer.symbol_to_color,
show_figure=show_figure,
file_name=f"{output_dir}/{str(tr_id)}_motif_map.png",
figure_size=motif_map_size,
)
Loading

0 comments on commit fbfc343

Please sign in to comment.