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

src/find_interaction_cluster/community_figures/__main__.py: Add a parameter alpha

parent 78072892
No related branches found
No related tags found
No related merge requests found
......@@ -55,7 +55,8 @@ def create_community_figures(table: str, feature: str, target_col: str,
output: str, outfile: str, test_type: str,
target_kind: str = "", sd_community: str = "y",
iteration: int = 10000,
display_size: bool = False) -> None:
display_size: bool = False,
alpha: float = 0.05) -> None:
"""
Create a dataframe with a control community, save it as a table and \
as a barplot figure.
......@@ -78,7 +79,11 @@ def create_community_figures(table: str, feature: str, target_col: str,
false else.
:param display_size: True to display the size of the community above \
each one of them False to display nothing. (default False)
:param alpha: Type I error threshold
"""
if alpha != 0.05 and test_type != "permutation":
raise NotImplementedError(f"You can't change the alpha if you're "
f"not using a permutation test.")
df = load_and_check_table(table, feature, target_col)
if not outfile.endswith(".pdf"):
raise FileNameError("The output figure must be in pdf format !")
......@@ -86,7 +91,8 @@ def create_community_figures(table: str, feature: str, target_col: str,
sd_community = sd_community.lower() == 'y'
create_community_fig(df, feature, target_col, moutfile, test_type,
target_kind=target_kind, iteration=iteration,
sd_community=sd_community, display_size=display_size)
sd_community=sd_community, display_size=display_size,
alpha=alpha)
if __name__ == "__main__":
......
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