Views
No views yet
calibrated_confidence with de novo FDR control.model.safetensors: trained classifierconfig.json: classifier hyperparameter settings1from pathlib import Path
2from huggingface_hub import snapshot_download
3from winnow.calibration.calibrator import ProbabilityCalibrator
4from winnow.datasets.data_loaders import InstaNovoDatasetLoader
5from winnow.scripts.main import filter_dataset
6from winnow.fdr.nonparametric import NonParametricFDRControl
7
8# 1) Download model files
9general_model = Path("general_model")
10snapshot_download(
11 repo_id="InstaDeepAI/winnow-helaqc-model",
12 repo_type="model",
13 local_dir=helaqc_model,
14)
15
16# 2) Load calibrator
17calibrator = ProbabilityCalibrator.load(pretrained_model_name_or_path=helaqc_model)
18
19# 3) Load your dataset (InstaNovo-style config)
20dataset = InstaNovoDatasetLoader().load(
21 data_path="path_to_spectrum_data.parquet",
22 predictions_path="path_to_instanovo_predictions.csv",
23)
24dataset = filter_dataset(dataset) # standard Winnow filtering
25
26# 4) Predict calibrated confidences
27calibrator.predict(dataset) # adds dataset.metadata["calibrated_confidence"]
28
29# 5) Optional: FDR control on calibrated confidence
30fdr = NonParametricFDRControl()
31fdr.fit(dataset.metadata["calibrated_confidence"])
32cutoff = fdr.get_confidence_cutoff(0.05) # 5% FDR cutoff
33dataset.metadata["keep@5%"] = dataset.metadata["calibrated_confidence"] >= cutoff1# After `pip install winnow`
2winnow predict \
3 data_loader=instanovo \
4 dataset.spectrum_path_or_directory=my_data.parquet \
5 dataset.predictions_path=my_preds.csv \
6 calibrator.pretrained_model_name_or_path=config_with_dataset_paths.yaml \
7 fdr_control.fdr_threshold=0.05 \
8 output_folder=outputsspectrum_id (string): unique spectrum identifierexperiment_name (string): MS run identifierretention_time (float): retention time (seconds)precursor_charge (float): charge of the precursor ion (from MS1)precursor_mz (float): mass-to-charge of the precursor ion (from MS1)mz_array (list[float]): mass-to-charge values of the MS2 spectrumintensity_array (list[float]): intensity values of the MS2 spectrumspectrum_id (string)predictions (string): top prediction, untokenised sequencepredictions_tokenised (string): comma‐separated tokens for the top predictionlog_probability (float): top prediction log probabilitytoken_log_probabilities (list[float]): per-token log-probabilities for the top predictionpredictions_beam_k (string): untokenised sequence for beam k (k≥0)log_probability_beam_k (float)token_log_probabilities_k (string/list-encoded)metadata.csv: spectrum metadata and computed features. Contains everything except the prediction and FDR columns, i.e.:
spectrum_id, experiment_name, precursor_mz, precursor_charge, retention_time, etc. (all pass-through spectrum columns)
All computed feature columns, including intermediate results (mass_error_da, irt_error, ion_matches, margin, etc.)preds_and_fdr_metrics.csv: predictions and FDR results. Always contains:
spectrum_idpredictioncalibrated_confidence: calibrated probabilitypsm_fdrpsm_q_valuepsm_pepwinnow in your research, please cite our preprint: De novo peptide sequencing rescoring and FDR estimation with Winnow1@article{mabona2025novopeptidesequencingrescoring,
2 title = {De novo peptide sequencing rescoring and FDR estimation with Winnow},
3 author = {Amandla Mabona and Jemma Daniel and Henrik Servais Janssen Knudsen and
4 Rachel Catzel and Kevin Michael Eloff and Erwin M. Schoof and Nicolas
5 Lopez Carranza and Timothy P. Jenkins and Jeroen Van Goey and
6 Konstantinos Kalogeropoulos},
7 year = {2025},
8 eprint = {2509.24952},
9 archivePrefix = {arXiv},
10 primaryClass = {q-bio.QM},
11 url = {https://arxiv.org/abs/2509.24952},
12}1@misc{instadeep_ltd_2025,
2 author = { InstaDeep Ltd },
3 title = { winnow-helaqc-model (Revision aa4465fde73f384468b50aaa40fc5bb445216763) },
4 year = 2026,
5 url = { https://huggingface.co/InstaDeepAI/winnow-general-model },
6 doi = { 10.57967/hf/6611 },
7 publisher = { Hugging Face }
8}InstaNovo model to generate predictions, please also cite: InstaNovo enables diffusion-powered de novo peptide sequencing in large-scale proteomics experiments1@article{eloff_kalogeropoulos_2025_instanovo,
2 title = {InstaNovo enables diffusion-powered de novo peptide sequencing in large-scale
3 proteomics experiments},
4 author = {Eloff, Kevin and Kalogeropoulos, Konstantinos and Mabona, Amandla and Morell,
5 Oliver and Catzel, Rachel and Rivera-de-Torre, Esperanza and Berg Jespersen,
6 Jakob and Williams, Wesley and van Beljouw, Sam P. B. and Skwark, Marcin J.
7 and Laustsen, Andreas Hougaard and Brouns, Stan J. J. and Ljungars,
8 Anne and Schoof, Erwin M. and Van Goey, Jeroen and auf dem Keller, Ulrich and
9 Beguir, Karim and Lopez Carranza, Nicolas and Jenkins, Timothy P.},
10 year = 2025,
11 month = {Mar},
12 day = 31,
13 journal = {Nature Machine Intelligence},
14 doi = {10.1038/s42256-025-01019-5},
15 issn = {2522-5839},
16 url = {https://doi.org/10.1038/s42256-025-01019-5}
17}