Skip to Content
DocumentationExporting DataExporting Crosslinks to XMAS

Exporting Crosslinks to XMAS

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_Crosslinks.xlsx", engine="MS Annika", crosslinker="DSS", ) xls = parser_result["crosslinks"]
βœ“
Reading MS Annika crosslinks...: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 300/300 [00:00<00:00, 17341.39it/s]

We read crosslinks using the generic parserΒ  from a single MS Annika .xlsx file. For easier access we also assign our crosslinks to the variable xls.

from pyXLMS.transform import validate, targets_only xls = targets_only(validate(xls))
βœ“
Iterating over scores for FDR calculation...: 25%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ | 74/300 [00:00<?, ?it/s]
Important

For down-stream analysis with XMAS you would usually want to only consider high-confidence target crosslinks, either by pre-filtering in the search engine of your choice or via the pyXLMS functions validate() [docsΒ ] and targets_only() [docsΒ ]!

_df = exporter.to_xmas(xls, filename=None)

The function exporter.to_xmas() exports a list of crosslinks to XMASΒ  format for visualization in ChimeraXΒ . The tool XMAS is accessible via the link github.com/ScheltemaLab/ChimeraX_XMAS_bundleΒ  or directly via the ChimeraX ToolshedΒ . You can read more about the to_xmas() 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