Get covalent paths#
Finding paths of covalently bonded atoms matching specified element patterns.
The function molsysmt.topology.get_covalent_paths() identifies all linear sequences of covalently bonded atoms that match a specified pattern of atom names or element criteria.
Added in version 1.0.0.
API documentation
Follow this link for a detailed description of the input arguments, raised errors, and returned objects of this function: molsysmt.topology.get_covalent_paths().
Basic usage#
Let’s show how to find covalent paths matching atom name patterns using TcTIM (PDB ID: 1TCD):
import molsysmt as msm
molsys = msm.convert(msm.systems['TcTIM']['1tcd.h5msm'], to_form='molsysmt.MolSys')
Note
Demo Systems Catalog
This tutorial uses demonstration datasets provided by MolSysMT. To explore the full catalog of bundled systems, forms, and file paths, visit the Demo Systems guide.
We inspect structural information with molsysmt.basic.info():
msm.info(molsys)
| form | n_atoms | n_groups | n_components | n_chains | n_molecules | n_entities | n_waters | n_proteins | n_structures |
|---|---|---|---|---|---|---|---|---|---|
| molsysmt.MolSys | 3983 | 662 | 167 | 4 | 167 | 2 | 165 | 2 | 1 |
We search for all 3-atom covalent paths matching the sequence C -> N -> CA using molsysmt.topology.get_covalent_paths():
covalent_paths = msm.topology.get_covalent_paths(molsys, path=['atom_name=="C"', 'atom_name=="N"', 'atom_name=="CA"'])
covalent_paths.shape
(495, 3)
covalent_paths
array([[ 2, 9, 10],
[ 11, 16, 17],
[ 18, 25, 26],
...,
[3789, 3796, 3797],
[3798, 3801, 3802],
[3803, 3808, 3809]], shape=(495, 3))
We check the atom names along the first retrieved covalent path using molsysmt.basic.get():
msm.get(molsys, element='atom', selection=covalent_paths[0], name=True)
['C', 'N', 'CA']
Using multi-name atom selections#
Selection strings at each position can match multiple atom names:
covalent_paths = msm.topology.get_covalent_paths(molsys, path=['atom_name==["C", "N"]', 'atom_name=="CA"', 'atom_name=="C"'])
covalent_paths
array([[ 0, 1, 2],
[ 2, 1, 2],
[ 9, 10, 11],
...,
[3803, 3802, 3803],
[3808, 3809, 3810],
[3810, 3809, 3810]], shape=(994, 3))
msm.get(molsys, element='atom', selection=covalent_paths[0], name=True)
['N', 'CA', 'C']
msm.get(molsys, element='atom', selection=covalent_paths[1], name=True)
['C', 'CA', 'C']
See also
Related Tools & References
Convert: Convert molecular systems between different forms with
molsysmt.basic.convert().Info: Inspect summary information of a molecular system with
molsysmt.basic.info().Get covalent paths: Find linear sequences of covalently bonded atoms matching patterns with
molsysmt.topology.get_covalent_paths().Get: Retrieve attribute values from a molecular system with
molsysmt.basic.get().