molecule

Python operations available from the molecule module, used to
load molecules and change their representations.

num():
Returns the number of loaded molecules.

listall():
Returns the molid's of the all the loaded molecules.

exists(molid):
Returns true if the molid corresponds to an existing molecule.

new(name):
Creates a new empty molecule with the given name and returns its id.

load(structure, sfname, coor, cfname):
Load a molecule with structure type structure and filename
sfname. Additionally, a separate coordinate file may be
provided, of type coor and name cfname. New in VMD
1.8: All frames from cfname will be processed before the
function returns. If successful, the function will return the
id of the new molecule.

load('pdb','alanin.'pdb')

load('psf','alanin.psf','dcd','alanin.dcd')

cancel(molid):
Cancel loading of coordinates file for the given molecule.

write(molid, type, filename, beg = 0, end = -1, skip = 1, waitfor = 1):
Read or write a file to/from the specified molecule. For reading,
if molid is -1, a new molecule will be created. Optional
arguments beg, end, and skip may be specified with keywords;
the default is to load/save all coordinate frames. New in VMD 1.8: The waitfor option will cause VMD to process the specified number of frames
before returning. If waitfor is negative, all frames from the file will
be processed before the function returns. For reading files containing
volumetric datasets, set the volsets parameter to a list of set id's,
starting from 0, to specify which datasets to load.

add_volumetric(molid, name, origin, xaxis, yaxis, zaxis,
xsize, ysize, zsize, data):
Add a volumetric data set to the given molecule. origin, xaxis,
yaxis, and zaxis must be 3-tuples specifying the center and scale
of the data. xsize, ysize and zsize give the number of
elements along each dimension. data must be a Python list of the correct
size as indicated by the three sizes.

get_filenames(molid):
Returns a list of filenames that have been loaded into this molecule.

get_filetypes(molid):
Returns a list of filetypes corresponding to get_filenames.

get_databases(molid):
Returns a list of databases corresponding to get_filenames.

get_accessions(molid):
Returns a list of accessiosn corresponding to get_filenames.

get_remarks(molid):
Returns a list of remarks corresponding to get_filenames.

delframe(molid, beg=0, end=-1, skip=1):
Delete frames from the specified molecule. Optional
arguments beg, end, and skip may be specified with keywords;
the default is to delete all coordinate frames.

dupframe(molid, frame):
Copy the coordinates from the given frame and append them as a new
frame.

numframes(molid):
Return the number of coordinate frames in the specified molecule.

get_frame(molid):
Return the current coordinate frame for the specified molecule.

set_frame(molid, frame):
Set the current coordinate frames in the specified molecule.

numatoms(molid):
Returns the number of atoms in the specified molecule.

ssrecalc(molid):
Recalculate the secondary structure for the given molecule, using
the current set of coordinates.