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

change after rebuilding

parent 1351d4c4
No related branches found
No related tags found
No related merge requests found
......@@ -8,10 +8,9 @@ import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
import pandas as pd
from Visualisation_des_donnes_de_mapping import up_down_path_plot, barplot
from visu_datas_mapping import up_down_path_plot, barplot
from utils import column_recovery, comma_cleaning, cor_index, excel_file_writer, excel_m_file_writer
sys.path.append('C:\\Users\\mumec\\Desktop\\Dossier_gitlab_local\\traitement_des_données')
LOC = "C:\\Users\\mumec\\Desktop\\fichier_mis_en_forme_programme_total\\"
......
......@@ -7,13 +7,12 @@ from math import log
from time import time
import pandas as pd
import py4cytoscape as p4c
sys.path.append('C:\\Users\\mumec\\Desktop\\Dossier_gitlab_local\\traitement_des_données')
sys.path.append('C:\\Users\\mumec\\Desktop\\Dossier_gitlab_local\\chebi-ids.git')
sys.path.append('.\chebi_id')
from pdf_generation_toolbox import out_pdf_mapping
from Recovery_of_associated_Chebi_IDs import chebi_horizontal
from recovery_of_associated_chebi_id import chebi_horizontal
from utils import excel_file_writer, pre_cut, recup_all_inf_excel
from complete_processing_of_mapping_results import c_p_o_m_r
from Mapping_using_the_API import opti_multimapping
from mapping_using_api import opti_multimapping
from network_visualization import paths_link_cpdb, network_visu
FOLDER = "C:\\Users\\mumec\\Desktop\\fichier_mis_en_forme_programme_total\\main\\patho_oeil_06-03-2024\\"
......@@ -141,7 +140,7 @@ def workflow(infile, out_folder):
for i_line in liste:
new_line.append(str(i_line[i_col]))
liste_reverse[i_liste].append(new_line)
file_path = "Modele_de_pdf_feneratio_en_anglais_rev_19-02-2024.docx"
file_path = "static\\Modele_de_pdf_feneratio_en_anglais_rev_19-02-2024.docx"
out_pdf_mapping(file_path, data_input, chebi_hori, recap_pdf,
result_ramp_pdf[:8], result_cpdb_pdf[:4],
out_folder, l_visu)
......
......@@ -5,7 +5,7 @@ import sys
import pandas as pd
import py4cytoscape as p4c
from utils import excel_file_writer, column_recovery, cor_index
sys.path.append('C:\\Users\\mumec\\Desktop\\Dossier_gitlab_local\\traitement_des_données')
LOCAL = "C:\\Users\\mumec\\Desktop\\Mini_codes\\network_visualization\\"
......
......@@ -3,6 +3,7 @@ this module is design to create pdf of results mapping
"""
from fpdf import FPDF
from docx import Document
import sys
class PDF(FPDF):
......@@ -148,8 +149,8 @@ class PDF(FPDF):
displays a page with the correct format.
"""
self.add_page()
self.image("logo_metabohub_metex.png", 175, 4, 33) # X, Y, taille
self.image("Ensemble_des_logos_pdp.png", 20, 275, 170)
self.image("static\\logo_metabohub_metex.png", 175, 4, 33) # X, Y, taille
self.image("static\\Ensemble_des_logos_pdp.png", 20, 275, 170)
self.ln(15)
def guard_page(self, str_tw):
......@@ -192,9 +193,8 @@ class PDF(FPDF):
self.ln(4)
for str_end1 in cont_end[begin_2pages+1:]:
self.chapter_body(str_end1)
pypdf_f = "C:\\Users\\mumec\\Desktop\\Mini_codes\\pdf_PyPDF2\\"
self.image(pypdf_f + "carte_france_fin_doc.png", 90, 100, 100)
self.image(pypdf_f + "bandeau_fin_doc.png", 15, 100, 60)
self.image("static\\carte_france_fin_doc.png", 90, 100, 100)
self.image("static\\bandeau_fin_doc.png", 15, 100, 60)
def read_docx(file_path):
......@@ -229,9 +229,9 @@ def out_pdf_mapping(file_path, data_input, chebi_hori, recap, results_map_ramp,
one PDF of global mapping results.
"""
result_pdf = PDF()
result_pdf.add_font('DejaVu', 'I', 'DejaVuSansCondensed.ttf')
result_pdf.add_font('DejaVu', 'B', 'DejaVuSansCondensed.ttf')
result_pdf.add_font('DejaVu', '', 'DejaVuSansCondensed.ttf')
result_pdf.add_font('DejaVu', 'I', 'static\\DejaVuSansCondensed.ttf')
result_pdf.add_font('DejaVu', 'B', 'static\\DejaVuSansCondensed.ttf')
result_pdf.add_font('DejaVu', '', 'static\\DejaVuSansCondensed.ttf')
result_pdf.set_font('DejaVu', '', 14)
content = read_docx(file_path)
index_toc = content.index('Table of contents')
......@@ -313,7 +313,7 @@ if __name__ == "__main__":
FOLD_V+"CPDBbar_plot_of_metabolites.png",
FOLD_V+"CPDBmetabolites_bo_of_frequency.png",
FOLD_V+"CPDBup_down_path_plot.png"]
FP = "Modele_de_pdf_feneratio_en_anglais_rev_19-02-2024.docx"
FP = "static\\Modele_de_pdf_feneratio_en_anglais_rev_19-02-2024.docx"
out_pdf_mapping(FP, dinput, Chebi_optimal, reca,
r_m_r, r_m_c, FOLD_V, list_visu)
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