This repository contains code for rescoring Spectronaut crosslinking spectral library search results, generated as proposed here, with Mokapot.
- 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
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
/datadirectory: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.csvwith an extra column calledMokapot Scorecontaining the new scores! - For more information regarding the
rescore()function please refer to the documentation!
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
/datadirectory: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!
For the entrapment analysis and figure code we did for the manuscript, please check this notebook.
If you are using code from this repository please cite as described here.
