diff --git a/mokapot/config.py b/mokapot/config.py index 63f729b2..5f85978e 100644 --- a/mokapot/config.py +++ b/mokapot/config.py @@ -65,6 +65,14 @@ def _parser(): ), ) + parser.add_argument( + "-w", + "--max_workers", + default=1, + type=int, + help="The number of processes to use for model training.", + ) + parser.add_argument( "-r", "--file_root", diff --git a/mokapot/model.py b/mokapot/model.py index ceea21a8..ac04c299 100644 --- a/mokapot/model.py +++ b/mokapot/model.py @@ -432,7 +432,7 @@ def __init__( """Initialize a PercolatorModel""" svm_model = LinearSVC(dual=False) estimator = GridSearchCV( - svm_model, param_grid=PERC_GRID, refit=False, cv=3 + svm_model, param_grid=PERC_GRID, refit=False, cv=3, n_jobs=-1 ) super().__init__( diff --git a/mokapot/mokapot.py b/mokapot/mokapot.py index c2015f9b..8e7cb7b3 100644 --- a/mokapot/mokapot.py +++ b/mokapot/mokapot.py @@ -92,7 +92,11 @@ def main(): # Fit the models: psms, models = brew( - datasets, model=model, test_fdr=config.test_fdr, folds=config.folds + datasets, + model=model, + test_fdr=config.test_fdr, + folds=config.folds, + max_workers=config.max_workers, ) if config.dest_dir is not None: diff --git a/setup.cfg b/setup.cfg index 7dd6f854..64ac2b1d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -25,9 +25,9 @@ install_requires = pandas>=1.0.3 scikit-learn>=0.22.1 numba>=0.48.0 - triqler>=0.3.0 matplotlib>=3.1.3 lxml>=4.6.2 + triqler>=0.6.2 [options.extras_require] docs = diff --git a/tests/system_tests/test_cli.py b/tests/system_tests/test_cli.py index 83ee743f..7ef08dcc 100644 --- a/tests/system_tests/test_cli.py +++ b/tests/system_tests/test_cli.py @@ -69,6 +69,8 @@ def test_cli_options(tmp_path, scope_files): "--keep_decoys", "--subset_max_train", "50000", + "--max_workers", + "3", ] subprocess.run(cmd, check=True)