Skip to content
Snippets Groups Projects
Commit 4a13fabf authored by UMEC Mathieu's avatar UMEC Mathieu
Browse files

fix a bug of reading row

parent d875246f
No related branches found
No related tags found
No related merge requests found
......@@ -50,11 +50,11 @@ def recup_1_Pathways (input_fill, Dossier_sortie) :
excel_file1.close()
def recup_tout_les_pathways (Dossier, input_fill_name_without_num, output_fill, nombre_de_fichier):
def recup_tout_les_pathways (Dossier, input_fill_name_without_num, output_fill, nombre_de_fichier,num_colonne_t_or_f=5):
tout_les_pathways=[]
for indice_fichier in range (1,nombre_de_fichier+1):
nom_fichier=Dossier+input_fill_name_without_num+str(indice_fichier)+".xlsx"
nom_fichier=Dossier+input_fill_name_without_num+str(indice_fichier)+").xlsx"
fichier_en_cour_de_traitement= Workbook(nom_fichier) # chargement du fichier excel
collection_entree = fichier_en_cour_de_traitement.getWorksheets()
......@@ -64,10 +64,10 @@ def recup_tout_les_pathways (Dossier, input_fill_name_without_num, output_fill,
Pathways_et_ces_metabolites.append(Nom_Pathway)
feuille_Metabolites=collection_entree.get(3)
lignes = feuille_Metabolites.getCells().getMaxDataRow()
lignes = feuille_Metabolites.getCells().getMaxDataRow()+1 # la valeur s'arrete à l'avant derniére lignes si on ne met pas le +1
for indice in range(lignes):
valeur = feuille_Metabolites.getCells().get(indice, 5).getValue()
valeur = feuille_Metabolites.getCells().get(indice, num_colonne_t_or_f).getValue() # mettre a jour le numéro de la colonne de présence dans le mapping (-1 car commence a 0)
if (valeur=="true" and feuille_Metabolites.getCells().get(indice, 0).getValue() not in Pathways_et_ces_metabolites ):
Pathways_et_ces_metabolites.append(feuille_Metabolites.getCells().get(indice, 0).getValue())
......@@ -80,7 +80,7 @@ def recup_tout_les_pathways (Dossier, input_fill_name_without_num, output_fill,
tout_les_pathways.to_excel(excel_sortie)
excel_sortie.close()
#recup_tout_les_pathways ("C:\\Users\\mumec\\Desktop\\fichier_en_cours_dutilisation\\", "ExportExcel_4311-", "C:\\Users\\mumec\\Desktop\\fichier_en_cours_dutilisation\\MetExplore_R22_L100_Pathways_avec_metabolites.xlsx", 59)
#recup_tout_les_pathways ("C:\\Users\\mumec\\Desktop\\fichier_en_cours_dutilisation\\", "ExportExcel_4311-", "C:\\Users\\mumec\\Desktop\\fichier_en_cours_dutilisation\\MetExplore_R22_L100_Pathways_avec_metabolites.xlsx", 59,nombre_de_fichier,num_colonne_t_or_f=5)
......@@ -188,4 +188,5 @@ def pretraitement_resultats_Ramp (Resultas_Ramp, output_file, pathways_IDs='oui'
excel_file.close()
pretraitement_resultats_Ramp ("C:\\Users\\mumec\\Desktop\\Mini_codes\\results_LTest_V0_ramp_pathways.csv", "C:\\Users\\mumec\\Desktop\\Mini_codes\\results_LTest_V0_ramp_pathways_listes.xlsx", pathways_IDs='oui')
\ No newline at end of file
#pretraitement_resultats_Ramp ("C:\\Users\\mumec\\Desktop\\Mini_codes\\results_LTest_V0_ramp_pathways.csv", "C:\\Users\\mumec\\Desktop\\Mini_codes\\results_LTest_V0_ramp_pathways_listes.xlsx", pathways_IDs='oui')
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment