DSSP

pytraj.analysis.dssp_analysis.dssp(traj=None, mask='', frame_indices=None, dtype='ndarray', simplified=False, top=None)

return dssp profile for frame/traj

Parameters:

traj : Trajectory-like

mask: str

atom mask

frame_indices : {None, array-like}, default None, optional

specify frame numbers for calculation. if None, do all frames

dtype : str, default ‘ndarray’

return data type, for regular user, just use default one (ndarray). use dtype=’dataset’ if wanting to get secondary structure in integer format

simplified : bool, default False

if True, use simplified codes, only has ‘H’, ‘E’ and ‘C’ if False, use all DSSP codes

Returns:

out_0: ndarray, shape=(n_residues,)

residue names

out_1: ndarray, shape=(n_frames, n_residues)

DSSP for each residue

out_2 : pytraj.DatasetList

average value for each secondary structure type

Notes

Character Integer DSSP_Char Secondary structure type
0 0 ‘0’ None
b 1 ‘E’ Parallel Beta-sheet
B 2 ‘B’ Anti-parallel Beta-sheet
G 3 ‘G’ 3-10 helix
H 4 ‘H’ Alpha helix
I 5 ‘I’ Pi (3-14) helix
T 6 ‘T’ Turn
S 7 ‘S’ Bend

Simplified codes:

- 'H': include 'H', 'G', 'I' (helix)
- 'E': include 'E', 'B' (strand)
- 'C': include 'T', 'S' or '0' (coil)

Simplified codes will be mostly used for visualization in other packages.

Examples

>>> import pytraj as pt
>>> traj = pt.load_pdb_rcsb('1l2y')
>>> residues, ss, _ = pt.dssp(traj, ":2-10")
>>> residues 
array(['LEU:2', 'TYR:3', 'ILE:4', 'GLN:5', 'TRP:6', 'LEU:7', 'LYS:8',
       'ASP:9', 'GLY:10'],
      dtype='<U6')
>>> ss 
array([['0', 'H', 'H', ..., 'H', 'T', '0'],
       ['0', 'H', 'H', ..., 'H', 'T', '0'],
       ['0', 'H', 'H', ..., 'H', 'T', '0'],
       ...,
       ['0', 'H', 'H', ..., 'H', 'T', '0'],
       ['0', 'H', 'H', ..., 'H', 'H', '0'],
       ['0', 'H', 'H', ..., 'H', 'T', '0']],
      dtype='<U1')
>>> residues, ss, _ = pt.dssp(traj, mask=range(100))
>>> traj = pt.fetch_pdb('1l2y')
>>> residues, ss, _ = pt.dssp(traj, simplified=True)
>>> ss[0].tolist() # first frame
['C', 'H', 'H', 'H', 'H', 'H', 'H', 'H', 'C', 'C', 'H', 'H', 'H', 'H', 'C', 'C', 'C', 'C', 'C', 'C']
pytraj.analysis.dssp_analysis.dssp_allatoms(traj, *args, **kwd)

calculate dssp for all atoms

Returns:ndarray, shape=(n_frames, n_atoms)

See also

dssp

Notes

this method is not well optimized for speed.

Examples

>>> import pytraj as pt
>>> traj = pt.fetch_pdb('1l2y')
>>> x = pt.dssp_allatoms(traj, simplified=True)
>>> x[0, :3].tolist()
['C', 'C', 'C']
pytraj.analysis.dssp_analysis.dssp_allresidues(traj, *args, **kwd)

calculate dssp for all residues. Mostly used for visualization.

Returns:ndarray, shape=(n_frames, n_residues)

See also

dssp

Notes

this method is not well optimized for speed.

Examples

>>> import pytraj as pt
>>> traj = pt.datafiles.load_dpdp()
>>> x = pt.dssp_allresidues(traj, simplified=True)
>>> x[0].tolist()
['C', 'E', 'E', 'E', 'E', 'C', 'C', 'C', 'C', 'E', 'E', 'E', 'E', 'E', 'C', 'C', 'E', 'E', 'E', 'E', 'C', 'C']
>>> len(x[0]) == traj.top.n_residues
True
>>> # load trajectory having waters
>>> traj = pt.datafiles.load_tz2_ortho()
>>> x = pt.dssp_allresidues(traj, simplified=True)
>>> len(x[0]) == traj.top.n_residues
True
>>> len(x[0])
1704
>>> # only calculate protein residues, use `pytraj.dssp`
>>> y = pt.dssp(traj, simplified=True)
>>> len(y[0])
13