Skip to content
Snippets Groups Projects
Commit 624eebb0 authored by nfontrod's avatar nfontrod
Browse files

src/visu/__main__.py: add a stat parameter

parent 7abb300e
No related branches found
No related tags found
No related merge requests found
......@@ -21,7 +21,8 @@ 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 = '.', ylim: List[float] = (None, None)) -> None:
output: str = '.', ylim: List[float] = (None, None),
stat: bool = False) -> None:
"""
Create A metagene or a barplot figure from bigwig file on regions defined \
in the bed file provided with 'region_bed' parameter.
......@@ -48,6 +49,9 @@ def launcher(design: str, bw_folder: str, region_beds: List[str],
: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)
:param stat: A boolean indicating whether to perform \
statistical analysis. This parameter can only be set to True \
if figure_type is 'metagene' (default: False)
"""
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 "
......@@ -59,6 +63,9 @@ def launcher(design: str, bw_folder: str, region_beds: List[str],
f"greater than the second")
show_rep = show_replicate.lower() == 'y'
norm = int(norm) if norm.isdigit() else None if norm == 'None' else norm
if stat and figure_type != "metagene":
raise NotImplementedError(f"the stat parameter can only be used if "
f"figure type is metagene")
if isinstance(norm, str):
norm = Path(norm)
if not norm.is_file():
......@@ -66,7 +73,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), ylim)
environment, border_names, Path(output), ylim, stat)
launcher()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment