Skip to content

Commit

Permalink
remove all sim, not just val ds
Browse files Browse the repository at this point in the history
  • Loading branch information
nicdemon committed Mar 16, 2023
1 parent 4418f26 commit 026ded4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/data/build_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def build_load_save_data(file, hostfile, prefix, dataset, host, kmers_list=None,
nb_features_keep = nb_features_keep)
save_Xy_data(data, data_file)

# Assign kmers_list to variable ater extracting database data
# Assign kmers_list to variable after extracting database data
if kmers_list is None:
kmers_list = data['kmers']

Expand Down
12 changes: 5 additions & 7 deletions src/models/classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,11 @@ def _train_model(self, taxa):
self._binary_training(taxa)
else:
self._multiclass_training(taxa)
if isinstance(self.models[taxa], KerasTFModel):
for file in glob(os.path.join(self._outdirs['data_dir'], '*sim*')):
if os.path.isdir(file):
rmtree(file)
else:
os.remove(file)
for file in glob(os.path.join(self._outdirs['data_dir'], '*sim*')):
if os.path.isdir(file):
rmtree(file)
else:
os.remove(file)

def _binary_training(self, taxa):
print('_binary_training')
Expand Down Expand Up @@ -516,7 +515,6 @@ def _sim_4_cv(self, df, kmers_ds, name):
cv_sim = readsSimulation(kmers_ds['fasta'], cls, sim_cls_dct['id'], 'miseq', sim_outdir, name)
sim_data = cv_sim.simulation(self._k, self._database_data['kmers'])
sim_ids = sim_data['ids']
sim_ids = sim_data['ids']
sim_cls = pd.DataFrame({'sim_id':sim_ids}, dtype = object)
sim_cls['id'] = sim_cls['sim_id'].str.replace('_[0-9]+_[0-9]+_[0-9]+', '', regex=True)
sim_cls = sim_cls.set_index('id').join(cls.set_index('id'))
Expand Down

0 comments on commit 026ded4

Please sign in to comment.