Skip to content

Commit

Permalink
Merge pull request #64 from compomics/minor-tweaks
Browse files Browse the repository at this point in the history
Minor tweaks
  • Loading branch information
RobbinBouwmeester authored Sep 9, 2023
2 parents ca2d407 + 8f306dc commit a24206b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 7 additions & 9 deletions deeplc/deeplc.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ def do_f_extraction_psm_list_parallel(
"""
# TODO for multiproc I am still expecting a pd dataframe, this is not the case anymore, they are dicts
self.n_jobs = 1
logger.info("prepare feature extraction")
logger.debug("prepare feature extraction")
if multiprocessing.current_process().daemon:
logger.warning("DeepLC is running in a daemon process. Disabling multiprocessing as daemonic processes can't have children.")
psm_list_split = split_list(psm_list, self.n_jobs)
Expand All @@ -447,20 +447,20 @@ def do_f_extraction_psm_list_parallel(
pool = multiprocessing.Pool(self.n_jobs)

if self.n_jobs == 1:
logger.info("start feature extraction")
logger.debug("start feature extraction")
all_feats = self.do_f_extraction_psm_list(psm_list)
logger.info("got feature extraction results")
logger.debug("got feature extraction results")
else:
logger.info("start feature extraction")
logger.debug("start feature extraction")
all_feats_async = pool.map_async(
self.do_f_extraction_psm_list,
psm_list_split)

logger.info("wait for feature extraction")
logger.debug("wait for feature extraction")
all_feats_async.wait()
logger.info("get feature extraction results")
logger.debug("get feature extraction results")
all_feats = pd.concat(all_feats_async.get())
logger.info("got feature extraction results")
logger.debug("got feature extraction results")

pool.close()
pool.join()
Expand Down Expand Up @@ -552,7 +552,6 @@ def make_preds_core(self,

if len(X) == 0 and len(psm_list) > 0:
if self.verbose:

logger.debug("Extracting features for the CNN model ...")
#X = self.do_f_extraction_psm_list(psm_list)
X = self.do_f_extraction_psm_list_parallel(psm_list)
Expand All @@ -577,7 +576,6 @@ def make_preds_core(self,
ret_preds = mod.predict(
[X, X_sum, X_global, X_hc], batch_size=self.batch_num_tf).flatten()
except UnboundLocalError:

logger.debug("X is empty, skipping...")
ret_preds = []

Expand Down
2 changes: 2 additions & 0 deletions deeplc/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ def scatter(
fig.update_layout(
title="Predicted vs. observed retention times",
showlegend=False,
xaxis_title="Observed retention time",
yaxis_title="Predicted retention time",
)

return fig
Expand Down

0 comments on commit a24206b

Please sign in to comment.