Skip to content

Commit

Permalink
Merge pull request #36 from jspaezp/bugfix-aggregate-keep-decoys
Browse files Browse the repository at this point in the history
fixed bug where aggregating ignored --keep_decoys flag
  • Loading branch information
wfondrie authored Jul 20, 2021
2 parents 0c09986 + 7b031da commit 2f794b4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
6 changes: 5 additions & 1 deletion mokapot/mokapot.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,11 @@ def main():
# Determine how to write the results:
logging.info("Writing results...")
if config.aggregate or len(config.psm_files) == 1:
psms.to_txt(dest_dir=config.dest_dir, file_root=config.file_root)
psms.to_txt(
dest_dir=config.dest_dir,
file_root=config.file_root,
decoys=config.keep_decoys,
)
else:
for dat, prefix in zip(psms, prefixes):
if config.file_root is not None:
Expand Down
8 changes: 8 additions & 0 deletions tests/system_tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,14 @@ def test_cli_aggregate(tmp_path, scope_files):
subprocess.run(cmd, check=True)
assert Path(tmp_path, "blah.mokapot.psms.txt").exists()
assert Path(tmp_path, "blah.mokapot.peptides.txt").exists()
assert not Path(tmp_path, "blah.mokapot.decoy.psms.txt").exists()
assert not Path(tmp_path, "blah.mokapot.decoy.peptides.txt").exists()

# Test that decoys are also in the output when --keep_decoys is used
cmd += ["--keep_decoys"]
subprocess.run(cmd, check=True)
assert Path(tmp_path, "blah.mokapot.decoy.psms.txt").exists()
assert Path(tmp_path, "blah.mokapot.decoy.peptides.txt").exists()


def test_cli_fasta(tmp_path, phospho_files):
Expand Down

0 comments on commit 2f794b4

Please sign in to comment.