Skip to content

Commit

Permalink
Updated paths and implemented preps for glia support
Browse files Browse the repository at this point in the history
  • Loading branch information
NilsFo committed Apr 12, 2021
1 parent 70c1395 commit a005619
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 19 deletions.
36 changes: 26 additions & 10 deletions predict_batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,12 +276,13 @@ def custom_paths_predict():

def prodi_gpu_predict():
print('Running Predictions.')
use_oligo = False
use_neuron = False
use_glia = True
use_oligo = True
use_neuron = True
use_glia = False
use_old = False

use_debug = False
use_paper = False
use_paper = True
skip_predicted = True
n_jobs: int = 20

Expand All @@ -295,8 +296,12 @@ def prodi_gpu_predict():
# source_dir_redo_paper_neuron = '/prodi/bioinf/bioinfdata/work/omnisphero/CNN/final/neuron_paper/rosi/'

# .h5 dirs to be predicted for efsa or endpoints
source_dir_redo_paper_oligo = '/home/nilfoe/prodi/bioinfdata/work/Omnisphero/CNN/final/oligo_18/'
source_dir_redo_paper_neuron = '/home/nilfoe/prodi/bioinfdata/work/Omnisphero/CNN/final/neuron_18/'
source_dir_paper_oligo = '/home/nilfoe/prodi/bioinfdata/work/Omnisphero/CNN/final/oligo_endpoints5/'
source_dir_paper_neuron = '/home/nilfoe/prodi/bioinfdata/work/Omnisphero/CNN/final/neuron_endpoints5/'

source_dir_paper_oligo2 = '/home/nilfoe/prodi/bioinfdata/work/Omnisphero/CNN/final/oligo_endpoints6/'
source_dir_paper_neuron2 = '/home/nilfoe/prodi/bioinfdata/work/Omnisphero/CNN/final/neuron_endpoints6/'

source_dir_glia = '/home/nilfoe/prodi/bioinfdata/work/Omnisphero/CNN/final/glia_01/'


Expand All @@ -310,18 +315,29 @@ def prodi_gpu_predict():

if use_paper:
if use_neuron:
predict_batch(model_source_path=model_source_path_neuron_paper, source_dir=source_dir_redo_paper_neuron,
predict_batch(model_source_path=model_source_path_neuron_paper, source_dir=source_dir_paper_neuron,
normalize_enum=4,
n_jobs=n_jobs,
skip_predicted=skip_predicted,
gpu_index_string="0")

predict_batch(model_source_path=model_source_path_neuron_paper, source_dir=source_dir_paper_neuron2,
normalize_enum=4,
n_jobs=n_jobs,
skip_predicted=skip_predicted,
gpu_index_string="0")
if use_oligo:
predict_batch(model_source_path=model_source_path_oligo_paper, source_dir=source_dir_redo_paper_oligo,
predict_batch(model_source_path=model_source_path_oligo_paper, source_dir=source_dir_paper_oligo,
normalize_enum=4,
n_jobs=n_jobs,
skip_predicted=skip_predicted,
gpu_index_string="1")
else:
gpu_index_string="0")
predict_batch(model_source_path=model_source_path_oligo_paper, source_dir=source_dir_paper_oligo2,
normalize_enum=4,
n_jobs=n_jobs,
skip_predicted=skip_predicted,
gpu_index_string="0")
if use_old:
if use_neuron:
predict_batch(model_source_path=model_source_path_neuron, source_dir=source_dir_neuron,
normalize_enum=1,
Expand Down
21 changes: 12 additions & 9 deletions train_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -1146,22 +1146,25 @@ def decode_history_key(key: str) -> str:


glia_path_train = [
'/home/nilfoe/prodi/bioinfdata/work/Omnisphero/CNN-glia-raw/training/glia/VJK135_trainingData_glia-raw',
'/home/nilfoe/prodi/bioinfdata/work/Omnisphero/CNN-glia-raw/training/glia/VJK136_trainingData_glia-raw'
'/home/nilfoe/bioinf/Omnisphero/CNN-glia/training/glia/JK247_ECM pretreated_trainingData_glia',
'/home/nilfoe/bioinf/Omnisphero/CNN-glia/training/glia/JK247_spheres pretreated_trainingData_glia',
'/home/nilfoe/bioinf/Omnisphero/CNN-glia/training/glia/JK274_normal_trainingData_glia',
'/home/nilfoe/bioinf/Omnisphero/CNN-glia/training/glia/VJK135_trainingData_glia',
'/home/nilfoe/bioinf/Omnisphero/CNN-glia/training/glia/VJK136_trainingData_glia'
]

glia_path_test='/home/nilfoe/prodi/bioinfdata/work/Omnisphero/CNN-glia-raw/test/glia/'
glia_path_test='/home/nilfoe/bioinf/Omnisphero/CNN-glia/test/glia/'

glia_path_val = [
'/home/nilfoe/prodi/bioinfdata/work/Omnisphero/CNN-glia-raw/validation/glia/'
'/home/nilfoe/bioinf/Omnisphero/CNN-glia/validation/glia/'
]

def main():
# AUGMENTATION
data_gen = get_default_augmenter()
n_jobs = 20

out_path = '/home/nilfoe/prodi/bioinfdata/work/Omnisphero/CNN-glia-raw/models/glia/'
out_path = '/home/nilfoe/prodi/bioinfdata/work/Omnisphero/CNN-glia/models/glia-extendedData/'

print('Sleeping....')
# time.sleep(18000)
Expand All @@ -1172,7 +1175,7 @@ def main():
test_data_path=glia_path_test,
use_SMOTE=False,
out_path=out_path + 'base' + os.sep,
gpu_index_string="1",
gpu_index_string="0",
optimizer='SGD',
n_jobs=n_jobs,
epochs=5000
Expand All @@ -1184,7 +1187,7 @@ def main():
test_data_path=glia_path_test,
use_SMOTE=False,
out_path=out_path + 'datagen' + os.sep,
gpu_index_string="1",
gpu_index_string="0",
optimizer='SGD',
n_jobs=n_jobs,
data_gen=data_gen,
Expand All @@ -1197,7 +1200,7 @@ def main():
test_data_path=glia_path_test,
use_SMOTE=True,
out_path=out_path + 'smote' + os.sep,
gpu_index_string="1",
gpu_index_string="0",
optimizer='SGD',
n_jobs=n_jobs,
epochs=5000
Expand All @@ -1209,7 +1212,7 @@ def main():
test_data_path=glia_path_test,
use_SMOTE=True,
out_path=out_path + 'datagen_and_smote' + os.sep,
gpu_index_string="1",
gpu_index_string="0",
optimizer='SGD',
n_jobs=n_jobs,
data_gen=data_gen,
Expand Down

0 comments on commit a005619

Please sign in to comment.