%load_ext autoreload
%autoreload 2
import molsysmt as msm

Get dihedral quartets#

MolSysMT includes a method to obtain the sets of atoms quartets defining all dihedral angles present in the system given their names. There is no need then to remember the atom names defining the angle \(\phi\), \(\psi\), \(\omega\), or any of the \(\chi\) angles. Lets see how this method works over one of the demo molecular systems:

molecular_system = msm.systems['TcTIM']['1tcd.mmtf']
molecular_system = msm.convert(molecular_system)

The quartets defining the angles \(\phi\), \(\psi\) or \(\omega\) over the whole system can be obtained as follows:

phi_chains = msm.topology.get_dihedral_quartets(molecular_system, phi=True)
phi_chains
array([[   2,    9,   10,   11],
       [  11,   16,   17,   18],
       [  18,   25,   26,   27],
       ...,
       [3789, 3796, 3797, 3798],
       [3798, 3801, 3802, 3803],
       [3803, 3808, 3809, 3810]])

The search of these quartets can be limited to a specific selection. Lets see how to get the quartes of the \(\psi\) angles in residues 10 to 15:

psi_chains = msm.topology.get_dihedral_quartets(molecular_system, selection='10<=group_index<=15', psi=True)
psi_chains
array([[ 77,  78,  79,  86],
       [ 86,  87,  88,  92],
       [ 92,  93,  94, 100],
       [100, 101, 102, 104],
       [104, 105, 106, 110]])

Atoms chains defining \(\chi\) angles can be also extracted. Lets get, for instance, all \(\chi_{5}\) in the system:

chi5_chains = msm.topology.get_dihedral_quartets(molecular_system, chi5=True)

There’s a high number of ARG residues in our system. ARG is the only amino-acide with a \(\chi_{5}\) dihedral angle.

print(chi5_chains.shape[0])
26
n_args = msm.get(molecular_system, element='group', selection='group_name=="ARG"', n_groups=True)
print(n_args)
26
phi, psi = msm.topology.get_dihedral_quartets(molecular_system, phi=True, psi=True)
phi
array([[   2,    9,   10,   11],
       [  11,   16,   17,   18],
       [  18,   25,   26,   27],
       ...,
       [3789, 3796, 3797, 3798],
       [3798, 3801, 3802, 3803],
       [3803, 3808, 3809, 3810]])
psi
array([[   0,    1,    2,    9],
       [   9,   10,   11,   16],
       [  16,   17,   18,   25],
       ...,
       [3787, 3788, 3789, 3796],
       [3796, 3797, 3798, 3801],
       [3801, 3802, 3803, 3808]])
msm.get(molecular_system, element='atom', selection=phi[0], name=True)
['C', 'N', 'CA', 'C']

In the following tables a summary of the dihedral angle definitions are included in this document for future reference. The corresponding string taken by the input argument dihedral_angle is written down between parentesis next to each greek letter naming the angle:

\(\phi\) (phi)#

Residue

Atoms

Zero value

Range (degrees)

all but PRO

C-N-CA-C

C cis to C

[-180, 180)

PRO

C-N-CA-C

C cis to C

~-90

\(\psi\) (psi)#

Residue

Atoms

Zero value

Range (degrees)

all

N-CA-C-N

N cis to N

[-180, 180)

\(\omega\) (omega)#

Residue

Atoms

Zero value

Range (degrees)

all

CA-C-N-CA

CA cis to CA

~180

all

CH3-C-N-CA

CA cis to CA

~180

all

CA-C-N-CH3

CA cis to CA

~180

\(\chi_{1}\) (chi1)#

Residue

Atoms

Zero value

Range (degrees)

ARG

N-CA-CB-CG

CG cis to N

[-180, 180)

ASN

N-CA-CB-CG

CG cis to N

[-180, 180)

ASP

N-CA-CB-CG

CG cis to N

[-180, 180)

CYS

N-CA-CB-SG

SG cis to N

[-180, 180)

GLN

N-CA-CB-CG

CG cis to N

[-180, 180)

GLU

N-CA-CB-CG

CG cis to N

[-180, 180)

HIS

N-CA-CB-CG

CG cis to N

[-180, 180)

ILE

N-CA-CB-CG1

CG1 cis to N

[-180°, 180)

LEU

N-CA-CB-CG

CG cis to N

[-180, 180)

LYS

N-CA-CB-CG

CG cis to N

[-180, 180)

MET

N-CA-CB-CG

CG cis to N

[-180, 180)

PHE

N-CA-CB-CG

CG cis to N

[-180, 180)

PRO

N-CA-CB-CG

CG cis to N

CA-CB is part of ring

SER

N-CA-CB-OG

OG cis to N

