You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This section highlights basic usage from reading in atomic information from a protein data bank (PDB) file, extracting information from the molecule, performing simple operations on the molecule and how to save the new coordinates to a new PDB file
Import sasmol library
importsasmol.systemassystem
Define "molecule" an instance of the Molecule class. This is the "object" that will hold all information for the molecule
molecule=system.Molecule()
Read the contents of a PDB file into the molecule
molecule.read_pdb('hiv1_gag.pdb')
reading filename: hiv1_gag.pdb
num_atoms = 6730
>>> found 1 model(s) or frame(s)
finished reading frame = 1
Query the number of atoms
molecule.natoms()
6730
Determine the center of mass of the molecule for frame = 0
molecule.calculate_center_of_mass(0)
array([ -6.79114736, -23.71577133, 8.06558513])
Set the center of mass to [0, 0, 0] for frame = 0
molecule.center(0)
Check that the center of mass is indeed now at [0, 0, 0]