Skip to Content
DocumentationExporting DataExporting Crosslink-Spectrum-Matches to xiFDR

Exporting Crosslink-Spectrum-Matches to xiFDR

from pyXLMS import __version__ print(f"Installed pyXLMS version: {__version__}")
βœ“
Installed pyXLMS version: 1.5.3
from pyXLMS import parser from pyXLMS import exporter

All exporting functionality is available via the exporter submodule. We also import the parser submodule to read crosslink-spectrum-matches and crosslinks.

parser_result = parser.read( "../../data/ms_annika/XLpeplib_Beveridge_QEx-HFX_DSS_R1_CSMs.txt", engine="MS Annika", crosslinker="DSS", ) csms = parser_result["crosslink-spectrum-matches"]
βœ“
Reading MS Annika CSMs...: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 826/826 [00:00<00:00, 6353.79it/s]

We read crosslink-spectrum-matches using the generic parserΒ  from a single MS Annika .txt file. For easier access we also assign our crosslink-spectrum-matches to the variable csms.

Important

Crosslink-spectrum-matches should not be pre-filtered in any way before exporting to xiFDR!

_df = exporter.to_xifdr(csms, filename=None)

The function exporter.to_xifdr() exports a list of crosslink-spectrum-matches to xiFDRΒ  format for external validation. The tool xiFDR is accessible via the link rappsilberlab.org/software/xifdrΒ . The to_xifdr() function requires that alpha_proteins, beta_proteins, alpha_proteins_peptide_positions, beta_proteins_peptide_positions, alpha_decoy, beta_decoy, charge and score fields are set for all crosslink-spectrum-matches. You can read more about the to_xifdr() function and all its parameters here: docs.

Tip

Specifying filename=None will only return the pandasΒ  DataFrame and not write it to disk!

Last updated on