diff --git a/mzml_exploration.py b/mzml_exploration.py index 15d80c214484ab83d6713490c0348b267e52894d..6257ef614581ffd3c8865868344069239a92e343 100644 --- a/mzml_exploration.py +++ b/mzml_exploration.py @@ -1,3 +1,4 @@ +import pandas as pd import pyopenms as oms import numpy as np import matplotlib.pyplot as plt @@ -279,12 +280,23 @@ def check_energy(im): l[i,f]=frag/prec return l +def create_antibio_dataset(path='data/230804_strain_peptides_antibiogram_Enterobacterales.xlsx'): + df = pd.read_excel(path, header=1) + #sample_name : lien avec le fichier brut + #species : espèce => label de prédiction "simple" + #antibiogramme : disk + grand - résistant, vitek + grand + resistant, mic + grand + resistant + #AMC, AMK, AMP, AMX, ATM, CAZ, CHL, CIP, COL, CRO, CTX, CXM, CZA, CZT, ETP, FEP, FOS, FOX, GEN, IPM, LVX, MEC, MEM, + # NAL, NET, OFX, PIP, PRL, SXT, TCC, TEM, TGC, TIC, TOB, TZP (env x3) => 35 x 3 labels + pass + if __name__ == "__main__": - e = oms.MSExperiment() - oms.MzMLFile().load("data/STAPH140.mzML", e) - im = build_image_frag(e, 2) - im2 = np.maximum(0,np.log(im+1)) - np.save('data/mz_image/Staph140.npy',im2) + path = 'data/230804_strain_peptides_antibiogram_Enterobacterales.xlsx' + df = pd.read_excel(path, header=1) + # e = oms.MSExperiment() + # oms.MzMLFile().load("data/STAPH140.mzML", e) + # im = build_image_frag(e, 2) + # im2 = np.maximum(0,np.log(im+1)) + # np.save('data/mz_image/Staph140.npy',im2) # norm = np.max(im2) # for i in range(im.shape[0]) : @@ -301,5 +313,4 @@ if __name__ == "__main__": # b = [np.pad(array, (0, max_len - len(array)), mode='constant', constant_values=default_value) for array in res] -s = oms.MSSpectrum