Skip to content
Snippets Groups Projects
Commit 2cb6249b authored by Schneider Leo's avatar Schneider Leo
Browse files

datasets

parent b98ceb47
No related branches found
No related tags found
No related merge requests found
import pandas as pd
import pyopenms as oms import pyopenms as oms
import numpy as np import numpy as np
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
...@@ -279,12 +280,23 @@ def check_energy(im): ...@@ -279,12 +280,23 @@ def check_energy(im):
l[i,f]=frag/prec l[i,f]=frag/prec
return l 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__": if __name__ == "__main__":
e = oms.MSExperiment() path = 'data/230804_strain_peptides_antibiogram_Enterobacterales.xlsx'
oms.MzMLFile().load("data/STAPH140.mzML", e) df = pd.read_excel(path, header=1)
im = build_image_frag(e, 2) # e = oms.MSExperiment()
im2 = np.maximum(0,np.log(im+1)) # oms.MzMLFile().load("data/STAPH140.mzML", e)
np.save('data/mz_image/Staph140.npy',im2) # 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) # norm = np.max(im2)
# for i in range(im.shape[0]) : # for i in range(im.shape[0]) :
...@@ -301,5 +313,4 @@ if __name__ == "__main__": ...@@ -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] # b = [np.pad(array, (0, max_len - len(array)), mode='constant', constant_values=default_value) for array in res]
s = oms.MSSpectrum
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