diff --git a/src/visu/__main__.py b/src/visu/__main__.py index bc53640546831b2ae1f49bbcb63b7eacf9b6a578..a72845dc61fb39baf66514f08d8957d019f0a07a 100644 --- a/src/visu/__main__.py +++ b/src/visu/__main__.py @@ -10,7 +10,7 @@ gene regions from ChIP-seq experiment. from .figure_maker import create_figure import lazyparser as lp from pathlib import Path -from typing import List +from typing import List, Optional @lp.parse(design='file', region_beds='file', @@ -21,7 +21,7 @@ def launcher(design: str, bw_folder: str, region_beds: List[str], figure_type: str = 'metagene', norm: str = 'None', show_replicate: str = 'y', environment: List[int] = (0, 0), 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 \ in the bed file provided with 'region_bed' parameter. @@ -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. :param border_names: The name of the borders :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 \ environment[0] < environment[1]: 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], reg_beds = [Path(p) for p in region_beds] create_figure(Path(design), Path(bw_folder), reg_beds, region_names, nb_bin, figure_type, norm, show_rep, - environment, border_names, Path(output)) + environment, border_names, Path(output), ylim) launcher()