Skip to content

Commit

Permalink
Read the Docs Update to Reflect New Command Line Functionality (#390)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
Lilferrit authored Oct 30, 2024
1 parent e2290fa commit 0d1df14
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
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 @@ -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)

Expand All @@ -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)

Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 0d1df14

Please sign in to comment.