Skip to content
Snippets Groups Projects
Commit 7f77571e authored by nfontrod's avatar nfontrod
Browse files

src/visu/__main__.py: add parameter ylim

parent 0458f11d
No related branches found
No related tags found
No related merge requests found
...@@ -10,7 +10,7 @@ gene regions from ChIP-seq experiment. ...@@ -10,7 +10,7 @@ gene regions from ChIP-seq experiment.
from .figure_maker import create_figure from .figure_maker import create_figure
import lazyparser as lp import lazyparser as lp
from pathlib import Path from pathlib import Path
from typing import List from typing import List, Optional
@lp.parse(design='file', region_beds='file', @lp.parse(design='file', region_beds='file',
...@@ -21,7 +21,7 @@ def launcher(design: str, bw_folder: str, region_beds: List[str], ...@@ -21,7 +21,7 @@ def launcher(design: str, bw_folder: str, region_beds: List[str],
figure_type: str = 'metagene', norm: str = 'None', figure_type: str = 'metagene', norm: str = 'None',
show_replicate: str = 'y', environment: List[int] = (0, 0), show_replicate: str = 'y', environment: List[int] = (0, 0),
border_names: List[str] = ('', ''), border_names: List[str] = ('', ''),
output: str = '.') -> None: output: str = '.', ylim: List[float] = (None, None)) -> None:
""" """
Create A metagene or a barplot figure from bigwig file on regions defined \ Create A metagene or a barplot figure from bigwig file on regions defined \
in the bed file provided with 'region_bed' parameter. in the bed file provided with 'region_bed' parameter.
...@@ -47,7 +47,11 @@ def launcher(design: str, bw_folder: str, region_beds: List[str], ...@@ -47,7 +47,11 @@ def launcher(design: str, bw_folder: str, region_beds: List[str],
the number of bin used to represent those surrounding regions. the number of bin used to represent those surrounding regions.
:param border_names: The name of the borders :param border_names: The name of the borders
:param output: Folder where the results will be created :param output: Folder where the results will be created
:param ylim: The y-axis range (default None)
""" """
if ylim[0] is not None and (len(ylim) != 2 or ylim[0] >= ylim[1]):
raise ValueError("The ylim must have two values and the first value "
"must be lower to the second value")
if environment[0] < 0 or environment[1] < 0 or \ if environment[0] < 0 or environment[1] < 0 or \
environment[0] < environment[1]: environment[0] < environment[1]:
raise ValueError(f"The two values given with --environment must " raise ValueError(f"The two values given with --environment must "
...@@ -62,7 +66,7 @@ def launcher(design: str, bw_folder: str, region_beds: List[str], ...@@ -62,7 +66,7 @@ def launcher(design: str, bw_folder: str, region_beds: List[str],
reg_beds = [Path(p) for p in region_beds] reg_beds = [Path(p) for p in region_beds]
create_figure(Path(design), Path(bw_folder), reg_beds, create_figure(Path(design), Path(bw_folder), reg_beds,
region_names, nb_bin, figure_type, norm, show_rep, region_names, nb_bin, figure_type, norm, show_rep,
environment, border_names, Path(output)) environment, border_names, Path(output), ylim)
launcher() launcher()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment