Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read the Docs Update to Reflect New Command Line Functionality #390

Merged
merged 15 commits into from
Oct 30, 2024
15 changes: 9 additions & 6 deletions docs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,17 @@ Training, validation, and test splits for the non-enzymatic dataset are availabl

**How do I know which model to use after training Casanovo?**

By default, Casanovo saves a snapshot of the model weights after every 50,000 training steps.
When running model validation, Casanovo will use the validation data to compute performance measures (training loss, validation loss, amino acid precision, and peptide precision) and print this information to the console and log file.
At the end of each validation run and at the end of each training epoch (one complete run over the training data), Casanovo will take a snapshot of the current model weights.
After the training job is finished, the validation snapshot that achieved the lowest **validation loss** will be saved to the output directory as `<output_root>.best.ckpt`.
Additionally, a snapshot of the model weights at the end of each **training** epoch will be saved to the output directory as `epoch=<epoch>-step=<step>.ckpt`.
Snapshots from previous training epochs will be overwritten with the latest training snapshot at the end of each training epoch.

By default, Casanovo runs model validation every 50,000 training steps.
Note that the number of samples that are processed during a single training step depends on the batch size.
Therefore, the default training batch size of 32 corresponds to saving a model snapshot after every 1.6 million training samples.
You can optionally modify the snapshot (and validation) frequency in the [config file](https://github.com/Noble-Lab/casanovo/blob/main/casanovo/config.yaml) (parameter `val_check_interval`), depending on your dataset size.
Note that taking very frequent model snapshots will result in slower training time because Casanovo will evaluate its performance on the validation data for every snapshot.

When saving a model snapshot, Casanovo will use the validation data to compute performance measures (training loss, validation loss, amino acid precision, and peptide precision) and print this information to the console and log file.
After your training job is finished, you can identify the model that achieves the maximum peptide and amino acid precision from the log file and use the corresponding model snapshot.
You can optionally modify the validation run frequency in the [config file](https://github.com/Noble-Lab/casanovo/blob/main/casanovo/config.yaml) (parameter `val_check_interval`), depending on your dataset size.
Note that running model validation very frequently will result in slower training time because Casanovo will evaluate its performance on the validation data for every validation check.

**Even though I added new post-translational modifications to the configuration file, Casanovo didn't identify those peptides.**

Expand Down
2 changes: 1 addition & 1 deletion docs/file_formats.md
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,6 @@ Similarly, in Casanovo evaluation mode only annotated MGF files are supported.
<!-- TODO: when index files can be reused, document this here -->

During training, Casanovo will save **checkpoint files** at every `val_check_interval` steps, specified in the configuration.
Model checkpoints will be saved in the `model_save_folder_path` folder with filename format `epoch=EPOCH-step=STEP.ckpt`, with `EPOCH` the epoch and `STEP` the training step at which the checkpoint was taken, helping you track progress and select the best model based on validation performance.
Model checkpoints will be saved to the folder specified by the `--output_dir` command line option with filename format `epoch=EPOCH-step=STEP.ckpt`, with `EPOCH` the epoch and `STEP` the training step at which the checkpoint was taken, helping you track progress and select the best model based on validation performance.

<!-- TODO: when checkpointing is made more flexible, update this information -->
8 changes: 4 additions & 4 deletions docs/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ We recommend a Linux system with a dedicated GPU to achieve optimal runtime perf
To sequence your own mass spectra with Casanovo, use the `casanovo sequence` command:

```sh
casanovo sequence -o results.mztab spectra.mgf
casanovo sequence spectra.mgf
```
![`casanovo sequence --help`](images/sequence-help.svg)

Expand All @@ -105,10 +105,10 @@ This will write peptide predictions for the given MS/MS spectra to the specified

### Evaluate *de novo* sequencing performance

To evaluate _de novo_ sequencing performance based on known mass spectrum annotations, use the `casanovo evaluate` command:
To evaluate _de novo_ sequencing performance based on known mass spectrum annotations, use the `casanovo sequence` command with the `--evaluate` option:

```sh
casanovo evaluate annotated_spectra.mgf
casanovo sequence annotated_spectra.mgf --evaluate
```
![`casanovo evaluate --help`](images/evaluate-help.svg)

Expand Down Expand Up @@ -144,7 +144,7 @@ casanovo sequence [PATH_TO]/sample_preprocessed_spectra.mgf
```

```{note}
If you want to store the output mzTab file in a different location than the current working directory, specify an alternative output location using the `--output` parameter.
If you want to store the output mzTab file in a different location than the current working directory, specify an alternative output location using the `--output_dir` parameter.
```

This job should complete in < 1 minute.
Expand Down
1 change: 1 addition & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ maxdepth: 1
Getting Started <getting_started.md>
File Formats <file_formats.md>
Command Line Interface <cli.rst>
Nextflow Workflow <nextflow.md>
FAQs <faq.md>
Contributing <CONTRIBUTING.md>
Code of Conduct <CODE_OF_CONDUCT.md>
Expand Down
6 changes: 6 additions & 0 deletions docs/nextflow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Casanovo Nextflow Workflow

To simplify the process of setting up and running Casanovo, a dedicated [Nextflow](https://www.nextflow.io/) workflow is available.
In addition to simplifying the installation of Casanovo and its dependencies, the Casanovo Nextflow workflow provides an automated mass spectrometry data pipeline that converts input data files to a Casanovo-compatible format using [msconvert](https://proteowizard.sourceforge.io/tools/msconvert.html), infers peptide sequences using Casanovo, and (optionally) uploads the results to [Limelight](https://limelight-ms.org/) - a platform for sharing and visualizing proteomics results.
The workflow can be used on POSIX-compatible (UNIX) systems, Windows using WSL, or on a cloud platform such as AWS.
For more details, refer to the [Casanovo Nextflow Workflow Documentation](https://nf-ms-dda-casanovo.readthedocs.io/en/latest/#).
Loading