From d193ff23ec977d7a105a097469e56609a3f7fd86 Mon Sep 17 00:00:00 2001 From: Fontrodona Nicolas <nicolas.fontrodona@ens-lyon.fr> Date: Thu, 18 Jun 2020 09:58:30 +0200 Subject: [PATCH] src/nt_composition/config.py : Creation of a get_feature function to recover the feature of interest --- src/nt_composition/config.py | 42 ++++++++++++++++++++++++++++++++++-- 1 file changed, 40 insertions(+), 2 deletions(-) diff --git a/src/nt_composition/config.py b/src/nt_composition/config.py index 504ca2ab..ae790526 100644 --- a/src/nt_composition/config.py +++ b/src/nt_composition/config.py @@ -8,6 +8,7 @@ file that will be produced by this module. """ from ..db_utils.config import Config +from typing import List def get_weight_folder(weight: int, global_weight: int): @@ -68,6 +69,7 @@ def get_density_recap(weight: int, global_weight: int, seen in `global_weight` project are taken into account :param ft_type: A feature type :param ft: A feature + :param fig: Say if the result file is a figure or not :return: """ if fig: @@ -88,7 +90,42 @@ def get_interaction_file(weight: int): concider :return: The interaction filename """ - return ConfigNt.interaction / f"interaction_number_weight>={weight}_by_project.txt" + return ConfigNt.interaction / \ + f"interaction_number_weight>={weight}_by_project.txt" + + +def get_features(ft_type: str) -> List[str]: + """ + Get all the feature corresponding to `ft_type`. + + :param ft_type: The feature type of interest + :return: The list of feature type of interest + """ + nt_list = ["A", "C", "G", "T"] + if ft_type == 'nt': + return nt_list + ["S", "W"] + elif ft_type == 'dnt': + return [a + b for a in nt_list for b in nt_list] + elif ft_type == 'tnt' or ft_type == 'codon': + return [a + b + c for a in nt_list for b in nt_list for c in nt_list] + elif ft_type == 'aa': + return list("RHKDESTNQCGPAVILMFYW") + else: + return ['Hydrophobicity_Goldsack', 'Hydrophobicity_Sweet', + 'Hydrophobicity_Kyte_Doolittle', 'Hydrophobicity_Tanford', + 'accessible_resiudues_Janin', 'burried_resiudues_Rose', + 'Disorder_promoting_Campen', + 'Disorder_propensity_Russel_Linding', + 'Disorder_propensity_Deleage_Roux', + 'intrinsically_unstructured_proteins_Tompa', + 'Interface_propensity_Jones', 'Linker_propensity_Bae', + 'Flexibility_Vihinen', 'Stability_Zhou_Zhou', + 'Bulkiness_Zimmerman', 'Molecular_weight_Fasman', + 'Molecular_weight_Dawson', 'Polarity_Radzicka', + 'Isoelectric_Point_Zimmerman', 'Alpha-helix_Deleage', + 'Beta-sheet_Deleage', 'Coil_conformation_Deleage', + 'Positive_charge_Fauchere', 'Negative_charge_Fauchere', + 'Sequence_freq_Jungck'] class ConfigNt: @@ -105,4 +142,5 @@ class ConfigNt: density_folder = output_folder / 'density_fig' get_density_recap = get_density_recap selected_project = interaction / "selected_sample.txt" - get_density_file = get_density_file \ No newline at end of file + get_density_file = get_density_file + get_features = get_features -- GitLab