Exporting Crosslinks to xiNET and xiVIEW
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, 18813.32it/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_xinet(xls, filename=None)The function exporter.to_xinet() exports a list of crosslinks to xiNETΒ format. The tool xiNET is accessible via the link crosslinkviewer.orgΒ . Requires that alpha_proteins, beta_proteins, alpha_proteins_crosslink_positions and beta_proteins_crosslink_positions fields are set for all crosslinks. You can read more about the to_xinet() function and all its parameters here: docs.
Specifying filename=None will only return the pandasΒ DataFrame and not write it to disk!
_df = exporter.to_xiview(xls, filename=None)The function exporter.to_xiview() exports a list of crosslinks to xiVIEWΒ format. The tool xiVIEW is accessible via the link xiview.orgΒ . Requires that alpha_proteins, beta_proteins, alpha_proteins_crosslink_positions and beta_proteins_crosslink_positions fields are set for all crosslinks. You can read more about the to_xiview() function and all its parameters here: docs.
Specifying filename=None will only return the pandasΒ DataFrame and not write it to disk!