From 7571eacee351d3fee2dcb61ef2b8e48b6aed0f16 Mon Sep 17 00:00:00 2001
From: Fontrodona Nicolas <nicolas.fontrodona@ens-lyon.fr>
Date: Thu, 5 Mar 2020 16:36:27 +0100
Subject: [PATCH] src/db_utils/frequency_scripts/frequency_function.py:
 removing concat dic function

---
 .../frequency_scripts/frequency_function.py   | 25 +------------------
 1 file changed, 1 insertion(+), 24 deletions(-)

diff --git a/src/db_utils/frequency_scripts/frequency_function.py b/src/db_utils/frequency_scripts/frequency_function.py
index b8b6075f..4e8c0cac 100644
--- a/src/db_utils/frequency_scripts/frequency_function.py
+++ b/src/db_utils/frequency_scripts/frequency_function.py
@@ -22,7 +22,7 @@ def frequencies(sequence: str, nt_list: Iterable[str]) -> Dict[str, float]:
     :param nt_list: (a list of nt)
     :return: (dic) contains the frequence of every nucleotide
     """
-    if not full_defined(sequence):
+    if not full_defined(sequence) or len(sequence) < 3:
         return {nt: np.nan for nt in nt_list}
     dic = {nt: 0. for nt in nt_list}
     seql = len(sequence)
@@ -60,29 +60,6 @@ def compute_dic(dic_seq: Dict[str, Seq], coord: List[str],
     return frequencies(sequence, nt_list)
 
 
-def concat_dic(main_dic: Dict[str, List], sub_dic: Dict[str, float],
-               region: str, name_col: str) -> Dict[str, List]:
-    """
-    Add the data in sub_dic into main_dic.
-
-    :param main_dic: The dictionary that will contains the
-    :param sub_dic: The dictionary containing nucleotide frequency of region \
-    `region`
-    :param region: The region with the nucleotide frequencies indicated by \
-    sub_dic.
-    :param name_col: The name of the column where the name of the regions \
-    are stored in main_dic
-    :return: main_dic with the frequency data of region `region`
-    """
-    main_dic[name_col].append(region)
-    for k in sub_dic.keys():
-        if k not in main_dic.keys():
-            main_dic[k] = [sub_dic[k]]
-        else:
-            main_dic[k].append(sub_dic[k])
-    return main_dic
-
-
 def get_ft_type(ft: str) -> str:
     """
     From a feature get the feature type of interest.
-- 
GitLab