From 0d1df141ceee1b873c5e2f399ec7419f3a92c06a Mon Sep 17 00:00:00 2001 From: Gwenneth Straub Date: Wed, 30 Oct 2024 01:31:12 -0700 Subject: [PATCH] Read the Docs Update to Reflect New Command Line Functionality (#390) * nextflow documentation * nextflow nav prefix, more nextflow docs details * grammatical fixes * grammatical fixes * fixed links * nextflow documentation * nextflow nav prefix, more nextflow docs details * grammatical fixes * grammatical fixes * fixed links * update Read the Docs with new functionality * rephrasing * update file formats section * updated faq note; training faq section changes --- docs/faq.md | 15 +++++++++------ docs/file_formats.md | 2 +- docs/getting_started.md | 8 ++++---- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/docs/faq.md b/docs/faq.md index 3462ae9d..614d0876 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -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 `.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=-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.** diff --git a/docs/file_formats.md b/docs/file_formats.md index b01e4c02..cc5ffcff 100644 --- a/docs/file_formats.md +++ b/docs/file_formats.md @@ -253,6 +253,6 @@ Similarly, in Casanovo evaluation mode only annotated MGF files are supported. 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. diff --git a/docs/getting_started.md b/docs/getting_started.md index 78163ac2..ef0ef287 100644 --- a/docs/getting_started.md +++ b/docs/getting_started.md @@ -99,7 +99,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) @@ -108,10 +108,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) @@ -147,7 +147,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.