From cbb0dd0b1523eb49bfcee104499c19f182e3f62f Mon Sep 17 00:00:00 2001
From: Fontrodona Nicolas <nicolas.fontrodona@ens-lyon.fr>
Date: Thu, 7 Jan 2021 10:08:37 +0100
Subject: [PATCH] src/find_interaction_cluster/community_figures/__main__.py:
 lazyparser contrain for output parameter removed + add a parameter
 sd_community

---
 .../community_figures/__main__.py                    | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/src/find_interaction_cluster/community_figures/__main__.py b/src/find_interaction_cluster/community_figures/__main__.py
index 7cef8dd4..e01081b7 100644
--- a/src/find_interaction_cluster/community_figures/__main__.py
+++ b/src/find_interaction_cluster/community_figures/__main__.py
@@ -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__":
-- 
GitLab