From c3c1d898ca9f2434307ad4350c471f0bc88ac2ea Mon Sep 17 00:00:00 2001 From: Susanna Kiwala Date: Wed, 15 May 2024 13:01:48 -0500 Subject: [PATCH 01/10] Add new R dependencies for pVACview --- pvactools/tools/pvacview/Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pvactools/tools/pvacview/Dockerfile b/pvactools/tools/pvacview/Dockerfile index bb05b8fc..7ec96c13 100644 --- a/pvactools/tools/pvacview/Dockerfile +++ b/pvactools/tools/pvacview/Dockerfile @@ -18,7 +18,9 @@ RUN R -e "install.packages(c('shiny',\ 'shinydashboardPlus', \ 'shinycssloaders', \ 'fresh', \ - 'RCurl' ), repos='https://cran.rstudio.com/')" + 'RCurl', \ + 'shinyWidgets', \ + 'colourpicker'), repos='https://cran.rstudio.com/')" RUN R -e "devtools::install_github('eclarke/ggbeeswarm', ref='v0.6.1')" From 6cbb2ac4ced341b7321a944a258193d3ac32fc1c Mon Sep 17 00:00:00 2001 From: Susanna Kiwala Date: Wed, 15 May 2024 13:02:14 -0500 Subject: [PATCH 02/10] Add 4.2 releases page --- docs/releases.rst | 1 + docs/releases/4_2.rst | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 docs/releases/4_2.rst diff --git a/docs/releases.rst b/docs/releases.rst index bb443c13..fb33f8e4 100644 --- a/docs/releases.rst +++ b/docs/releases.rst @@ -17,3 +17,4 @@ Release Notes releases/3_1 releases/4_0 releases/4_1 + releases/4_2 diff --git a/docs/releases/4_2.rst b/docs/releases/4_2.rst new file mode 100644 index 00000000..de193ebd --- /dev/null +++ b/docs/releases/4_2.rst @@ -0,0 +1,19 @@ +Version 4.2 +=========== + +Version 4.2.0 +------------- + +This is a minor feature release. It adds the following features: + +- We added two new modules to pVACview: a :ref:`neofox_module` to visualize + NeoFox neoantigen annotations and a :ref:`custom_module` to visualize + neoantigen data in a TSV file, for example output files from VaxRank, + NeoPredPipe, or antigen.garnish.2. +- We added a :ref:`vignette ` to our documentation to provide + an extended tutorial on how evaluate neoantigen candidates using pVACview. + +This release also fixes the following bug(s): + +- When running pVACfuse with Arriba input data, the 3' transcript was not + being parsed correctly. This release fixes this issue. From a34c86393e9b895602dbda8e0a433340cf26473c Mon Sep 17 00:00:00 2001 From: ldhtnp Date: Tue, 4 Jun 2024 14:07:54 -0500 Subject: [PATCH 03/10] added valid_algorithms.py to each tool and lib --- pvactools/lib/valid_algorithms.py | 55 +++++++++++++++++++ pvactools/tools/pvacbind/valid_algorithms.py | 15 +++++ pvactools/tools/pvacfuse/valid_algorithms.py | 15 +++++ pvactools/tools/pvacseq/valid_algorithms.py | 15 +++++ .../tools/pvacvector/valid_algorithms.py | 15 +++++ 5 files changed, 115 insertions(+) create mode 100644 pvactools/lib/valid_algorithms.py create mode 100644 pvactools/tools/pvacbind/valid_algorithms.py create mode 100644 pvactools/tools/pvacfuse/valid_algorithms.py create mode 100644 pvactools/tools/pvacseq/valid_algorithms.py create mode 100644 pvactools/tools/pvacvector/valid_algorithms.py diff --git a/pvactools/lib/valid_algorithms.py b/pvactools/lib/valid_algorithms.py new file mode 100644 index 00000000..96bcf4b8 --- /dev/null +++ b/pvactools/lib/valid_algorithms.py @@ -0,0 +1,55 @@ +import sys +import argparse + +from pvactools.lib.prediction_class import * + +class ValidAlgorithms: + def __init__(self, allele, species): + self.allele = allele + self.species = species + + def print_valid_algorithms(self): + if self.allele is None: + valid_algorithms = [] + if self.species is None: + valid_algorithms = PredictionClass.prediction_methods() + else: + prediction_algorithms = PredictionClass.prediction_methods() + for algorithm in prediction_algorithms: + cls = globals()[algorithm] + alleles = cls().valid_allele_names() + for allele in alleles: + if cls.species_for_allele(allele) == self.species: + valid_algorithms.append(algorithm) + break + else: + valid_algorithms = [] + PredictionClass.check_alleles_valid([self.allele]) + prediction_algorithms = PredictionClass.prediction_methods() + for algorithm in prediction_algorithms: + cls = globals()[algorithm] + alleles = cls().valid_allele_names() + if (self.allele in alleles) \ + and (PredictionClass.species_for_allele(self.allele) == self.species \ + or self.species == None): + valid_algorithms.append(algorithm) + print(', '.join([a for a in valid_algorithms])) + + @classmethod + def parser(cls, tool="pvacseq"): + parser = argparse.ArgumentParser( + "%s valid_algorithms" % tool, + description="Show a list of algorithms supported given the specified species and/or allele", + formatter_class=argparse.ArgumentDefaultsHelpFormatter + ) + parser.add_argument( + "-a", "--allele", + help="Name of the allele to use to get supported algorithms. " + + "For a list of available alleles, use: `{} valid_alleles`.".format(tool), + ) + parser.add_argument( + "-s", "--species", + choices=sorted(set(list(PredictionClass.allele_to_species_map().values())), key=str.casefold), + help="Show valid algorithms for the selected species only", + ) + return parser diff --git a/pvactools/tools/pvacbind/valid_algorithms.py b/pvactools/tools/pvacbind/valid_algorithms.py new file mode 100644 index 00000000..ef6b3798 --- /dev/null +++ b/pvactools/tools/pvacbind/valid_algorithms.py @@ -0,0 +1,15 @@ +import sys + +from pvactools.lib.valid_algorithms import ValidAlgorithms + +def define_parser(): + return ValidAlgorithms.parser('pvacbind') + +def main(args_input = sys.argv[1:]): + parser = define_parser() + args = parser.parse_args(args_input) + + ValidAlgorithms(args.allele, args.species).print_valid_algorithms() + +if __name__ == "__main__": + main() diff --git a/pvactools/tools/pvacfuse/valid_algorithms.py b/pvactools/tools/pvacfuse/valid_algorithms.py new file mode 100644 index 00000000..e29974b5 --- /dev/null +++ b/pvactools/tools/pvacfuse/valid_algorithms.py @@ -0,0 +1,15 @@ +import sys + +from pvactools.lib.valid_algorithms import ValidAlgorithms + +def define_parser(): + return ValidAlgorithms.parser('pvacfuse') + +def main(args_input = sys.argv[1:]): + parser = define_parser() + args = parser.parse_args(args_input) + + ValidAlgorithms(args.allele, args.species).print_valid_algorithms() + +if __name__ == "__main__": + main() diff --git a/pvactools/tools/pvacseq/valid_algorithms.py b/pvactools/tools/pvacseq/valid_algorithms.py new file mode 100644 index 00000000..81dea467 --- /dev/null +++ b/pvactools/tools/pvacseq/valid_algorithms.py @@ -0,0 +1,15 @@ +import sys + +from pvactools.lib.valid_algorithms import ValidAlgorithms + +def define_parser(): + return ValidAlgorithms.parser('pvacseq') + +def main(args_input = sys.argv[1:]): + parser = define_parser() + args = parser.parse_args(args_input) + + ValidAlgorithms(args.allele, args.species).print_valid_algorithms() + +if __name__ == "__main__": + main() diff --git a/pvactools/tools/pvacvector/valid_algorithms.py b/pvactools/tools/pvacvector/valid_algorithms.py new file mode 100644 index 00000000..dd6aa902 --- /dev/null +++ b/pvactools/tools/pvacvector/valid_algorithms.py @@ -0,0 +1,15 @@ +import sys + +from pvactools.lib.valid_algorithms import ValidAlgorithms + +def define_parser(): + return ValidAlgorithms.parser('pvacvector') + +def main(args_input = sys.argv[1:]): + parser = define_parser() + args = parser.parse_args(args_input) + + ValidAlgorithms(args.allele, args.species).print_valid_algorithms() + +if __name__ == "__main__": + main() From 1c05b14d7ab2dfefe59c4a98aabda4de53c50310 Mon Sep 17 00:00:00 2001 From: ldhtnp Date: Tue, 4 Jun 2024 14:28:14 -0500 Subject: [PATCH 04/10] updated documentation with valid algorithms command info --- docs/pvacbind/additional_commands.rst | 12 ++++++++++++ docs/pvacfuse/additional_commands.rst | 12 ++++++++++++ docs/pvacseq/additional_commands.rst | 12 ++++++++++++ docs/pvacvector/additional_commands.rst | 12 ++++++++++++ 4 files changed, 48 insertions(+) diff --git a/docs/pvacbind/additional_commands.rst b/docs/pvacbind/additional_commands.rst index 11299335..470adf87 100644 --- a/docs/pvacbind/additional_commands.rst +++ b/docs/pvacbind/additional_commands.rst @@ -19,6 +19,18 @@ List Valid Alleles .. program-output:: pvacbind valid_alleles -h +.. _valid_algorithms: + +List Valid Algorithms +------------------ + +.. program-output:: pvacbind valid_algorithms -h + +.. .. argparse:: + :module: lib.valid_algorithms + :func: define_parser + :prog: pvacbind valid_algorithms + List Allele-Specific Cutoffs ---------------------------- diff --git a/docs/pvacfuse/additional_commands.rst b/docs/pvacfuse/additional_commands.rst index b9a35ad0..9944b972 100644 --- a/docs/pvacfuse/additional_commands.rst +++ b/docs/pvacfuse/additional_commands.rst @@ -29,6 +29,18 @@ List Valid Alleles :func: define_parser :prog: pvacfuse valid_alleles +.. _valid_algorithms: + +List Valid Algorithms +------------------ + +.. program-output:: pvacfuse valid_algorithms -h + +.. .. argparse:: + :module: lib.valid_algorithms + :func: define_parser + :prog: pvacfuse valid_algorithms + List Allele-Specific Cutoffs ---------------------------- diff --git a/docs/pvacseq/additional_commands.rst b/docs/pvacseq/additional_commands.rst index 782240fd..05cec6ec 100644 --- a/docs/pvacseq/additional_commands.rst +++ b/docs/pvacseq/additional_commands.rst @@ -43,6 +43,18 @@ List Valid Alleles :func: define_parser :prog: pvacseq valid_alleles +.. _valid_algorithms: + +List Valid Algorithms +------------------ + +.. program-output:: pvacseq valid_algorithms -h + +.. .. argparse:: + :module: lib.valid_algorithms + :func: define_parser + :prog: pvacseq valid_algorithms + List Allele-Specific Cutoffs ---------------------------- diff --git a/docs/pvacvector/additional_commands.rst b/docs/pvacvector/additional_commands.rst index 2aec1ea8..7d48a265 100644 --- a/docs/pvacvector/additional_commands.rst +++ b/docs/pvacvector/additional_commands.rst @@ -41,6 +41,18 @@ List Valid Alleles :func: define_parser :prog: pvacfuse valid_alleles +.. _valid_algorithms: + +List Valid Algorithms +------------------ + +.. program-output:: pvacvector valid_algorithms -h + +.. .. argparse:: + :module: lib.valid_algorithms + :func: define_parser + :prog: pvacvector valid_algorithms + List Allele-Specific Cutoffs ---------------------------- From 4e8419905cd8e81ed3a009656e1d7055be803604 Mon Sep 17 00:00:00 2001 From: ldhtnp Date: Tue, 4 Jun 2024 14:29:15 -0500 Subject: [PATCH 05/10] updated init files --- pvactools/lib/__init__.py | 1 + pvactools/tools/pvacbind/__init__.py | 1 + pvactools/tools/pvacfuse/__init__.py | 1 + pvactools/tools/pvacseq/__init__.py | 1 + pvactools/tools/pvacvector/__init__.py | 1 + 5 files changed, 5 insertions(+) diff --git a/pvactools/lib/__init__.py b/pvactools/lib/__init__.py index 6fa426e9..152cfe8d 100644 --- a/pvactools/lib/__init__.py +++ b/pvactools/lib/__init__.py @@ -11,6 +11,7 @@ "fasta_generator", "output_parser", "valid_alleles", + 'valid_algorithms', 'net_chop', "netmhc_stab", "filter", diff --git a/pvactools/tools/pvacbind/__init__.py b/pvactools/tools/pvacbind/__init__.py index 6f39e45e..e6623e1d 100644 --- a/pvactools/tools/pvacbind/__init__.py +++ b/pvactools/tools/pvacbind/__init__.py @@ -2,6 +2,7 @@ 'run', 'binding_filter', 'valid_alleles', + 'valid_algorithms', 'allele_specific_cutoffs', 'download_example_data', 'top_score_filter', diff --git a/pvactools/tools/pvacfuse/__init__.py b/pvactools/tools/pvacfuse/__init__.py index 54b6775c..87dd312e 100644 --- a/pvactools/tools/pvacfuse/__init__.py +++ b/pvactools/tools/pvacfuse/__init__.py @@ -3,6 +3,7 @@ 'binding_filter', 'coverage_filter', 'valid_alleles', + 'valid_algorithms', 'allele_specific_cutoffs', 'download_example_data', 'top_score_filter', diff --git a/pvactools/tools/pvacseq/__init__.py b/pvactools/tools/pvacseq/__init__.py index 1bac38f5..f59e3d1a 100644 --- a/pvactools/tools/pvacseq/__init__.py +++ b/pvactools/tools/pvacseq/__init__.py @@ -2,6 +2,7 @@ 'run', 'binding_filter', 'valid_alleles', + 'valid_algorithms', 'allele_specific_cutoffs', 'download_example_data', 'coverage_filter', diff --git a/pvactools/tools/pvacvector/__init__.py b/pvactools/tools/pvacvector/__init__.py index 96edab08..a068c830 100644 --- a/pvactools/tools/pvacvector/__init__.py +++ b/pvactools/tools/pvacvector/__init__.py @@ -2,6 +2,7 @@ 'run', 'visualize', 'valid_alleles', + 'valid_algorithms', 'allele_specific_cutoffs', 'download_example_data', ] From ba42e17b898be3c48e6bed84d6e154b0a666b3c0 Mon Sep 17 00:00:00 2001 From: ldhtnp Date: Tue, 4 Jun 2024 14:29:48 -0500 Subject: [PATCH 06/10] updated main.py files for new command --- pvactools/tools/pvacbind/main.py | 7 +++++++ pvactools/tools/pvacfuse/main.py | 7 +++++++ pvactools/tools/pvacseq/main.py | 7 +++++++ pvactools/tools/pvacvector/main.py | 7 +++++++ 4 files changed, 28 insertions(+) diff --git a/pvactools/tools/pvacbind/main.py b/pvactools/tools/pvacbind/main.py index 5a38b86c..d6463a50 100644 --- a/pvactools/tools/pvacbind/main.py +++ b/pvactools/tools/pvacbind/main.py @@ -81,6 +81,13 @@ def main(): ) valid_alleles_parser.set_defaults(func=valid_alleles) + valid_algorithms_parser = subparsers.add_parser( + "valid_algorithms", + help="Show a list of algorithms supported given the specified species and/or allele", + add_help=False + ) + valid_algorithms_parser.set_defaults(func=valid_algorithms) + allele_specific_cutoffs_parser = subparsers.add_parser( "allele_specific_cutoffs", help="Show the allele specific cutoffs", diff --git a/pvactools/tools/pvacfuse/main.py b/pvactools/tools/pvacfuse/main.py index 759a2467..6d571917 100644 --- a/pvactools/tools/pvacfuse/main.py +++ b/pvactools/tools/pvacfuse/main.py @@ -79,6 +79,13 @@ def define_parser(): ) valid_alleles_parser.set_defaults(func=valid_alleles) + valid_algorithms_parser = subparsers.add_parser( + "valid_algorithms", + help="Show a list of algorithms supported given the specified species and/or allele", + add_help=False + ) + valid_algorithms_parser.set_defaults(func=valid_algorithms) + identify_problematic_amino_acids_parser = subparsers.add_parser( "identify_problematic_amino_acids", help="Mark problematic amino acid positions in each epitope or filter entries that have problematic amino acids.", diff --git a/pvactools/tools/pvacseq/main.py b/pvactools/tools/pvacseq/main.py index 1d0fc659..0ebf3e5b 100644 --- a/pvactools/tools/pvacseq/main.py +++ b/pvactools/tools/pvacseq/main.py @@ -108,6 +108,13 @@ def define_parser(): ) valid_alleles_parser.set_defaults(func=valid_alleles) + valid_algorithms_parser = subparsers.add_parser( + "valid_algorithms", + help="Show a list of algorithms supported given the specified species and/or allele", + add_help=False + ) + valid_algorithms_parser.set_defaults(func=valid_algorithms) + allele_specific_cutoffs_parser = subparsers.add_parser( "allele_specific_cutoffs", help="Show the allele specific cutoffs.", diff --git a/pvactools/tools/pvacvector/main.py b/pvactools/tools/pvacvector/main.py index 53073fa4..f5634289 100644 --- a/pvactools/tools/pvacvector/main.py +++ b/pvactools/tools/pvacvector/main.py @@ -28,6 +28,13 @@ def define_parser(): ) valid_alleles_parser.set_defaults(func=valid_alleles) + valid_algorithms_parser = subparsers.add_parser( + "valid_algorithms", + help="Show a list of algorithms supported given the specified species and/or allele", + add_help=False + ) + valid_algorithms_parser.set_defaults(func=valid_algorithms) + allele_specific_cutoffs_parser = subparsers.add_parser( "allele_specific_cutoffs", help="Show the allele specific cutoffs", From 9841e5af6bd18bdefbd911e6fa26a15c94a3a27c Mon Sep 17 00:00:00 2001 From: ldhtnp Date: Tue, 4 Jun 2024 14:30:51 -0500 Subject: [PATCH 07/10] added tests for valid algorithms command --- tests/test_pvacbind.py | 14 ++++++++++++++ tests/test_pvacfuse.py | 14 ++++++++++++++ tests/test_pvacseq.py | 14 ++++++++++++++ tests/test_pvacvector.py | 14 ++++++++++++++ 4 files changed, 56 insertions(+) diff --git a/tests/test_pvacbind.py b/tests/test_pvacbind.py index 6b980e9c..aaef4edc 100644 --- a/tests/test_pvacbind.py +++ b/tests/test_pvacbind.py @@ -68,6 +68,7 @@ def test_pvacbind_commands(self): "run", 'binding_filter', 'valid_alleles', + 'valid_algorithms', 'allele_specific_cutoffs', 'download_example_data', "net_chop", @@ -363,3 +364,16 @@ def test_pvacbind_combine_and_condense_steps(self): output_file = os.path.join(output_dir.name, 'combined', file_name) expected_file = os.path.join(self.test_data_directory, 'combine_and_condense', 'combined', file_name) self.assertTrue(compare(output_file, expected_file)) + + def test_valid_algorithms_compiles(self): + compiled_run_path = py_compile.compile(os.path.join( + self.pvactools_directory, + 'pvactools', + "tools", + "pvacbind", + "valid_algorithms.py" + )) + self.assertTrue(compiled_run_path) + + def test_valid_algorithms_runs(self): + valid_algorithms.main("") diff --git a/tests/test_pvacfuse.py b/tests/test_pvacfuse.py index c7f84d25..6a43e6a1 100644 --- a/tests/test_pvacfuse.py +++ b/tests/test_pvacfuse.py @@ -64,6 +64,7 @@ def test_pvacfuse_commands(self): "binding_filter", "coverage_filter", "valid_alleles", + "valid_algorithms", "download_example_data", "net_chop", "netmhc_stab", @@ -205,6 +206,19 @@ def test_valid_alleles_compiles(self): def test_valid_alleles_runs(self): valid_alleles.main(["-p", "SMM"]) + + def test_valid_algorithms_compiles(self): + compiled_run_path = py_compile.compile(os.path.join( + self.pvactools_directory, + 'pvactools', + "tools", + "pvacfuse", + "valid_algorithms.py" + )) + self.assertTrue(compiled_run_path) + + def test_valid_algorithms_runs(self): + valid_algorithms.main("") def test_pvacfuse_pipeline(self): with patch('requests.post', unittest.mock.Mock(side_effect = lambda url, data, files=None: make_response( diff --git a/tests/test_pvacseq.py b/tests/test_pvacseq.py index 9764b2cf..3b197df4 100644 --- a/tests/test_pvacseq.py +++ b/tests/test_pvacseq.py @@ -82,6 +82,7 @@ def test_pvacseq_commands(self): "top_score_filter", "transcript_support_level_filter", "valid_alleles", + "valid_algorithms", 'identify_problematic_amino_acids', ]: result = subprocess_run([ @@ -247,6 +248,19 @@ def test_valid_alleles_compiles(self): def test_valid_alleles_runs(self): valid_alleles.main(["-p", "SMM"]) + + def test_valid_algorithms_compiles(self): + compiled_run_path = py_compile.compile(os.path.join( + self.pvactools_directory, + 'pvactools', + "tools", + "pvacseq", + "valid_algorithms.py" + )) + self.assertTrue(compiled_run_path) + + def test_valid_algorithms_runs(self): + valid_algorithms.main("") def test_identify_problematic_amino_acids_compiles(self): compiled_run_path = py_compile.compile(os.path.join( diff --git a/tests/test_pvacvector.py b/tests/test_pvacvector.py index 49be7008..7ef50627 100644 --- a/tests/test_pvacvector.py +++ b/tests/test_pvacvector.py @@ -81,6 +81,7 @@ def test_pvacvector_commands(self): "run", "visualize", "valid_alleles", + "valid_algorithms", "allele_specific_cutoffs", "download_example_data", ]: @@ -156,6 +157,19 @@ def test_valid_alleles_compiles(self): def test_valid_alleles_runs(self): valid_alleles.main(["-p", "SMM"]) + + def test_valid_algorithms_compiles(self): + compiled_run_path = py_compile.compile(os.path.join( + self.pvactools_directory, + 'pvactools', + "tools", + "pvacvector", + "valid_algorithms.py" + )) + self.assertTrue(compiled_run_path) + + def test_valid_algorithms_runs(self): + valid_algorithms.main("") def test_pvacvector_fa_input_runs_and_produces_expected_output(self): with patch('requests.post', unittest.mock.Mock(side_effect = lambda url, data: make_response( From 062380d8a1231e9e6bea874705bb3a5dc029af12 Mon Sep 17 00:00:00 2001 From: ldhtnp Date: Wed, 5 Jun 2024 10:33:05 -0500 Subject: [PATCH 08/10] fixed error in pvacvector tests --- tests/test_pvacvector.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_pvacvector.py b/tests/test_pvacvector.py index 7ef50627..dffc9581 100644 --- a/tests/test_pvacvector.py +++ b/tests/test_pvacvector.py @@ -160,7 +160,7 @@ def test_valid_alleles_runs(self): def test_valid_algorithms_compiles(self): compiled_run_path = py_compile.compile(os.path.join( - self.pvactools_directory, + self.base_dir, 'pvactools', "tools", "pvacvector", From 95ddcbb6611b3a5d4a55d97804776ce2aa07b871 Mon Sep 17 00:00:00 2001 From: ldhtnp Date: Wed, 5 Jun 2024 11:54:32 -0500 Subject: [PATCH 09/10] added species and allele compatibility check --- pvactools/lib/valid_algorithms.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pvactools/lib/valid_algorithms.py b/pvactools/lib/valid_algorithms.py index 96bcf4b8..9a368663 100644 --- a/pvactools/lib/valid_algorithms.py +++ b/pvactools/lib/valid_algorithms.py @@ -23,8 +23,11 @@ def print_valid_algorithms(self): valid_algorithms.append(algorithm) break else: - valid_algorithms = [] PredictionClass.check_alleles_valid([self.allele]) + if (self.species != None and PredictionClass.species_for_allele(self.allele) != self.species): + print("Given species does not have that allele.") + return + valid_algorithms = [] prediction_algorithms = PredictionClass.prediction_methods() for algorithm in prediction_algorithms: cls = globals()[algorithm] From cb2d395dea8f91d6a97e9e31cadca2c5eac966f1 Mon Sep 17 00:00:00 2001 From: Luke Hendrickson <64616402+ldhtnp@users.noreply.github.com> Date: Wed, 5 Jun 2024 13:53:22 -0500 Subject: [PATCH 10/10] applied suggestions from the PR review Co-authored-by: Susanna Kiwala --- docs/pvacbind/additional_commands.rst | 2 +- docs/pvacfuse/additional_commands.rst | 2 +- docs/pvacseq/additional_commands.rst | 2 +- docs/pvacvector/additional_commands.rst | 2 +- pvactools/lib/valid_algorithms.py | 6 +++--- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/pvacbind/additional_commands.rst b/docs/pvacbind/additional_commands.rst index 470adf87..5937691d 100644 --- a/docs/pvacbind/additional_commands.rst +++ b/docs/pvacbind/additional_commands.rst @@ -22,7 +22,7 @@ List Valid Alleles .. _valid_algorithms: List Valid Algorithms ------------------- +--------------------- .. program-output:: pvacbind valid_algorithms -h diff --git a/docs/pvacfuse/additional_commands.rst b/docs/pvacfuse/additional_commands.rst index 9944b972..f469f29f 100644 --- a/docs/pvacfuse/additional_commands.rst +++ b/docs/pvacfuse/additional_commands.rst @@ -32,7 +32,7 @@ List Valid Alleles .. _valid_algorithms: List Valid Algorithms ------------------- +--------------------- .. program-output:: pvacfuse valid_algorithms -h diff --git a/docs/pvacseq/additional_commands.rst b/docs/pvacseq/additional_commands.rst index 05cec6ec..5e01ca2e 100644 --- a/docs/pvacseq/additional_commands.rst +++ b/docs/pvacseq/additional_commands.rst @@ -46,7 +46,7 @@ List Valid Alleles .. _valid_algorithms: List Valid Algorithms ------------------- +--------------------- .. program-output:: pvacseq valid_algorithms -h diff --git a/docs/pvacvector/additional_commands.rst b/docs/pvacvector/additional_commands.rst index 7d48a265..2f975b9e 100644 --- a/docs/pvacvector/additional_commands.rst +++ b/docs/pvacvector/additional_commands.rst @@ -44,7 +44,7 @@ List Valid Alleles .. _valid_algorithms: List Valid Algorithms ------------------- +--------------------- .. program-output:: pvacvector valid_algorithms -h diff --git a/pvactools/lib/valid_algorithms.py b/pvactools/lib/valid_algorithms.py index 9a368663..c4731fb8 100644 --- a/pvactools/lib/valid_algorithms.py +++ b/pvactools/lib/valid_algorithms.py @@ -25,7 +25,7 @@ def print_valid_algorithms(self): else: PredictionClass.check_alleles_valid([self.allele]) if (self.species != None and PredictionClass.species_for_allele(self.allele) != self.species): - print("Given species does not have that allele.") + raise Exception("Given species does not match given allele.") return valid_algorithms = [] prediction_algorithms = PredictionClass.prediction_methods() @@ -36,7 +36,7 @@ def print_valid_algorithms(self): and (PredictionClass.species_for_allele(self.allele) == self.species \ or self.species == None): valid_algorithms.append(algorithm) - print(', '.join([a for a in valid_algorithms])) + print('\n'.join([a for a in valid_algorithms])) @classmethod def parser(cls, tool="pvacseq"): @@ -47,7 +47,7 @@ def parser(cls, tool="pvacseq"): ) parser.add_argument( "-a", "--allele", - help="Name of the allele to use to get supported algorithms. " + help="Show valid algorithms for the selected allele. " + "For a list of available alleles, use: `{} valid_alleles`.".format(tool), ) parser.add_argument(