From c16a87250e538ad1dd45b53ed0f73b56871c492f Mon Sep 17 00:00:00 2001 From: Lilferrit Date: Mon, 17 Jun 2024 13:37:59 -0700 Subject: [PATCH 01/17] implemented automatic CLI documentation generation --- docs/cli.rst | 3 +++ docs/conf.py | 2 +- docs/index.md | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 docs/cli.rst diff --git a/docs/cli.rst b/docs/cli.rst new file mode 100644 index 00000000..ca218524 --- /dev/null +++ b/docs/cli.rst @@ -0,0 +1,3 @@ +.. click:: casanovo.casanovo:main + :prog: casanovo + :nested: full \ No newline at end of file diff --git a/docs/conf.py b/docs/conf.py index a1d8c151..8f4c10c2 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -30,7 +30,7 @@ # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named "sphinx.ext.*") or your custom # ones. -extensions = ["myst_parser"] +extensions = ["myst_parser", "sphinx_click"] # Add any paths that contain templates here, relative to this directory. templates_path = ["_templates"] diff --git a/docs/index.md b/docs/index.md index 2283aeb2..72abf30a 100644 --- a/docs/index.md +++ b/docs/index.md @@ -16,6 +16,7 @@ maxdepth: 1 --- Getting Started File Formats +CLI FAQs Contributing Code of Conduct From 4e8ce27ed19595626014da4cbe79349370bbb932 Mon Sep 17 00:00:00 2001 From: Lilferrit Date: Mon, 17 Jun 2024 13:59:51 -0700 Subject: [PATCH 02/17] converted CLI doc page to markdown, added CLI doc page intro --- docs/cli.md | 10 ++++++++++ docs/cli.rst | 3 --- docs/index.md | 2 +- 3 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 docs/cli.md delete mode 100644 docs/cli.rst diff --git a/docs/cli.md b/docs/cli.md new file mode 100644 index 00000000..4a0efb0f --- /dev/null +++ b/docs/cli.md @@ -0,0 +1,10 @@ +# CLI + +After installing the casanovo package and all of its dependencies, the casanovo CLI +can be used to access casanovo functionality from the command line. For casanovo installation +instructions, see the [Getting Started](./getting_started.md). + +```{click} casanovo.casanovo:main + :prog: casanovo + :nested: full +``` \ No newline at end of file diff --git a/docs/cli.rst b/docs/cli.rst deleted file mode 100644 index ca218524..00000000 --- a/docs/cli.rst +++ /dev/null @@ -1,3 +0,0 @@ -.. click:: casanovo.casanovo:main - :prog: casanovo - :nested: full \ No newline at end of file diff --git a/docs/index.md b/docs/index.md index 72abf30a..52cbea6e 100644 --- a/docs/index.md +++ b/docs/index.md @@ -16,7 +16,7 @@ maxdepth: 1 --- Getting Started File Formats -CLI +CLI FAQs Contributing Code of Conduct From c20ae026c6f527222bbcc23ef4ad6779ee24b4ff Mon Sep 17 00:00:00 2001 From: Lilferrit Date: Tue, 18 Jun 2024 10:15:27 -0700 Subject: [PATCH 03/17] fixed cli man page formatting bug --- docs/cli.md | 10 ---------- docs/cli.rst | 11 +++++++++++ docs/index.md | 2 +- 3 files changed, 12 insertions(+), 11 deletions(-) delete mode 100644 docs/cli.md create mode 100644 docs/cli.rst diff --git a/docs/cli.md b/docs/cli.md deleted file mode 100644 index 4a0efb0f..00000000 --- a/docs/cli.md +++ /dev/null @@ -1,10 +0,0 @@ -# CLI - -After installing the casanovo package and all of its dependencies, the casanovo CLI -can be used to access casanovo functionality from the command line. For casanovo installation -instructions, see the [Getting Started](./getting_started.md). - -```{click} casanovo.casanovo:main - :prog: casanovo - :nested: full -``` \ No newline at end of file diff --git a/docs/cli.rst b/docs/cli.rst new file mode 100644 index 00000000..e746f7e8 --- /dev/null +++ b/docs/cli.rst @@ -0,0 +1,11 @@ +Cassanovo CLI +============== + +After installing the casanovo package and all of its dependencies, the casanovo CLI +can be used to access casanovo functionality from the command line. For casanovo installation +instructions, see the :doc:`Getting Started `. + +.. click:: casanovo.casanovo:main + :prog: casanovo + :nested: full + :commands: configure, evaluate, sequence, train, version \ No newline at end of file diff --git a/docs/index.md b/docs/index.md index 52cbea6e..72abf30a 100644 --- a/docs/index.md +++ b/docs/index.md @@ -16,7 +16,7 @@ maxdepth: 1 --- Getting Started File Formats -CLI +CLI FAQs Contributing Code of Conduct From dcd700c02a4a4852acd4372e70970f063db46f84 Mon Sep 17 00:00:00 2001 From: Lilferrit Date: Thu, 20 Jun 2024 14:37:19 -0700 Subject: [PATCH 04/17] changed casanovo cli help message to rst for compatability with sphinx-python --- casanovo/casanovo.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/casanovo/casanovo.py b/casanovo/casanovo.py index 8bdfa58f..c9c4b926 100644 --- a/casanovo/casanovo.py +++ b/casanovo/casanovo.py @@ -93,7 +93,9 @@ def __init__(self, *args, **kwargs) -> None: @click.group(context_settings=dict(help_option_names=["-h", "--help"])) def main() -> None: - """# Casanovo + """ + Casanovo + ======== Casanovo de novo sequences peptides from tandem mass spectra using a Transformer model. Casanovo currently supports mzML, mzXML, and MGF files @@ -101,14 +103,17 @@ def main() -> None: MassIVE-KB, for training new models. Links: - - Documentation: [https://casanovo.readthedocs.io]() - - Official code repository: [https://github.com/Noble-Lab/casanovo]() + + - Documentation: https://casanovo.readthedocs.io + - Official code repository: https://github.com/Noble-Lab/casanovo If you use Casanovo in your work, please cite: + - Yilmaz, M., Fondrie, W. E., Bittremieux, W., Oh, S. & Noble, W. S. De novo - mass spectrometry peptide sequencing with a transformer model. Proceedings - of the 39th International Conference on Machine Learning - ICML '22 (2022) - doi:10.1101/2022.02.07.479481. + mass spectrometry peptide sequencing with a transformer model. Proceedings + of the 39th International Conference on Machine Learning - ICML '22 (2022) + doi:10.1101/2022.02.07.479481. + """ return From 4bc8d81fad62a45c5992f2122019a334497ed34f Mon Sep 17 00:00:00 2001 From: Lilferrit Date: Thu, 20 Jun 2024 15:14:27 -0700 Subject: [PATCH 05/17] implemented filter javascript --- docs/_static/js/cli-page.js | 25 +++++++++++++++++++++++++ docs/cli.rst | 6 ++++++ docs/conf.py | 4 ++++ 3 files changed, 35 insertions(+) create mode 100644 docs/_static/js/cli-page.js diff --git a/docs/_static/js/cli-page.js b/docs/_static/js/cli-page.js new file mode 100644 index 00000000..8a882d6f --- /dev/null +++ b/docs/_static/js/cli-page.js @@ -0,0 +1,25 @@ +(function () { + const pageMarker = "pfqnhktptyfdeomqabhq"; + + window.onload = (event) => { + let pTags = document.querySelectorAll("p"); + let findMarker = Array.from(pTags).find( + paragraph => paragraph.textContent.includes(pageMarker) + ); + + // If the marker isn't on the page then this isn't + // the page we're looking for + if (findMarker == null) { + return; + } + + // Remove first casanovo header and page marker + let firstHeader = document.querySelector("#casanovo > h2:first-of-type"); + firstHeader.remove(); + findMarker.remove(); + + // Change second header text content + let secondHeader = document.querySelector("#casanovo > h3:first-of-type"); + secondHeader.textContent = "Cassanovo CLI Commands"; + } +})(); \ No newline at end of file diff --git a/docs/cli.rst b/docs/cli.rst index e746f7e8..fe79d66e 100644 --- a/docs/cli.rst +++ b/docs/cli.rst @@ -1,3 +1,9 @@ +.. + This is just a random sequence of letters so the custom javascript can + ensure it is running on the correct page before running any filtering + operations +pfqnhktptyfdeomqabhq + Cassanovo CLI ============== diff --git a/docs/conf.py b/docs/conf.py index 8f4c10c2..c2ff7252 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -60,6 +60,10 @@ html_static_path = ["_static"] html_theme_options = {"repository_url": "https//github.com/Noble-Lab/casanovo"} +html_js_files = [ + 'js/cli-page.js', +] + # -- MyST configuration ------------------------------------------------------ myst_enable_extensions = [ "amsmath", From f640c5adbb12e18ed3614887b1982103eed919f3 Mon Sep 17 00:00:00 2001 From: Lilferrit Date: Thu, 20 Jun 2024 15:26:03 -0700 Subject: [PATCH 06/17] resolved linter errors --- docs/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index c2ff7252..0d4bd677 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -61,7 +61,7 @@ html_theme_options = {"repository_url": "https//github.com/Noble-Lab/casanovo"} html_js_files = [ - 'js/cli-page.js', + "js/cli-page.js", ] # -- MyST configuration ------------------------------------------------------ From 786676c23bed841eaeffdbf3893abc7dcf5c0fc3 Mon Sep 17 00:00:00 2001 From: Lilferrit Date: Thu, 20 Jun 2024 15:27:14 -0700 Subject: [PATCH 07/17] resolved more linter errors --- casanovo/casanovo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/casanovo/casanovo.py b/casanovo/casanovo.py index c9c4b926..397fcc33 100644 --- a/casanovo/casanovo.py +++ b/casanovo/casanovo.py @@ -103,7 +103,7 @@ def main() -> None: MassIVE-KB, for training new models. Links: - + - Documentation: https://casanovo.readthedocs.io - Official code repository: https://github.com/Noble-Lab/casanovo From c4d69f8226eb0cd63da044ed69c5083d01162f2b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 20 Jun 2024 22:31:26 +0000 Subject: [PATCH 08/17] Generate new screengrabs with rich-codex --- docs/images/configure-help.svg | 154 +++++++++++++++------- docs/images/evaluate-help.svg | 182 ++++++++++++++------------ docs/images/help.svg | 212 ++++++++++++++---------------- docs/images/sequence-help.svg | 182 ++++++++++++++------------ docs/images/train-help.svg | 228 ++++++++++++++------------------- 5 files changed, 493 insertions(+), 465 deletions(-) diff --git a/docs/images/configure-help.svg b/docs/images/configure-help.svg index 0822927a..4092bce3 100644 --- a/docs/images/configure-help.svg +++ b/docs/images/configure-help.svg @@ -1,4 +1,4 @@ - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - - $ casanovo configure --help - - Usage: casanovo configure [OPTIONS]                                             - - Generate a Casanovo configuration file to customize.                            - The casanovo configuration file is in the YAML format.                          - -╭─ Options ────────────────────────────────────────────────────────────────────╮ -│ --output  -o  FILE  The output configuration file.                           │ -│ --help    -h        Show this message and exit.                              │ -╰──────────────────────────────────────────────────────────────────────────────╯ - + + $ casanovo configure --help +Traceback (most recent call last): +  File "/opt/hostedtoolcache/Python/3.10.14/x64/bin/casanovo", line 5, in <module> +    from casanovo.casanovo import main +  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/casanovo/casanovo.py", line 32, in <module> +    import depthcharge +  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/depthcharge/__init__.py", line 3, in <module> +    from . import components +  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/depthcharge/components/__init__.py", line 2, in <module> +    from .transformers import SpectrumEncoder, PeptideDecoder +  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/depthcharge/components/transformers.py", line 8, in <module> +    from .. import utils +  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/depthcharge/utils.py", line 5, in <module> +    from tensorboard.backend.event_processing.event_accumulator import ( +  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/tensorboard/backend/event_processing/event_accumulator.py", line 24, in <module> +    from tensorboard.backend.event_processing import event_file_loader +  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/tensorboard/backend/event_processing/event_file_loader.py", line 21, in <module> +    from tensorboard import dataclass_compat +  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/tensorboard/dataclass_compat.py", line 33, in <module> +    from tensorboard.plugins.hparams import metadata as hparams_metadata +  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/tensorboard/plugins/hparams/metadata.py", line 32, in <module> +    NULL_TENSOR = tensor_util.make_tensor_proto( +  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/tensorboard/util/tensor_util.py", line 405, in make_tensor_proto +    numpy_dtype = dtypes.as_dtype(nparray.dtype) +  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py", line 677, in as_dtype +    if type_value.type == np.string_ or type_value.type == np.unicode_: +  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/numpy/__init__.py", line 397, in __getattr__ +    raise AttributeError( +AttributeError: `np.string_` was removed in the NumPy 2.0 release. Use `np.bytes_` instead.. Did you mean: 'strings'? diff --git a/docs/images/evaluate-help.svg b/docs/images/evaluate-help.svg index b16c4ffd..d86b2497 100644 --- a/docs/images/evaluate-help.svg +++ b/docs/images/evaluate-help.svg @@ -1,4 +1,4 @@ - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + + + + + + + + + + - + - + - - $ casanovo evaluate --help - - Usage: casanovo evaluate [OPTIONS] ANNOTATED_PEAK_PATH...                       - - Evaluate de novo peptide sequencing performance.                                - ANNOTATED_PEAK_PATH must be one or more annoated MGF files, such as those       - provided by MassIVE-KB.                                                         - -╭─ Arguments ──────────────────────────────────────────────────────────────────╮ -│ *  ANNOTATED_PEAK_PATH    FILE  [required]                                   │ -╰──────────────────────────────────────────────────────────────────────────────╯ -╭─ Options ────────────────────────────────────────────────────────────────────╮ -│ --model      -m  FILE                        The model weights (.ckpt file). │ -│                                              If not provided, Casanovo will  │ -│                                              try to download the latest      │ -│                                              release.                        │ -│ --output     -o  FILE                        The mzTab file to which results │ -│                                              will be written.                │ -│ --config     -c  FILE                        The YAML configuration file     │ -│                                              overriding the default options. │ -│ --verbosity  -v  [debug|info|warning|error]  Set the verbosity of console    │ -│                                              logging messages. Log files are │ -│                                              always set to 'debug'.          │ -│ --help       -h                              Show this message and exit.     │ -╰──────────────────────────────────────────────────────────────────────────────╯ - + + $ casanovo evaluate --help +Traceback (most recent call last): +  File "/opt/hostedtoolcache/Python/3.10.14/x64/bin/casanovo", line 5, in <module> +    from casanovo.casanovo import main +  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/casanovo/casanovo.py", line 32, in <module> +    import depthcharge +  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/depthcharge/__init__.py", line 3, in <module> +    from . import components +  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/depthcharge/components/__init__.py", line 2, in <module> +    from .transformers import SpectrumEncoder, PeptideDecoder +  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/depthcharge/components/transformers.py", line 8, in <module> +    from .. import utils +  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/depthcharge/utils.py", line 5, in <module> +    from tensorboard.backend.event_processing.event_accumulator import ( +  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/tensorboard/backend/event_processing/event_accumulator.py", line 24, in <module> +    from tensorboard.backend.event_processing import event_file_loader +  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/tensorboard/backend/event_processing/event_file_loader.py", line 21, in <module> +    from tensorboard import dataclass_compat +  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/tensorboard/dataclass_compat.py", line 33, in <module> +    from tensorboard.plugins.hparams import metadata as hparams_metadata +  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/tensorboard/plugins/hparams/metadata.py", line 32, in <module> +    NULL_TENSOR = tensor_util.make_tensor_proto( +  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/tensorboard/util/tensor_util.py", line 405, in make_tensor_proto +    numpy_dtype = dtypes.as_dtype(nparray.dtype) +  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py", line 677, in as_dtype +    if type_value.type == np.string_ or type_value.type == np.unicode_: +  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/numpy/__init__.py", line 397, in __getattr__ +    raise AttributeError( +AttributeError: `np.string_` was removed in the NumPy 2.0 release. Use `np.bytes_` instead.. Did you mean: 'strings'? diff --git a/docs/images/help.svg b/docs/images/help.svg index 2e22e2d3..dfb1039c 100644 --- a/docs/images/help.svg +++ b/docs/images/help.svg @@ -1,4 +1,4 @@ - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - - - - - - - - - - - - - - - - - + + - + - + - - $ casanovo --help - - Usage: casanovo [OPTIONS] COMMAND [ARGS]...                                     - - ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓  - ┃                                  Casanovo                                  ┃  - ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛  - Casanovo de novo sequences peptides from tandem mass spectra using a            - Transformer model. Casanovo currently supports mzML, mzXML, and MGF files for   - de novo sequencing and annotated MGF files, such as those from MassIVE-KB, for  - training new models.                                                            - - Links:                                                                          - -  • Documentation: https://casanovo.readthedocs.io                               -  • Official code repository: https://github.com/Noble-Lab/casanovo              - - If you use Casanovo in your work, please cite:                                  - -  • Yilmaz, M., Fondrie, W. E., Bittremieux, W., Oh, S. & Noble, W. S. De novo   -    mass spectrometry peptide sequencing with a transformer model. Proceedings   -    of the 39th International Conference on Machine Learning - ICML '22 (2022)   -    doi:10.1101/2022.02.07.479481.                                               - -╭─ Options ────────────────────────────────────────────────────────────────────╮ -│ --help  -h    Show this message and exit.                                    │ -╰──────────────────────────────────────────────────────────────────────────────╯ -╭─ Commands ───────────────────────────────────────────────────────────────────╮ -│ configure  Generate a Casanovo configuration file to customize.              │ -│ evaluate   Evaluate de novo peptide sequencing performance.                  │ -│ sequence   De novo sequence peptides from tandem mass spectra.               │ -│ train      Train a Casanovo model on your own data.                          │ -│ version    Get the Casanovo version information                              │ -╰──────────────────────────────────────────────────────────────────────────────╯ - + + $ casanovo --help +Traceback (most recent call last): +  File "/opt/hostedtoolcache/Python/3.10.14/x64/bin/casanovo", line 5, in <module> +    from casanovo.casanovo import main +  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/casanovo/casanovo.py", line 32, in <module> +    import depthcharge +  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/depthcharge/__init__.py", line 3, in <module> +    from . import components +  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/depthcharge/components/__init__.py", line 2, in <module> +    from .transformers import SpectrumEncoder, PeptideDecoder +  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/depthcharge/components/transformers.py", line 8, in <module> +    from .. import utils +  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/depthcharge/utils.py", line 5, in <module> +    from tensorboard.backend.event_processing.event_accumulator import ( +  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/tensorboard/backend/event_processing/event_accumulator.py", line 24, in <module> +    from tensorboard.backend.event_processing import event_file_loader +  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/tensorboard/backend/event_processing/event_file_loader.py", line 21, in <module> +    from tensorboard import dataclass_compat +  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/tensorboard/dataclass_compat.py", line 33, in <module> +    from tensorboard.plugins.hparams import metadata as hparams_metadata +  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/tensorboard/plugins/hparams/metadata.py", line 32, in <module> +    NULL_TENSOR = tensor_util.make_tensor_proto( +  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/tensorboard/util/tensor_util.py", line 405, in make_tensor_proto +    numpy_dtype = dtypes.as_dtype(nparray.dtype) +  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py", line 677, in as_dtype +    if type_value.type == np.string_ or type_value.type == np.unicode_: +  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/numpy/__init__.py", line 397, in __getattr__ +    raise AttributeError( +AttributeError: `np.string_` was removed in the NumPy 2.0 release. Use `np.bytes_` instead.. Did you mean: 'strings'? diff --git a/docs/images/sequence-help.svg b/docs/images/sequence-help.svg index f5799766..b9b96d74 100644 --- a/docs/images/sequence-help.svg +++ b/docs/images/sequence-help.svg @@ -1,4 +1,4 @@ - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + + + + + + + + + + - + - + - - $ casanovo sequence --help - - Usage: casanovo sequence [OPTIONS] PEAK_PATH...                                 - - De novo sequence peptides from tandem mass spectra.                             - PEAK_PATH must be one or more mzMl, mzXML, or MGF files from which to sequence  - peptides.                                                                       - -╭─ Arguments ──────────────────────────────────────────────────────────────────╮ -│ *  PEAK_PATH    FILE  [required]                                             │ -╰──────────────────────────────────────────────────────────────────────────────╯ -╭─ Options ────────────────────────────────────────────────────────────────────╮ -│ --model      -m  FILE                        The model weights (.ckpt file). │ -│                                              If not provided, Casanovo will  │ -│                                              try to download the latest      │ -│                                              release.                        │ -│ --output     -o  FILE                        The mzTab file to which results │ -│                                              will be written.                │ -│ --config     -c  FILE                        The YAML configuration file     │ -│                                              overriding the default options. │ -│ --verbosity  -v  [debug|info|warning|error]  Set the verbosity of console    │ -│                                              logging messages. Log files are │ -│                                              always set to 'debug'.          │ -│ --help       -h                              Show this message and exit.     │ -╰──────────────────────────────────────────────────────────────────────────────╯ - + + $ casanovo sequence --help +Traceback (most recent call last): +  File "/opt/hostedtoolcache/Python/3.10.14/x64/bin/casanovo", line 5, in <module> +    from casanovo.casanovo import main +  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/casanovo/casanovo.py", line 32, in <module> +    import depthcharge +  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/depthcharge/__init__.py", line 3, in <module> +    from . import components +  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/depthcharge/components/__init__.py", line 2, in <module> +    from .transformers import SpectrumEncoder, PeptideDecoder +  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/depthcharge/components/transformers.py", line 8, in <module> +    from .. import utils +  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/depthcharge/utils.py", line 5, in <module> +    from tensorboard.backend.event_processing.event_accumulator import ( +  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/tensorboard/backend/event_processing/event_accumulator.py", line 24, in <module> +    from tensorboard.backend.event_processing import event_file_loader +  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/tensorboard/backend/event_processing/event_file_loader.py", line 21, in <module> +    from tensorboard import dataclass_compat +  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/tensorboard/dataclass_compat.py", line 33, in <module> +    from tensorboard.plugins.hparams import metadata as hparams_metadata +  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/tensorboard/plugins/hparams/metadata.py", line 32, in <module> +    NULL_TENSOR = tensor_util.make_tensor_proto( +  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/tensorboard/util/tensor_util.py", line 405, in make_tensor_proto +    numpy_dtype = dtypes.as_dtype(nparray.dtype) +  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py", line 677, in as_dtype +    if type_value.type == np.string_ or type_value.type == np.unicode_: +  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/numpy/__init__.py", line 397, in __getattr__ +    raise AttributeError( +AttributeError: `np.string_` was removed in the NumPy 2.0 release. Use `np.bytes_` instead.. Did you mean: 'strings'? diff --git a/docs/images/train-help.svg b/docs/images/train-help.svg index fccd4140..a71b8915 100644 --- a/docs/images/train-help.svg +++ b/docs/images/train-help.svg @@ -1,4 +1,4 @@ - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - + - + - - $ casanovo train --help - - Usage: casanovo train [OPTIONS] TRAIN_PEAK_PATH...                              - - Train a Casanovo model on your own data.                                        - TRAIN_PEAK_PATH must be one or more annoated MGF files, such as those provided  - by MassIVE-KB, from which to train a new Casnovo model.                         - -╭─ Arguments ──────────────────────────────────────────────────────────────────╮ -│ *  TRAIN_PEAK_PATH    FILE  [required]                                       │ -╰──────────────────────────────────────────────────────────────────────────────╯ -╭─ Options ────────────────────────────────────────────────────────────────────╮ -│ *  --validation_peak_pa…  -p  FILE                    An annotated MGF file  │ -│                                                       for validation, like   │ -│                                                       from MassIVE-KB. Use   │ -│                                                       this option multiple   │ -│                                                       times to specify       │ -│                                                       multiple files.        │ -│                                                       [required]             │ -│    --model                -m  FILE                    The model weights      │ -│                                                       (.ckpt file). If not   │ -│                                                       provided, Casanovo     │ -│                                                       will try to download   │ -│                                                       the latest release.    │ -│    --output               -o  FILE                    The mzTab file to      │ -│                                                       which results will be  │ -│                                                       written.               │ -│    --config               -c  FILE                    The YAML configuration │ -│                                                       file overriding the    │ -│                                                       default options.       │ -│    --verbosity            -v  [debug|info|warning|er  Set the verbosity of   │ -│                               ror]                    console logging        │ -│                                                       messages. Log files    │ -│                                                       are always set to      │ -│                                                       'debug'.               │ -│    --help                 -h                          Show this message and  │ -│                                                       exit.                  │ -╰──────────────────────────────────────────────────────────────────────────────╯ - + + $ casanovo train --help +Traceback (most recent call last): +  File "/opt/hostedtoolcache/Python/3.10.14/x64/bin/casanovo", line 5, in <module> +    from casanovo.casanovo import main +  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/casanovo/casanovo.py", line 32, in <module> +    import depthcharge +  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/depthcharge/__init__.py", line 3, in <module> +    from . import components +  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/depthcharge/components/__init__.py", line 2, in <module> +    from .transformers import SpectrumEncoder, PeptideDecoder +  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/depthcharge/components/transformers.py", line 8, in <module> +    from .. import utils +  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/depthcharge/utils.py", line 5, in <module> +    from tensorboard.backend.event_processing.event_accumulator import ( +  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/tensorboard/backend/event_processing/event_accumulator.py", line 24, in <module> +    from tensorboard.backend.event_processing import event_file_loader +  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/tensorboard/backend/event_processing/event_file_loader.py", line 21, in <module> +    from tensorboard import dataclass_compat +  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/tensorboard/dataclass_compat.py", line 33, in <module> +    from tensorboard.plugins.hparams import metadata as hparams_metadata +  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/tensorboard/plugins/hparams/metadata.py", line 32, in <module> +    NULL_TENSOR = tensor_util.make_tensor_proto( +  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/tensorboard/util/tensor_util.py", line 405, in make_tensor_proto +    numpy_dtype = dtypes.as_dtype(nparray.dtype) +  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py", line 677, in as_dtype +    if type_value.type == np.string_ or type_value.type == np.unicode_: +  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/numpy/__init__.py", line 397, in __getattr__ +    raise AttributeError( +AttributeError: `np.string_` was removed in the NumPy 2.0 release. Use `np.bytes_` instead.. Did you mean: 'strings'? From 2893ed8b02c019ee65b4d67d75b6be04daca6df2 Mon Sep 17 00:00:00 2001 From: Lilferrit Date: Fri, 21 Jun 2024 14:06:16 -0700 Subject: [PATCH 09/17] cli docuementation fixes/improvements --- docs/cli.rst | 20 ++++++++++---------- docs/index.md | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/cli.rst b/docs/cli.rst index fe79d66e..70661056 100644 --- a/docs/cli.rst +++ b/docs/cli.rst @@ -1,17 +1,17 @@ -.. - This is just a random sequence of letters so the custom javascript can - ensure it is running on the correct page before running any filtering - operations -pfqnhktptyfdeomqabhq - -Cassanovo CLI +Casanovo CLI ============== -After installing the casanovo package and all of its dependencies, the casanovo CLI -can be used to access casanovo functionality from the command line. For casanovo installation +After installing the Casanovo package and all of its dependencies, the Casanovo CLI +can be used to access Casanovo functionality from the command line. For Casanovo installation instructions, see the :doc:`Getting Started `. .. click:: casanovo.casanovo:main :prog: casanovo :nested: full - :commands: configure, evaluate, sequence, train, version \ No newline at end of file + :commands: configure, evaluate, sequence, train, version + +.. + This is just a random sequence of letters so the custom javascript can + ensure it is running on the correct page before running any filtering + operations +pfqnhktptyfdeomqabhq \ No newline at end of file diff --git a/docs/index.md b/docs/index.md index 72abf30a..943ea7d6 100644 --- a/docs/index.md +++ b/docs/index.md @@ -16,7 +16,7 @@ maxdepth: 1 --- Getting Started File Formats -CLI +Command Line Interface FAQs Contributing Code of Conduct From 038cc763bd672e51fccd04c1e40cd59d04e725f3 Mon Sep 17 00:00:00 2001 From: Lilferrit Date: Fri, 21 Jun 2024 14:32:49 -0700 Subject: [PATCH 10/17] fixed misspelling --- docs/_static/js/cli-page.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/_static/js/cli-page.js b/docs/_static/js/cli-page.js index 8a882d6f..79c86771 100644 --- a/docs/_static/js/cli-page.js +++ b/docs/_static/js/cli-page.js @@ -20,6 +20,6 @@ // Change second header text content let secondHeader = document.querySelector("#casanovo > h3:first-of-type"); - secondHeader.textContent = "Cassanovo CLI Commands"; + secondHeader.textContent = "Casanovo CLI Commands"; } })(); \ No newline at end of file From 78dfed6ae4998684d55a0f752673a1ae96a2319f Mon Sep 17 00:00:00 2001 From: Lilferrit Date: Tue, 25 Jun 2024 13:57:08 -0700 Subject: [PATCH 11/17] added sphinx-click dependency to pyproject.toml --- pyproject.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 551954ab..40774e13 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -53,7 +53,8 @@ Documentation = "https://casanovo.readthedocs.io" docs = [ "sphinx>=4.5.0", "myst-parser>=0.18.1", - "sphinx-book-theme>=0.3.3" + "sphinx-book-theme>=0.3.3", + "sphinx-click>=5.2.1" ] dev = [ "pre-commit>=2.7.1", From 83723f8b4692d07921e4b382a4dcd39bbdd52638 Mon Sep 17 00:00:00 2001 From: Lilferrit Date: Tue, 2 Jul 2024 10:05:19 -0700 Subject: [PATCH 12/17] cli restructured text file formatting --- casanovo/denovo/model.py | 15 +++++++++++++++ docs/cli.rst | 7 +++---- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/casanovo/denovo/model.py b/casanovo/denovo/model.py index 77df6df5..f92eb754 100644 --- a/casanovo/denovo/model.py +++ b/casanovo/denovo/model.py @@ -1,9 +1,12 @@ """A de novo peptide sequencing model.""" import collections +import csv import heapq import logging import warnings +from os import PathLike +from pathlib import Path from typing import Any, Dict, Iterable, List, Optional, Tuple, Union import depthcharge.masses @@ -111,6 +114,7 @@ def __init__( tb_summarywriter: Optional[ torch.utils.tensorboard.SummaryWriter ] = None, + metrics_file: Optional[PathLike] = None, train_label_smoothing: float = 0.01, warmup_iters: int = 100_000, cosine_schedule_period_iters: int = 600_000, @@ -182,6 +186,17 @@ def __init__( # Output writer during predicting. self.out_writer = out_writer + # Metrics file + if metrics_file is not None: + self.metrics_file = Path(metrics_file) + + if not self.metrics_file.is_file(): + with open(self.metrics_file, "w") as f: + writer = csv.writer(f, delimiter="\t") + writer.writerow( + ["loss type", "CELLoss", "Epoch", "Batch", "Loss"] + ) + def forward( self, spectra: torch.Tensor, precursors: torch.Tensor ) -> List[List[Tuple[float, np.ndarray, str]]]: diff --git a/docs/cli.rst b/docs/cli.rst index 70661056..e858ad6c 100644 --- a/docs/cli.rst +++ b/docs/cli.rst @@ -1,9 +1,8 @@ Casanovo CLI -============== +============ -After installing the Casanovo package and all of its dependencies, the Casanovo CLI -can be used to access Casanovo functionality from the command line. For Casanovo installation -instructions, see the :doc:`Getting Started `. +After installing the Casanovo package and all of its dependencies, the Casanovo CLI can be used to access Casanovo functionality from the command line. +For Casanovo installation instructions, see the :doc:`Getting Started `. .. click:: casanovo.casanovo:main :prog: casanovo From 6d2db26bf626ddc6cf7cf2cf0c5b6bf04a15bf3f Mon Sep 17 00:00:00 2001 From: Lilferrit Date: Tue, 2 Jul 2024 10:06:37 -0700 Subject: [PATCH 13/17] remove changes from model.py --- casanovo/denovo/model.py | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/casanovo/denovo/model.py b/casanovo/denovo/model.py index f92eb754..77df6df5 100644 --- a/casanovo/denovo/model.py +++ b/casanovo/denovo/model.py @@ -1,12 +1,9 @@ """A de novo peptide sequencing model.""" import collections -import csv import heapq import logging import warnings -from os import PathLike -from pathlib import Path from typing import Any, Dict, Iterable, List, Optional, Tuple, Union import depthcharge.masses @@ -114,7 +111,6 @@ def __init__( tb_summarywriter: Optional[ torch.utils.tensorboard.SummaryWriter ] = None, - metrics_file: Optional[PathLike] = None, train_label_smoothing: float = 0.01, warmup_iters: int = 100_000, cosine_schedule_period_iters: int = 600_000, @@ -186,17 +182,6 @@ def __init__( # Output writer during predicting. self.out_writer = out_writer - # Metrics file - if metrics_file is not None: - self.metrics_file = Path(metrics_file) - - if not self.metrics_file.is_file(): - with open(self.metrics_file, "w") as f: - writer = csv.writer(f, delimiter="\t") - writer.writerow( - ["loss type", "CELLoss", "Epoch", "Batch", "Loss"] - ) - def forward( self, spectra: torch.Tensor, precursors: torch.Tensor ) -> List[List[Tuple[float, np.ndarray, str]]]: From 05f7f0901f441b666a7e5f8068b37d9c8987aea0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 2 Jul 2024 17:09:36 +0000 Subject: [PATCH 14/17] Generate new screengrabs with rich-codex --- docs/images/configure-help.svg | 160 +++++++--------------- docs/images/evaluate-help.svg | 191 +++++++++++++------------- docs/images/help.svg | 218 +++++++++++++++++------------- docs/images/sequence-help.svg | 191 +++++++++++++------------- docs/images/train-help.svg | 237 ++++++++++++++++++++------------- 5 files changed, 504 insertions(+), 493 deletions(-) diff --git a/docs/images/configure-help.svg b/docs/images/configure-help.svg index 4092bce3..b1fcce10 100644 --- a/docs/images/configure-help.svg +++ b/docs/images/configure-help.svg @@ -1,4 +1,4 @@ - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - + - + - - $ casanovo configure --help -Traceback (most recent call last): -  File "/opt/hostedtoolcache/Python/3.10.14/x64/bin/casanovo", line 5, in <module> -    from casanovo.casanovo import main -  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/casanovo/casanovo.py", line 32, in <module> -    import depthcharge -  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/depthcharge/__init__.py", line 3, in <module> -    from . import components -  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/depthcharge/components/__init__.py", line 2, in <module> -    from .transformers import SpectrumEncoder, PeptideDecoder -  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/depthcharge/components/transformers.py", line 8, in <module> -    from .. import utils -  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/depthcharge/utils.py", line 5, in <module> -    from tensorboard.backend.event_processing.event_accumulator import ( -  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/tensorboard/backend/event_processing/event_accumulator.py", line 24, in <module> -    from tensorboard.backend.event_processing import event_file_loader -  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/tensorboard/backend/event_processing/event_file_loader.py", line 21, in <module> -    from tensorboard import dataclass_compat -  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/tensorboard/dataclass_compat.py", line 33, in <module> -    from tensorboard.plugins.hparams import metadata as hparams_metadata -  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/tensorboard/plugins/hparams/metadata.py", line 32, in <module> -    NULL_TENSOR = tensor_util.make_tensor_proto( -  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/tensorboard/util/tensor_util.py", line 405, in make_tensor_proto -    numpy_dtype = dtypes.as_dtype(nparray.dtype) -  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py", line 677, in as_dtype -    if type_value.type == np.string_ or type_value.type == np.unicode_: -  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/numpy/__init__.py", line 397, in __getattr__ -    raise AttributeError( -AttributeError: `np.string_` was removed in the NumPy 2.0 release. Use `np.bytes_` instead.. Did you mean: 'strings'? + + $ casanovo configure --help + +Usage:casanovo configure [OPTIONS]                                             + + Generate a Casanovo configuration file to customize.                            + The casanovo configuration file is in the YAML format.                          + +╭─ Options ────────────────────────────────────────────────────────────────────╮ +--output-oFILE  The output configuration file.                            +--help-h  Show this message and exit.                               +╰──────────────────────────────────────────────────────────────────────────────╯ + diff --git a/docs/images/evaluate-help.svg b/docs/images/evaluate-help.svg index d86b2497..2f770e2e 100644 --- a/docs/images/evaluate-help.svg +++ b/docs/images/evaluate-help.svg @@ -1,4 +1,4 @@ - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - - - - - - - - + + - + - + - - $ casanovo evaluate --help -Traceback (most recent call last): -  File "/opt/hostedtoolcache/Python/3.10.14/x64/bin/casanovo", line 5, in <module> -    from casanovo.casanovo import main -  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/casanovo/casanovo.py", line 32, in <module> -    import depthcharge -  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/depthcharge/__init__.py", line 3, in <module> -    from . import components -  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/depthcharge/components/__init__.py", line 2, in <module> -    from .transformers import SpectrumEncoder, PeptideDecoder -  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/depthcharge/components/transformers.py", line 8, in <module> -    from .. import utils -  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/depthcharge/utils.py", line 5, in <module> -    from tensorboard.backend.event_processing.event_accumulator import ( -  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/tensorboard/backend/event_processing/event_accumulator.py", line 24, in <module> -    from tensorboard.backend.event_processing import event_file_loader -  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/tensorboard/backend/event_processing/event_file_loader.py", line 21, in <module> -    from tensorboard import dataclass_compat -  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/tensorboard/dataclass_compat.py", line 33, in <module> -    from tensorboard.plugins.hparams import metadata as hparams_metadata -  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/tensorboard/plugins/hparams/metadata.py", line 32, in <module> -    NULL_TENSOR = tensor_util.make_tensor_proto( -  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/tensorboard/util/tensor_util.py", line 405, in make_tensor_proto -    numpy_dtype = dtypes.as_dtype(nparray.dtype) -  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py", line 677, in as_dtype -    if type_value.type == np.string_ or type_value.type == np.unicode_: -  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/numpy/__init__.py", line 397, in __getattr__ -    raise AttributeError( -AttributeError: `np.string_` was removed in the NumPy 2.0 release. Use `np.bytes_` instead.. Did you mean: 'strings'? + + $ casanovo evaluate --help + +Usage:casanovo evaluate [OPTIONSANNOTATED_PEAK_PATH...                       + + Evaluate de novo peptide sequencing performance.                                + ANNOTATED_PEAK_PATH must be one or more annoated MGF files, such as those       + provided by MassIVE-KB.                                                         + +╭─ Arguments ──────────────────────────────────────────────────────────────────╮ +*  ANNOTATED_PEAK_PATH    FILE[required] +╰──────────────────────────────────────────────────────────────────────────────╯ +╭─ Options ────────────────────────────────────────────────────────────────────╮ +--model-mFILE                        The model weights (.ckpt file).  +                                              If not provided, Casanovo will   +                                              try to download the latest       +                                              release.                         +--output-oFILE                        The mzTab file to which results  +                                              will be written.                 +--config-cFILE                        The YAML configuration file      +                                              overriding the default options.  +--verbosity-v[debug|info|warning|error]  Set the verbosity of console     +                                              logging messages. Log files are  +                                              always set to 'debug'.           +--help-h  Show this message and exit.      +╰──────────────────────────────────────────────────────────────────────────────╯ + diff --git a/docs/images/help.svg b/docs/images/help.svg index dfb1039c..80d63c7e 100644 --- a/docs/images/help.svg +++ b/docs/images/help.svg @@ -1,4 +1,4 @@ - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + + + + + + + + + + + + + + + + + + + - + - + - - $ casanovo --help -Traceback (most recent call last): -  File "/opt/hostedtoolcache/Python/3.10.14/x64/bin/casanovo", line 5, in <module> -    from casanovo.casanovo import main -  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/casanovo/casanovo.py", line 32, in <module> -    import depthcharge -  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/depthcharge/__init__.py", line 3, in <module> -    from . import components -  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/depthcharge/components/__init__.py", line 2, in <module> -    from .transformers import SpectrumEncoder, PeptideDecoder -  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/depthcharge/components/transformers.py", line 8, in <module> -    from .. import utils -  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/depthcharge/utils.py", line 5, in <module> -    from tensorboard.backend.event_processing.event_accumulator import ( -  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/tensorboard/backend/event_processing/event_accumulator.py", line 24, in <module> -    from tensorboard.backend.event_processing import event_file_loader -  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/tensorboard/backend/event_processing/event_file_loader.py", line 21, in <module> -    from tensorboard import dataclass_compat -  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/tensorboard/dataclass_compat.py", line 33, in <module> -    from tensorboard.plugins.hparams import metadata as hparams_metadata -  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/tensorboard/plugins/hparams/metadata.py", line 32, in <module> -    NULL_TENSOR = tensor_util.make_tensor_proto( -  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/tensorboard/util/tensor_util.py", line 405, in make_tensor_proto -    numpy_dtype = dtypes.as_dtype(nparray.dtype) -  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py", line 677, in as_dtype -    if type_value.type == np.string_ or type_value.type == np.unicode_: -  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/numpy/__init__.py", line 397, in __getattr__ -    raise AttributeError( -AttributeError: `np.string_` was removed in the NumPy 2.0 release. Use `np.bytes_` instead.. Did you mean: 'strings'? + + $ casanovo --help + +Usage:casanovo [OPTIONSCOMMAND [ARGS]...                                     + + ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓  + ┃                                  Casanovo                                  ┃  + ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛  + Casanovo de novo sequences peptides from tandem mass spectra using a            + Transformer model. Casanovo currently supports mzML, mzXML, and MGF files for   + de novo sequencing and annotated MGF files, such as those from MassIVE-KB, for  + training new models.                                                            + + Links:                                                                          + + • Documentation: https://casanovo.readthedocs.io                               + • Official code repository: https://github.com/Noble-Lab/casanovo              + + If you use Casanovo in your work, please cite:                                  + + • Yilmaz, M., Fondrie, W. E., Bittremieux, W., Oh, S. & Noble, W. S. De novo   +mass spectrometry peptide sequencing with a transformer model. Proceedings   +of the 39th International Conference on Machine Learning - ICML '22 (2022)   +doi:10.1101/2022.02.07.479481.                                               + +╭─ Options ────────────────────────────────────────────────────────────────────╮ +--help-h    Show this message and exit.                                     +╰──────────────────────────────────────────────────────────────────────────────╯ +╭─ Commands ───────────────────────────────────────────────────────────────────╮ +configure Generate a Casanovo configuration file to customize.               +evaluate  Evaluate de novo peptide sequencing performance.                   +sequence  De novo sequence peptides from tandem mass spectra.                +train     Train a Casanovo model on your own data.                           +version   Get the Casanovo version information                               +╰──────────────────────────────────────────────────────────────────────────────╯ + diff --git a/docs/images/sequence-help.svg b/docs/images/sequence-help.svg index b9b96d74..6635cfaa 100644 --- a/docs/images/sequence-help.svg +++ b/docs/images/sequence-help.svg @@ -1,4 +1,4 @@ - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - - - - - - - - + + - + - + - - $ casanovo sequence --help -Traceback (most recent call last): -  File "/opt/hostedtoolcache/Python/3.10.14/x64/bin/casanovo", line 5, in <module> -    from casanovo.casanovo import main -  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/casanovo/casanovo.py", line 32, in <module> -    import depthcharge -  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/depthcharge/__init__.py", line 3, in <module> -    from . import components -  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/depthcharge/components/__init__.py", line 2, in <module> -    from .transformers import SpectrumEncoder, PeptideDecoder -  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/depthcharge/components/transformers.py", line 8, in <module> -    from .. import utils -  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/depthcharge/utils.py", line 5, in <module> -    from tensorboard.backend.event_processing.event_accumulator import ( -  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/tensorboard/backend/event_processing/event_accumulator.py", line 24, in <module> -    from tensorboard.backend.event_processing import event_file_loader -  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/tensorboard/backend/event_processing/event_file_loader.py", line 21, in <module> -    from tensorboard import dataclass_compat -  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/tensorboard/dataclass_compat.py", line 33, in <module> -    from tensorboard.plugins.hparams import metadata as hparams_metadata -  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/tensorboard/plugins/hparams/metadata.py", line 32, in <module> -    NULL_TENSOR = tensor_util.make_tensor_proto( -  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/tensorboard/util/tensor_util.py", line 405, in make_tensor_proto -    numpy_dtype = dtypes.as_dtype(nparray.dtype) -  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py", line 677, in as_dtype -    if type_value.type == np.string_ or type_value.type == np.unicode_: -  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/numpy/__init__.py", line 397, in __getattr__ -    raise AttributeError( -AttributeError: `np.string_` was removed in the NumPy 2.0 release. Use `np.bytes_` instead.. Did you mean: 'strings'? + + $ casanovo sequence --help + +Usage:casanovo sequence [OPTIONSPEAK_PATH...                                 + + De novo sequence peptides from tandem mass spectra.                             + PEAK_PATH must be one or more mzMl, mzXML, or MGF files from which to sequence  + peptides.                                                                       + +╭─ Arguments ──────────────────────────────────────────────────────────────────╮ +*  PEAK_PATH    FILE[required] +╰──────────────────────────────────────────────────────────────────────────────╯ +╭─ Options ────────────────────────────────────────────────────────────────────╮ +--model-mFILE                        The model weights (.ckpt file).  +                                              If not provided, Casanovo will   +                                              try to download the latest       +                                              release.                         +--output-oFILE                        The mzTab file to which results  +                                              will be written.                 +--config-cFILE                        The YAML configuration file      +                                              overriding the default options.  +--verbosity-v[debug|info|warning|error]  Set the verbosity of console     +                                              logging messages. Log files are  +                                              always set to 'debug'.           +--help-h  Show this message and exit.      +╰──────────────────────────────────────────────────────────────────────────────╯ + diff --git a/docs/images/train-help.svg b/docs/images/train-help.svg index a71b8915..58251215 100644 --- a/docs/images/train-help.svg +++ b/docs/images/train-help.svg @@ -1,4 +1,4 @@ - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - - $ casanovo train --help -Traceback (most recent call last): -  File "/opt/hostedtoolcache/Python/3.10.14/x64/bin/casanovo", line 5, in <module> -    from casanovo.casanovo import main -  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/casanovo/casanovo.py", line 32, in <module> -    import depthcharge -  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/depthcharge/__init__.py", line 3, in <module> -    from . import components -  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/depthcharge/components/__init__.py", line 2, in <module> -    from .transformers import SpectrumEncoder, PeptideDecoder -  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/depthcharge/components/transformers.py", line 8, in <module> -    from .. import utils -  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/depthcharge/utils.py", line 5, in <module> -    from tensorboard.backend.event_processing.event_accumulator import ( -  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/tensorboard/backend/event_processing/event_accumulator.py", line 24, in <module> -    from tensorboard.backend.event_processing import event_file_loader -  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/tensorboard/backend/event_processing/event_file_loader.py", line 21, in <module> -    from tensorboard import dataclass_compat -  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/tensorboard/dataclass_compat.py", line 33, in <module> -    from tensorboard.plugins.hparams import metadata as hparams_metadata -  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/tensorboard/plugins/hparams/metadata.py", line 32, in <module> -    NULL_TENSOR = tensor_util.make_tensor_proto( -  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/tensorboard/util/tensor_util.py", line 405, in make_tensor_proto -    numpy_dtype = dtypes.as_dtype(nparray.dtype) -  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py", line 677, in as_dtype -    if type_value.type == np.string_ or type_value.type == np.unicode_: -  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/numpy/__init__.py", line 397, in __getattr__ -    raise AttributeError( -AttributeError: `np.string_` was removed in the NumPy 2.0 release. Use `np.bytes_` instead.. Did you mean: 'strings'? + + $ casanovo train --help + +Usage:casanovo train [OPTIONSTRAIN_PEAK_PATH...                              + + Train a Casanovo model on your own data.                                        + TRAIN_PEAK_PATH must be one or more annoated MGF files, such as those provided  + by MassIVE-KB, from which to train a new Casnovo model.                         + +╭─ Arguments ──────────────────────────────────────────────────────────────────╮ +*  TRAIN_PEAK_PATH    FILE[required] +╰──────────────────────────────────────────────────────────────────────────────╯ +╭─ Options ────────────────────────────────────────────────────────────────────╮ +*--validation_peak_pa…-pFILE                    An annotated MGF file   +                                                       for validation, like    +                                                       from MassIVE-KB. Use    +                                                       this option multiple    +                                                       times to specify        +                                                       multiple files.         +[required]             +--model-mFILE                    The model weights       +                                                       (.ckpt file). If not    +                                                       provided, Casanovo      +                                                       will try to download    +                                                       the latest release.     +--output-oFILE                    The mzTab file to       +                                                       which results will be   +                                                       written.                +--config-cFILE                    The YAML configuration  +                                                       file overriding the     +                                                       default options.        +--verbosity-v[debug|info|warning|er  Set the verbosity of    +ror]  console logging         +                                                       messages. Log files     +                                                       are always set to       +                                                       'debug'.                +--help-h  Show this message and   +                                                       exit.                   +╰──────────────────────────────────────────────────────────────────────────────╯ + From 58375ea1ef13123ff634ddd74136242ffafa4f44 Mon Sep 17 00:00:00 2001 From: Lilferrit Date: Mon, 8 Jul 2024 14:34:43 -0700 Subject: [PATCH 15/17] CLI man page event handler implementation --- docs/_static/js/cli-page.js | 25 ------------------------- docs/cli.rst | 6 ------ docs/conf.py | 11 ++++++----- docs/sphinx_click_handlers.py | 9 +++++++++ 4 files changed, 15 insertions(+), 36 deletions(-) delete mode 100644 docs/_static/js/cli-page.js create mode 100644 docs/sphinx_click_handlers.py diff --git a/docs/_static/js/cli-page.js b/docs/_static/js/cli-page.js deleted file mode 100644 index 79c86771..00000000 --- a/docs/_static/js/cli-page.js +++ /dev/null @@ -1,25 +0,0 @@ -(function () { - const pageMarker = "pfqnhktptyfdeomqabhq"; - - window.onload = (event) => { - let pTags = document.querySelectorAll("p"); - let findMarker = Array.from(pTags).find( - paragraph => paragraph.textContent.includes(pageMarker) - ); - - // If the marker isn't on the page then this isn't - // the page we're looking for - if (findMarker == null) { - return; - } - - // Remove first casanovo header and page marker - let firstHeader = document.querySelector("#casanovo > h2:first-of-type"); - firstHeader.remove(); - findMarker.remove(); - - // Change second header text content - let secondHeader = document.querySelector("#casanovo > h3:first-of-type"); - secondHeader.textContent = "Casanovo CLI Commands"; - } -})(); \ No newline at end of file diff --git a/docs/cli.rst b/docs/cli.rst index e858ad6c..e8cc0edc 100644 --- a/docs/cli.rst +++ b/docs/cli.rst @@ -8,9 +8,3 @@ For Casanovo installation instructions, see the :doc:`Getting Started Date: Tue, 9 Jul 2024 09:57:27 -0700 Subject: [PATCH 16/17] requested changes --- docs/conf.py | 6 +----- docs/sphinx_click_handlers.py | 2 -- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index d9785557..98f96367 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -15,6 +15,7 @@ import os import sys + sys.path.insert(0, os.path.abspath(".")) @@ -58,13 +59,8 @@ # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -# html_static_path = ["_static"] html_theme_options = {"repository_url": "https//github.com/Noble-Lab/casanovo"} -html_js_files = [ - "js/cli-page.js", -] - # -- MyST configuration ------------------------------------------------------ myst_enable_extensions = [ "amsmath", diff --git a/docs/sphinx_click_handlers.py b/docs/sphinx_click_handlers.py index 2948634f..7b0dd106 100644 --- a/docs/sphinx_click_handlers.py +++ b/docs/sphinx_click_handlers.py @@ -2,8 +2,6 @@ def process_description(app, ctx, lines): if ctx.command.name == "main": del lines[:3] - print(lines) - def setup(app): app.connect("sphinx-click-process-description", process_description) From e9388c72153b9a2c982166111e897f2cf4234dd2 Mon Sep 17 00:00:00 2001 From: Lilferrit Date: Tue, 9 Jul 2024 09:57:27 -0700 Subject: [PATCH 17/17] requested changes --- docs/conf.py | 7 ++----- docs/sphinx_click_handlers.py | 2 -- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index d9785557..56f7ecb0 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -15,6 +15,7 @@ import os import sys + sys.path.insert(0, os.path.abspath(".")) @@ -58,13 +59,9 @@ # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -# html_static_path = ["_static"] +html_static_path = ["_static"] html_theme_options = {"repository_url": "https//github.com/Noble-Lab/casanovo"} -html_js_files = [ - "js/cli-page.js", -] - # -- MyST configuration ------------------------------------------------------ myst_enable_extensions = [ "amsmath", diff --git a/docs/sphinx_click_handlers.py b/docs/sphinx_click_handlers.py index 2948634f..7b0dd106 100644 --- a/docs/sphinx_click_handlers.py +++ b/docs/sphinx_click_handlers.py @@ -2,8 +2,6 @@ def process_description(app, ctx, lines): if ctx.command.name == "main": del lines[:3] - print(lines) - def setup(app): app.connect("sphinx-click-process-description", process_description)