Exporting Crosslinks to XLinkDB
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_Crosslinks.xlsx",
engine="MS Annika",
crosslinker="DSS",
)
xls = parser_result["crosslinks"] Reading MS Annika crosslinks...: 100%|ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ| 300/300 [00:00<00:00, 19811.87it/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]_df = exporter.to_xlinkdb(xls, filename=None)The function exporter.to_xlinkdb() exports a list of crosslinks to XLinkDBΒ format. The tool XLinkDB is accessible via the link xlinkdb.gs.washington.edu/xlinkdbΒ . Requires that alpha_proteins and beta_proteins fields are set for all crosslinks. The filename - if provided - should only contain alphanumeric characters to match the XLinkDB format specificationΒ . You can read more about the to_xlinkdb() function and all its parameters here: docs.
Specifying filename=None will only return the pandasΒ DataFrame and not write it to disk!