From 2a9d2955fc5ba9df03a3c58d5ae455ee8cd0ccf8 Mon Sep 17 00:00:00 2001 From: local_comparaison <mathieu.umec@inrae.fr> Date: Fri, 28 Jul 2023 13:48:10 +0200 Subject: [PATCH] Ad the output of Uniques metabolits --- tool_of_mapping_results_treatments.py | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/tool_of_mapping_results_treatments.py b/tool_of_mapping_results_treatments.py index c1b9dd7..97bd34d 100644 --- a/tool_of_mapping_results_treatments.py +++ b/tool_of_mapping_results_treatments.py @@ -19,10 +19,10 @@ import csv Pathways_a_enlever=['Metabolic pathways','Biosynthesis of secondary metabolites','Microbial metabolism in diverse environments','Carbon metabolism','2-Oxocarboxylic acid metabolism','Fatty acid metabolism','Biosynthesis of amino acids','Biosynthesis of nucleotide sugars','Biosynthesis of cofactors','Degradation of aromatic compounds','Carbohydrate metabolism','Energy metabolism','Lipid metabolism','Nucleotide metabolism','Amino acid metabolism','Metabolism of other amino acids','Glycan biosynthesis and metabolism','Metabolism of cofactors and vitamins','Metabolism of terpenoids and polyketides','Biosynthesis of other secondary metabolites','Xenobiotics biodegradation and metabolism','Chemical structure transformation maps','Genetic Information Processing','Transcription','Translation','Folding, sorting and degradation','Replication and repair','Information processing in viruses','Environmental Information Processing','Membrane transport','Signal transduction','Signaling molecules and interaction','Cellular Processes','Transport and catabolism','Cell growth and death','Cellular community - eukaryotes','Cellular community - prokaryotes','Cell motility','Immune system','Organismal Systems','Endocrine system','Circulatory system','Digestive system','Excretory system','Nervous system','Sensory system','Development and regeneration','Aging','Environmental adaptation','Human Diseases','Cancer: overview''Cancer: specific types','Infectious disease: viral','Infectious disease: bacterial','Infectious disease: parasitic','Immune disease','Neurodegenerative disease','Substance dependence','Cardiovascular disease','Endocrine and metabolic disease','Drug resistance: antimicrobial','Drug resistance: antineoplastic','Drug Development','Chronology: Antiinfectives','Chronology: Antineoplastics','Chronology: Nervous system agents','Chronology: Other drugs','Target-based classification: G protein-coupled receptors','Target-based classification: Nuclear receptors','Target-based classification: Ion channels','Target-based classification: Transporters','Target-based classification: Enzymes','Structure-based classification','Skeleton-based classification'] -Fichier_a_traiter="C:\\Users\\mumec\\Desktop\\Dossier_gitlab_local\\L100_Ramp_Chebi_IDs_Pathways_mis_en_forme_pour_programme.csv" -Sortie_Resemblance_des_pathways="C:\\Users\\mumec\\Desktop\\Dossier_gitlab_local\\table_de_resemblance_L100_Ramp_Chebi_IDs_Pathways.xlsx" -Sortie_fréquence_des_metabolites="C:\\Users\\mumec\\Desktop\\Dossier_gitlab_local\\frequence_des_metabolites_L100_Ramp_Chebi_IDs_Pathways.xlsx" -Sortie_pathways_de_chaque_metabolites="C:\\Users\\mumec\\Desktop\\Dossier_gitlab_local\\Metabolites_et_leurs_pathways_L100_Ramp_Chebi_IDs_Pathways.xlsx" +Fichier_a_traiter="C:\\Users\\mumec\\Desktop\\Dossier_gitlab_local\\MetExplore_R22_L100_Pathways_avec_metabolites_pour_programme.csv" +Sortie_Resemblance_des_pathways="C:\\Users\\mumec\\Desktop\\Dossier_gitlab_local\\table_de_resemblance_R22_L100.xlsx" +Sortie_fréquence_des_metabolites="C:\\Users\\mumec\\Desktop\\Dossier_gitlab_local\\frequence_des_metabolites_R22_L100.xlsx" +Sortie_pathways_de_chaque_metabolites="C:\\Users\\mumec\\Desktop\\Dossier_gitlab_local\\Metabolites_et_leurs_pathways_R22_L100.xlsx" ### Function initialization @@ -116,6 +116,7 @@ def traitement_des_pathways (file,sep=";"): tableau_approximatif=np.array(tableau_approximatif, dtype=object) + premier_pathway_de_ce_metabolite=[] ensemble_des_metabolites=[] nombre_de_metabolites=[] for q in range (Nombre_de_pathways_totale): @@ -127,6 +128,7 @@ def traitement_des_pathways (file,sep=";"): else: ensemble_des_metabolites.append(Path[w]) nombre_de_metabolites.append(1) + premier_pathway_de_ce_metabolite.append(Noms_des_Pathways[q]+" ("+str(len(Path))+")") Pathways_de_chaque_metabolites=[] for met in range (len(ensemble_des_metabolites)): @@ -139,13 +141,14 @@ def traitement_des_pathways (file,sep=";"): Pathways_de_chaque_metabolites.append(Pathways_de_ce_metabolite) - metabolites_in_multi_Pathways=[] - Valeurs_metabolites_in_multi_Pathways=[] + metabolites_frequence_uniques=[] + pathway_metabolites_frequence_uniques=[] for g in range (len(nombre_de_metabolites)) : - if nombre_de_metabolites[g]>1 : - metabolites_in_multi_Pathways.append(ensemble_des_metabolites[g]) - Valeurs_metabolites_in_multi_Pathways.append(nombre_de_metabolites[g]) - Frequences_des_metabolites=np.array([ensemble_des_metabolites, nombre_de_metabolites,metabolites_in_multi_Pathways, Valeurs_metabolites_in_multi_Pathways],dtype=object) + if nombre_de_metabolites[g]==1 : + metabolites_frequence_uniques.append(ensemble_des_metabolites[g]) + pathway_metabolites_frequence_uniques.append(premier_pathway_de_ce_metabolite[g]) + + Frequences_des_metabolites=np.array([ensemble_des_metabolites, nombre_de_metabolites,metabolites_frequence_uniques, pathway_metabolites_frequence_uniques],dtype=object) return(Noms_des_Pathways,tableau_approximatif,Frequences_des_metabolites , Pathways_de_chaque_metabolites) -- GitLab