Endonuclease PvuII (1PVI) DNA - GATTACAGATTACA
CAP - Catabolite gene Activating Protein (1BER)
DNA - GATTACAGATTACAGATTACA Endonuclease PvuII bound to palindromic DNA recognition site CAGCTG (1PVI) DNA - GATTACAGATTACAGATTACA TBP - TATA box Binding Protein (1C9B)
CAP - Catabolite gene Activating Protein (1BER)
GCN4 - leucine zipper transcription factor bound to palindromic DNA recognition site ATGAC(G)TCAT (1YSA)
GCN4 - leucine zipper transcription factor bound to palindromic DNA recognition site ATGAC(G)TCAT (1YSA)
GCN4 - leucine zipper transcription factor bound to palindromic DNA recognition site ATGAC(G)TCAT (1YSA)
GCN4 - leucine zipper transcription factor bound to palindromic DNA recognition site ATGAC(G)TCAT (1YSA)
GCN4 - leucine zipper transcription factor bound to palindromic DNA recognition site ATGAC(G)TCAT (1YSA)
TBP - TATA box Binding Protein (1C9B)
 

° 

A subset of the YASARA soup can be obtained as a pdb_file instance

YASARA comes with a Python PDB file interface that can be found at yasara/plg/pdb_file.py. In addition, you can easily obtain any part of the YASARA soup as an instance of such a PDB file interface. This means that you can use the same piece of Python code to analyze a PDB file loaded from disk and the YASARA soup.

The following examples list all Calpha atoms in the PDB file 1crn.pdb:

  • Using the Python PDB file interface without YASARA:


import pdb_file

pdb=pdb_file.interface("1crn.pdb")
for i in range(pdb.atoms):
  if (pdb.atom[i].name=="CA"): print pdb.atom[i]

  • Using the YASARA Python module:


from yasara import *

LoadPDB("1crn")
pdb=Atom("CA")
print pdb

The instance 'pdb' stores the data in the following way:

Instance.crdsys
1 if the atom coordinates use a left-handed system (YASARA's default), and -1 otherwise (PDB file default).
Instance.atoms
the number of atoms
Instance.atom[i]
the ith atom
Instance.atom[i].element
the chemical element number of the ith atom
Instance.atom[i].name
the name of the ith atom with spaces stripped
Instance.atom[i].name4
the name of the ith atom as present in the PDB file, with all spaces
Instance.atom[i].num
the YASARA number of the ith atom (only present in the YASARA Python module)
Instance.atom[i].altloc
the alternate location indicator of the ith atom, None if empty
Instance.atom[i].pos.x/.y/.z
the position of the ith atom
Instance.atom[i].pos.c[j]
the jth 'c'omponent of the position vector of atom i
Instance.atom[i].occupancy
the occupancy of the ith atom
Instance.atom[i].bfactor
the B-factor of the ith atom
Instance.atom[i].resname
the name of the residue the ith atom belongs to
Instance.atom[i].resnum
the number of the residue the ith atom belongs to
Instance.atom[i].molname
the name of the molecule the ith atom belongs to
Instance.atom[i].segname
the name of the segment the ith atom belongs to
Instance.residues
the number of residues
Instance.residue[i]
the ith residue
Instance.residue[i].name
the name of the ith residue
Instance.residue[i].num
the number of the ith residue
Instance.residue[i].atoms
the number of atoms in the ith residue
Instance.residue[i].atom[j]
the jth atom in the ith residue with properties described above
Instance.residue[i].atomnamed["X"]
atom with name "X" in the ith residue with properties described above
Instance.molecules
the number of molecules (=chains)
Instance.molecule[i]
the ith molecule (=chain)
Instance.molecule[i].atoms
the number of atoms in the ith molecule
Instance.molecule[i].atom[j]
the jth atom in the ith molecule with properties described above
Instance.molecule[i].residues
the number of residues in the ith molecule
Instance.molecule[i].residue[j]
the jth residue in the ith molecule with properties described above
Instance.objects
the number of objects (=NMR MODELs)
Instance.object[i]
the ith object
Instance.object[i].name
the YASARA name of the ith object (only present in the YASARA Python module)
Instance.object[i].num
the YASARA number of the ith object (only present in the YASARA Python module)
Instance.object[i].atoms
the number of atoms in the ith object
Instance.object[i].atom[j]
the jth atom in the ith object with properties described above
Instance.object[i].residues
the number of residues in the ith object
Instance.object[i].residue[j]
the jth residue in the ith object with properties described above
Instance.object[i].molecules
the number of molecules in the ith object
Instance.object[i].molecule[j]
the jth molecule in the ith object with properties described above
Instance.object[i].molnamed["X"]
the molecule named "X" in the ith object with properties described above

The following data are currently only available if you use pdb_file.interface to create the instance:
Instance.cell
information about the unit cell
Instance.cell.x/.y/.z
the cell dimensions
Instance.cell.alpha/.beta/.gamma
the cell angles
Instance.cell/.spacegroup/.z
the remaining cell parameters
Instance.resolution
the X-ray resolution

The YASARA Python module provides five commands to extract selected portions of the YASARA soup as a PDB file instance: Atom, Residue , Molecule, Object and All. The first four take a selection as the only argument:


from yasara import *

# Load PDB file 5tim
LoadPDB("5tim")

# Get all atoms in molecule A that contact molecule B
contact=Atom("Mol A with distance<5 from Mol B")
print "There are %d contacts:"%contact.atoms
print contact

# Get all Arg residues that form a salt-bridge with Asp or Glu
bridge=Residue("Arg Atom NH? with distance<3.5 from Asp Glu Atom OD? OE?")
print "There are %d salt-bridged arginines"%bridge.residues
for i in range(bridge.residues):
  print bridge.residue[i].name,bridge.residue[i].num

# Get the protein molecules
protein=Molecule("Protein")
print "There are %d protein molecules containing %d atoms"%(protein.molecules,protein.atoms)

# Clear the YASARA soup and load an NMR structure bundle
Clear()
LoadPDB("3gb1")

# Get the first model (each model is stored in a separate object)
first=Object(1)
print "The first model contains %d atoms, %d residues and %d molecules"%(first.atoms,first.residues,first.molecules)

# Get the entire soup
soup=All()
print "The bundle contains %d models"%soup.objects