Skip to content

Commit

Permalink
added keep_args cli argument
Browse files Browse the repository at this point in the history
  • Loading branch information
jspaezp committed Jul 15, 2021
1 parent e65ac41 commit 91c8adc
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
7 changes: 7 additions & 0 deletions mokapot/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,13 @@ def _parser():
help=("Save the models learned by mokapot as pickled Python objects."),
)

parser.add_argument(
"--keep_decoys",
default=False,
action="store_true",
help=("Keep the decoys in the output .txt files"),
)

parser.add_argument(
"--folds",
type=int,
Expand Down
6 changes: 5 additions & 1 deletion mokapot/mokapot.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,11 @@ def main():
if config.file_root is not None:
prefix = ".".join([config.file_root, prefix])

dat.to_txt(dest_dir=config.dest_dir, file_root=prefix)
dat.to_txt(
dest_dir=config.dest_dir,
file_root=prefix,
decoys=config.keep_decoys,
)

total_time = round(time.time() - start)
total_time = str(datetime.timedelta(seconds=total_time))
Expand Down
1 change: 1 addition & 0 deletions tests/system_tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ def test_cli_options(tmp_path, scope_files):
"1",
"--max_iter",
"1",
"--keep_decoys",
]

subprocess.run(cmd, check=True)
Expand Down

0 comments on commit 91c8adc

Please sign in to comment.