Get form#

Identifying the form of a molecular system.

A single molecular system can be represented in different forms, such as a file, a string ID, or a Python object. These forms can be converted between one another depending on the attributes needed and the steps of a workflow. The form of a molecular system can be obtained with the function molsysmt.basic.get_form().

Added in version 1.0.0.

Basic usage#

Let’s show how this function works using different representations of molecular systems:

import molsysmt as msm
molsys = '181L'
msm.get_form(molsys)
'string:pdb_id'

Let’s try with other forms of this and other molecular systems:

molsys_B = msm.convert(molsys, to_form='openmm.Modeller')
msm.get_form(molsys_B)
'openmm.Modeller'
msm.get_form('AceAlaValTyrNme')
'string:amino_acids_3'
molsys = msm.systems['pentalanine']['pentalanine.inpcrd']
msm.get_form(molsys)
'file:inpcrd'
import numpy as np
molsys = np.zeros(shape=[10,4,3])*msm.pyunitwizard.unit('angstroms')
msm.get_form(molsys)
'XYZ'
molsys = ('HETATM 3274  C1  BEN A 302      -9.410  30.002  12.405  1.00 61.32           C  \n'
          'HETATM 3275  C2  BEN A 302     -10.677  29.482  12.626  1.00 58.40           C  \n'
          'HETATM 3276  C3  BEN A 302     -10.836  28.180  13.091  1.00 49.12           C  \n'
          'HETATM 3277  C4  BEN A 302      -9.725  27.387  13.331  1.00 56.99           C  \n'
          'HETATM 3278  C5  BEN A 302      -8.454  27.906  13.109  1.00 53.41           C  \n'
          'HETATM 3279  C6  BEN A 302      -8.298  29.207  12.650  1.00 55.79           C  \n'
          'HETATM 3280  C   BEN A 302      -9.255  31.315  11.933  1.00 63.37           C  \n'
          'HETATM 3281  N1  BEN A 302      -8.925  31.552  10.675  1.00 73.79           N  \n'
          'HETATM 3282  N2  BEN A 302      -9.382  32.348  12.740  1.00 62.54           N  ')

msm.get_form(molsys)
'string:pdb_text'
view = msm.view(molsys)
msm.get_form(view)
'molsysviewer.MolSysView'