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().
Hint
Visit the section Items and Forms if you are not familiar with the concept of “form” in MolSysMT.
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.basic.get_form().
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'
Tip
All methods defined in the molsysmt.basic module can also be invoked from the main level of the library. Hence, molsysmt.get_form() is the same function as molsysmt.basic.get_form().
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'
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.
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'
See also
Related Tools & References
Items and Forms: Description of the different data representations (forms) used for molecular systems.
Demo Systems Catalog: Access a collection of predefined molecular systems for testing and demonstration purposes.
Convert: Convert a molecular system into another form or forms with
molsysmt.basic.convert().View: Show a molecular system interactively in 3D with
molsysmt.basic.view().