[-180, 180)

THR

N-CA-CB-OG1

OG1 cis to N

[-180, 180)

TRP

N-CA-CB-CG

CG cis to N

[-180, 180)

TYR

N-CA-CB-CG

CG cis to N

[-180, 180)

VAL

N-CA-CB-CG1

CG1 cis to N

[-180, 180)

\(\chi_{2}\) (chi2)#

Residue

Atoms

Zero value

Range (degrees)

ARG

CA-CB-CG-CD

CD cis to CA

[-180, 180)

ASN

CA-CB-CG-OD1

OD1 cis to CA

[-180, 180)

ASP

CA-CB-CG-OD

OD1 cis to CA

[-180, 180)

GLN

CA-CB-CG-CD

CD cis to CA

[-180, 180)

GLU

CA-CB-CG-CD

CD cis to CA

[-180, 180)

HIS

CA-CB-CG-ND1

ND1 cis to CA

[-180, 180)

ILE

CA-CB-CG1-CD

CD cis to CA

[-180, 180)

LEU

CA-CB-CG-CD1

CD1 cis to CA

[-180, 180)

LYS

CA-CB-CG-CD

CD cis to CA

[-180, 180)

MET

CA-CB-CG-SD

SD cis to CA

[-180, 180)

PHE

CA-CB-CG-CD

CD1 cis to CA

[-180, 180)

PRO

CA-CB-CG-CD

CD cis to CA

CB-CG is part of ring

TRP

CA-CB-CG-CD1

CD1 cis to CA

[-180, 180)

TYR

CA-CB-CG-CD1

CD1 cis to CA

[-180, 180)

\(\chi_{3}\) (chi3)#

Residue

Atoms

Zero value

Range (degrees)

ARG

CB-CG-CD-NE

NE cis to CB

[-180, 180)

GLN

CB-CG-CD-OE1

OE1 cis to CB

[-180, 180)

GLU

CB-CG-CD-OE1

OE1 cis to CB

[-180, 180)

LYS

CB-CG-CD-CE

CE cis to CB

[-180, 180)

MET

CB-CG-SD-CE

CE cis to CB

[-180, 180)

\(\chi_{4}\) (chi4)#

Residue

Atoms

Zero value

Range (degrees)

ARG

CG-CD-NE-CZ

CZ cis to CG

[-180, 180)

LYS

CG-CD-CE-NZ

NZ cis to CG

[-180, 180)

\(\chi_{5}\) (chi5)#

Residue

Atoms

Zero value

Range (degrees)

ARG

CD-NE-CZ-NH1

NH1 cis to CD

[-180, 180)

Every dihedral angle is defined in a peptide by three vectors delimited by four consecutive covalently bonded atoms. The vector in the middle defines the orthogonal plane where rotations are defined by the projection of vectors first and third, this way two blocks of atoms change its relative positions: all atoms covalently bonded before and after the second vector in the polymer. Or explained in other words, removing the second vector two sets of covalently bonded atoms are defined. Each of these two atoms sets move in unison when the dihedral angle changes. MolSysMT includes the input argument with_blocks for the method molsysmt.covalent_dihedral_quartets to return these atoms sets together with the quartets. Lets see how it works with an example:

molecular_system = msm.convert(msm.systems['Met-enkephalin']['met_enkephalin.h5msm'], to_form='molsysmt.MolSys')
phi_chains, phi_blocks = msm.topology.get_dihedral_quartets(molecular_system, with_blocks=True, phi=True)

Lets for instance have a look to the quartet defining the 3-th \(\phi\) angle:

view = msm.view(molecular_system, viewer='NGLView')
selection_quartet = msm.select(molecular_system, selection=phi_chains[2], to_syntax='NGLView')
view.clear()
view.add_licorice(color='white')
view.add_ball_and_stick(selection_quartet, color='orange')
view
phi_chains[2]
array([33, 35, 37, 53])
phi_blocks[2]
array([{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36},
       {37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71}],
      dtype=object)

Lets show in blue and red the two blocks of atoms defined by this 4-th \(\phi\) dihedral angle.

view = msm.view(molecular_system, viewer='NGLView')
view.clear()
selection_quartet = msm.select(molecular_system, selection=phi_chains[2], to_syntax='NGLView')
selection_block_0 = msm.select(molecular_system, selection=list(phi_blocks[2][0]), to_syntax='NGLView')
selection_block_1 = msm.select(molecular_system, selection=list(phi_blocks[2][1]), to_syntax='NGLView')
view.add_licorice(color='white')
view.add_ball_and_stick(selection_quartet, color='orange')
view.add_ball_and_stick(selection_block_0, color='red')
view.add_ball_and_stick(selection_block_1, color='blue')
view