Package: xlms-tools
xlms-toolsDescriptionxlms-tools is a set of command line tools to apply crosslinking mass spectrometry (XL-MS) data to protein structure models.Setting up xlms-toolsxlms-tools can be installed directly from PyPI, as follows:$pipinstallxlms-toolsOr alternatively, by downloading or cloning this repository, and running the following from the project directory:$pipinstalldist/xlms_tools-1.0.3-py3-none-any.whlUsing xlms-toolsCurrently, xlms-tools can be run in two modes. The first is to score how well a protein structure model agrees with XL-MS data, which is specified as a list crosslinks and monolinks derived from a XL-MS experiment. The second mode is to compute the depths of individual residues in protein structures.To score how well a protein structure agrees with XL-MS dataFirst, format crosslinks and monolinks into a text file with the following format:98|A|147|A5.1#72|A|161|A4.3# crosslinks: <residue # of a>|<chain of a>|<res#, b>|<chain, b> <occupancy>72|A|180|A2.7#35|A1.9#137|A5.3# monolinks: <residue # of a>|<chain of a> <occupancy>97|A2.6#where each line corresponds to either a crosslink or a monolink. Optionally, a numerical value can be appended at the end of each line, corresponding to the occupancy of each individual monolink or crosslink. For a detailed discussion on occupancy, please refer to the paper.Score protein structure model/s:
To compute the crosslink (XLP) and monolink probability (MP) scores of one or more protein structures, execute the following in the command line:$xlms-tools-mscore-l[listofcrosslinksand/ormonolinks][PDBfile/s]--name[nameofrun]Example files can be found in the tests/ directory. You can navigate to the tests/ directory and run the scoring, as follows:$xlms-tools-mscore-lxlms_data_qtv.txtmodel_1.pdb--namewithoccupancy_m1#score model_1.pdb$xlms-tools-mscore-lxlms_data_qtv.txtmodel_*pdb--namewithoccupancy_all#score all modelsThe outputs include (a) a tab-separated (.tsv) file containing the scores, which can be viewed using a spreadsheet editor, as well as (b) a ChimeraX command (.cxc) file, which can be executed by double-clicking the .cxc file (given a working installation of ChimeraX). In the ChimeraX visualization, crosslinks and monolinks are color-coded: blue means that the spanning distance of the crosslink, or the residue depth of the monolinked residue, are well within the cutoff, red stands for a maximum distance violation (for crosslinks) or a maximum depth violation (for monolinks), while yellow is within the cutoff, but approaching it. The distance cutoffs are currently only defined for BS3/DSS, but will be expanded in future releases.link typeblueyellowredany monolinkdepth ≤ 6.25Å-depth > 6.25ÅBS3 or DSS crosslinkCA-CA distance ≤ 21Å21Å < CA-CA distance ≤ 33ÅCA-CA distance >  33ÅTo compute residue depths in a protein structureRun the following command:$xlms-tools-mdepth[PDBfile/s]Example files can be found in the tests/ directory. You can navigate to the tests/ directory and run the depth computations, as follows:$xlms-tools-mdepthmodel_1.pdb#compute residue depths for model_1.pdb$xlms-tools-mdepthmodel_*pdb#compute residue depths for all modelsEach line of the output file (.depth file) corresponds to one residue# format: <residue number>:<chain>	<amino acid>	<residue depth in Å>A:26LYS4.317777777777779A:27LEU4.608300983124843
A:28VAL5.739574753218949
A:29VAL8.684474490011493
A:30ALA8.926983412282244
A:31THR8.0268463237516
A:32ASP6.0348264453008715
A:33THR4.487608873498731
A:34ALA4.371281572999748
A:35PHE5.2527378512712275
A:36VAL5.226420625104608
A:37PRO6.844806528409208
...APIxlms_tools.depth.computedepth(biopdbstruct)Computes the depth of each residue in a Biopython PDB structureParameters:biopdbstruct: an instance of theBio.PDB structure classReturns:depths: dictionary containing residue depths, with key-value pairs in the format chainid:residue#-residue_depthresidues: dictionary containing residue names, with key-value pairs in the format chainid:residue#-residue_nameExample usage:fromBio.PDBimportPDBParser
fromxlms_tools.depthimportcomputedepthparser=PDBParser()biopdbstruct=parser.get_structure('test','tests/bigmodel.pdb')depths,residues=computedepth(biopdbstruct)xlms_tools.score.linkmetrics(biopdbstruct,link,depths,linkweight=1.0,linker='BS3/DSS')Computes the score and CA-CA distance/residue depth in a Biopython PDB structure for a given crosslink or monolink.Parameters:biopdbstruct: an instance of theBio.PDB structure classlink: a tuple defining either a monolink (residue#, chainid), or a crosslink (residue#_1, chainid_1, residue#_2, chainid_2)depths: dictionary of residue depths (fromxlms_tools.depth.computedepth(biopdbstruct))linkweight: for quantitative XL-MS data, a measure of relative abundance or occupancy. If unspecified, default weight is 1.0linker: crosslinking reagent used (if unspecified, default is BS3/DSS)Returns:score: monolink probability (MP) score for a monolink, crosslink probability (XLP) score for a crosslinkmonolinkdepth: depth of the monolinked residuecrosslinkdistance: CA-CA distance of crosslinkExample usage:fromBio.PDBimportPDBParser
fromxlms_tools.depthimportcomputedepth
fromxlms_tools.scoreimportlinkmetricsparser=PDBParser()biopdbstruct=parser.get_structure('test','tests/bigmodel.pdb')depths,residues=computedepth(biopdbstruct)# compute monolink scorempscore,mpdepth=linkmetrics(biopdbstruct,(1,'A'),depths)# computed crosslink scorexlpscore,distance=linkmetrics(biopdbstruct,(1049,'B',1409,'B'),depths)CitationsWhen using xlms-tools, please cite:
Manalastas-Cantos, K., Adoni, K. R., Pfeifer, M., Märtens, B., Grünewald, K., Thalassinos, K., & Topf, M. (2024). Modeling flexible protein structure with AlphaFold2 and cross-linking mass spectrometry. Molecular & Cellular Proteomics.https://doi.org/10.1016/j.mcpro.2024.100724