From d69167fd482ce6c3050b7192267e67bbb850c59e Mon Sep 17 00:00:00 2001 From: Jspaezp Date: Sun, 18 Jul 2021 01:06:26 -0400 Subject: [PATCH 1/3] fixed bug where aggregating ignored --keep_decoys flag --- mokapot/mokapot.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mokapot/mokapot.py b/mokapot/mokapot.py index 52570556..c2015f9b 100644 --- a/mokapot/mokapot.py +++ b/mokapot/mokapot.py @@ -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: From f83462b0631451889abd6a52a3d2c8ac545c5435 Mon Sep 17 00:00:00 2001 From: Jspaezp Date: Tue, 20 Jul 2021 02:31:33 -0400 Subject: [PATCH 2/3] added tests for decoy file in conjunction to --aggregate --- tests/system_tests/test_cli.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/system_tests/test_cli.py b/tests/system_tests/test_cli.py index de0b21f7..12cf41fc 100644 --- a/tests/system_tests/test_cli.py +++ b/tests/system_tests/test_cli.py @@ -114,6 +114,15 @@ 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): From 0542a5fbe589abde41a4fb70fc2d1d70037ce012 Mon Sep 17 00:00:00 2001 From: Jspaezp Date: Tue, 20 Jul 2021 02:31:33 -0400 Subject: [PATCH 3/3] added tests for decoy file in conjunction to --aggregate --- tests/system_tests/test_cli.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/system_tests/test_cli.py b/tests/system_tests/test_cli.py index de0b21f7..d33da6ed 100644 --- a/tests/system_tests/test_cli.py +++ b/tests/system_tests/test_cli.py @@ -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):