Exporting Crosslink-Spectrum-Matches to xiFDR
from pyXLMS import __version__
print(f"Installed pyXLMS version: {__version__}") Installed pyXLMS version: 1.5.3from pyXLMS import parser
from pyXLMS import exporterAll 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.
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.
Specifying filename=None will only return the pandasΒ DataFrame and not write it to disk!