Skip to content

hgb-bin-proteomics/MSAnnika_Spectral_Library_exporter_rescoring

Repository files navigation

Rescoring of Spectronaut Crosslinking Results with Mokapot

This repository contains code for rescoring Spectronaut crosslinking spectral library search results, generated as proposed here, with Mokapot.

rescoring workflow image

Requirements

  • You need annotated and grouped results as returned by post_process.py as input! These files usually end in the suffix .csv_annotated.csv_grouped_by_residue_pair.csv!
  • Install uv!
  • Initialize this project by running:
    uv sync

Rescoring with Mokapot

You can rescore your results with the following code:

  • Launch a python shell with uv:
    uv run python
  • Import the necessary python function:
    from mokapot_rescore import rescore
  • Rescore your results, in this case we use example data from the /data directory:
    df = rescore(
        "data/THIDDIAXL003_DIAmethodEval_SN20c4_Report_FM_crosslinking_plusDecoy_req_DIA12_CV48.csv_annotated.csv_grouped_by_residue_pair.csv"
    )
  • Write out the rescored to a new file:
    df.to_csv("rescored.csv", index=False)
  • In this case you get a new result file named rescored.csv with an extra column called Mokapot Score containing the new scores!
  • For more information regarding the rescore() function please refer to the documentation!

Reading Results with pyXLMS

For FDR estimation and down-stream analysis we also provide a parser for pyXLMS. You can read both non-rescored and rescored results with it:

  • Launch a python shell with uv:
    uv run python
  • Import the necessary python function:
    from pyXLMS_adaptor import read
  • Read the result file, in this case we use example data from the /data directory:
    pr = read(
        "data/THIDDIAXL003_DIAmethodEval_SN20c4_Report_FM_crosslinking_plusDecoy_req_DIA12_CV48.csv_annotated.csv_grouped_by_residue_pair.csv",
        score="EG.Cscore",
    )
  • You now have a parser_result that you can use with pyXLMS!
  • For more information regarding the read() function please refer to the documentation!

Manuscript and Figure Code

For the entrapment analysis and figure code we did for the manuscript, please check this notebook.

Known Issues

List of known issues

Citing

If you are using code from this repository please cite as described here.

License

Contact