From 72caf926eae531af7df09b8ed7030d353cc9ffd6 Mon Sep 17 00:00:00 2001
From: Fontrodona Nicolas <nicolas.fontrodona@ens-lyon.fr>
Date: Wed, 15 Jul 2020 15:44:44 +0200
Subject: [PATCH] src/nt_composition/__main__.py: addition of parameter
 community_size to limit nt frequency analysis to only exons located in large
 community of co-regulated exons. This parameter can be set to -1 for using
 the old behavior

---
 src/nt_composition/__main__.py | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/nt_composition/__main__.py b/src/nt_composition/__main__.py
index 3f931ee7..72e99bbc 100644
--- a/src/nt_composition/__main__.py
+++ b/src/nt_composition/__main__.py
@@ -21,6 +21,7 @@ import lazyparser as lp
 def launcher(weight: int = 1, global_weight: int = 0, ft_type: str = 'nt',
              same_gene: bool = False, compute_mean: bool = True,
              iteration: int = 10000, kind: str = 'density',
+             community_size: int = -1,
              logging_level: str = "DISABLE"):
     """
     Launch the creation of density file.
@@ -42,13 +43,18 @@ def launcher(weight: int = 1, global_weight: int = 0, ft_type: str = 'nt',
     correlation figure between the feature frequency of an exon and the \
     frequency of the same feature for other co-localized exons. 'distance' \
     to check if the frequencies of co-localized exon are closer than \
-    randomly expected. (default : 'density').
+    randomly expected. (default : 'density').*
+    :param community_size: consider only exons within communities  bigger
+    than community size. if community_size = -1. This option is deactivated.
     :param logging_level: The level of data to display (default 'DISABLE')
     """
     get_interactions_number(weight, same_gene, logging_level)
+    if community_size == -1:
+        community_size = None
     if kind == "density":
         create_all_frequency_figures(ConfigNt.cpu, weight, global_weight,
                                      ft_type, same_gene, compute_mean,
+                                     community_size,
                                      logging_level)
     else:
         create_all_distance_figures(ConfigNt.cpu, weight, global_weight,
-- 
GitLab