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

fix : absolute path for image dataset and DLLs

parent 8ab55ea3
No related branches found
No related tags found
No related merge requests found
...@@ -101,14 +101,13 @@ antibiotic_enterrobacter_breakpoints = { ...@@ -101,14 +101,13 @@ antibiotic_enterrobacter_breakpoints = {
} }
def create_antibio_dataset(path='/data/label_raw/230804_strain_peptides_antibiogram_Enterobacterales.xlsx',suffix='-d200',base_path=None): def create_antibio_dataset(path='data/label_raw/230804_strain_peptides_antibiogram_Enterobacterales.xlsx',suffix='-d200',base_path=None):
""" """
Extract and build file name corresponding to each sample and transform antioresistance measurements to labels Extract and build file name corresponding to each sample and transform antioresistance measurements to labels
:param suffix: file suffix :param suffix: file suffix
:param path: excel path :param path: excel path
:return: dataframe :return: dataframe
""" """
print('base path ', base_path, 'path : ',os.path.join(base_path,path))
df = pd.read_excel(os.path.join(base_path,path), header=1) df = pd.read_excel(os.path.join(base_path,path), header=1)
df = df[['sample_name','species','AMC (disk)','AMK (disk)','AMK (mic)','AMK (vitek)','AMP (vitek)','AMX (disk)', df = df[['sample_name','species','AMC (disk)','AMK (disk)','AMK (mic)','AMK (vitek)','AMP (vitek)','AMX (disk)',
'AMX (vitek)','ATM (disk)','ATM (vitek)','CAZ (disk)','CAZ (mic)','CAZ (vitek)','CHL (vitek)','CIP (disk)', 'AMX (vitek)','ATM (disk)','ATM (vitek)','CAZ (disk)','CAZ (mic)','CAZ (vitek)','CHL (vitek)','CIP (disk)',
...@@ -180,8 +179,8 @@ def create_dataset(bin_mz=1,tolerance=0.005,noise=1000,apex='apex',suffix='-d200 ...@@ -180,8 +179,8 @@ def create_dataset(bin_mz=1,tolerance=0.005,noise=1000,apex='apex',suffix='-d200
name = label[label['path_aer'] == path.split("/")[-1]]['sample_name'].values[0] name = label[label['path_aer'] == path.split("/")[-1]]['sample_name'].values[0]
analyse = 'AER' analyse = 'AER'
if species is not None: #save image in species specific dir if species is not None: #save image in species specific dir
directory_path_png = os.path.join(base_path,'/data/processed_data_wiff_clean_{}_{}_{}_{}/png_image/{}'.format(tolerance_str,noise,apex,bin_mz,species)) directory_path_png = os.path.join(base_path,'data/processed_data_wiff_clean_{}_{}_{}_{}/png_image/{}'.format(tolerance_str,noise,apex,bin_mz,species))
directory_path_npy = os.path.join(base_path,'/data/processed_data_wiff_clean_{}_{}_{}_{}/npy_image/{}'.format(tolerance_str,noise,apex,bin_mz,species)) directory_path_npy = os.path.join(base_path,'data/processed_data_wiff_clean_{}_{}_{}_{}/npy_image/{}'.format(tolerance_str,noise,apex,bin_mz,species))
if not os.path.isdir(directory_path_png): if not os.path.isdir(directory_path_png):
os.makedirs(directory_path_png) os.makedirs(directory_path_png)
if not os.path.isdir(directory_path_npy): if not os.path.isdir(directory_path_npy):
......
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