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

src/find_interaction_cluster/community_figures/__main__.py: lazyparser...

src/find_interaction_cluster/community_figures/__main__.py: lazyparser contrain for output parameter removed + add a parameter sd_community
parent c85e0796
No related branches found
No related tags found
No related merge requests found
......@@ -49,11 +49,11 @@ def load_and_check_table(table: str, feature: str, target_col: str):
return df
@lp.parse(table="file", output="folder", test_type=["lm", "permutation"],
iteration="20 < iteration")
@lp.parse(table="file", test_type=["lm", "permutation"],
iteration="20 < iteration", sd_community = ["y", "n", "Y", "N"])
def create_community_figures(table: str, feature: str, target_col: str,
output: str, outfile: str, test_type: str,
target_kind: str = "",
target_kind: str = "", sd_community: str = "y",
iteration: int = 10000) -> None:
"""
Create a dataframe with a control community, save it as a table and \
......@@ -73,13 +73,17 @@ def create_community_figures(table: str, feature: str, target_col: str,
target_col.
:param iteration: The number of sub samples to create. This parameter \
is only used if test_type = 'permutation' (default 10000).
:param sd_community: y to display the standard deviation for communities \
false else.
"""
df = load_and_check_table(table, feature, target_col)
if not outfile.endswith(".pdf"):
raise FileNameError("The output figure must be in pdf format !")
moutfile = Path(output) / outfile
sd_community = sd_community.lower() == 'y'
create_community_fig(df, feature, target_col, moutfile, test_type,
target_kind=target_kind, iteration=iteration)
target_kind=target_kind, iteration=iteration,
sd_community=sd_community)
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