AmberResidueLibrary

class biskit.AmberResidueLibrary(topofiles=['all_amino03.in', 'all_aminoct03.in', 'all_aminont03.in', 'all_nuc02.in'], log=None, verbose=False)[source]

Bases: object

A collection of reference residue types taken from Amber topology files. By default, the collection is initialized from the four all-atom library or “off files” in Biskit/data/amber/residues. The idea here is that the residues of some PDB structure can be matched against this library in order to assign charges or other properties.

Matching residue types are indentified by their ‘atom key’, which is simply the concatenation of a residue’s atom names in alphabetical order. This means residues are matched by atom content, not by residue name. That’s important for modified residues, for example, a C-terminal ALA (with an additional oxygen) will be matched to the AmberResidueType CALA rather than to ALA.

The default all-atom topologies include hydrogen atoms. Structures without hydrogens will not match. You can add hydrogens with the Reduce class (Biskit.reduce).

Atom names need to conform to Amber conventions – this can be ensured with PDBModel.xplor2amber().

>>> model = PDBModel('mystructure.pdb')
>>> residue = model.resModels()[0]
>>>
>>> lib = AmberResidueLibrary()
>>> refres = lib[ residue ]
>>>
>>> ## or alternatively:
>>> refres = lib['all_amino03', 'ALA']

Methods Overview

__init__
param topofiles:
 list of topology file names (default all_*in in Biskit/data/amber/residues) :type topofiles: [ str ] :param log: optional LogFile instance (default STDOUT) :type log: biskit.LogFile :param verbose: add messages to log (default False) :type verbose: bool
addTopology Include an additional topology (off) library in the collection.
atomkey Create a string key encoding the atom content of residue.
byAtoms Identify a matching reference residue by atom content.
byName Identify matching reference residue by residue name.
keys
topokeys
values

Attributes Overview

F_RESTYPES

AmberResidueLibrary Method & Attribute Details

__init__(topofiles=['all_amino03.in', 'all_aminoct03.in', 'all_aminont03.in', 'all_nuc02.in'], log=None, verbose=False)[source]
Parameters:
  • topofiles ([ str ]) – list of topology file names (default all_*in in Biskit/data/amber/residues)
  • log (biskit.LogFile) – optional LogFile instance (default STDOUT)
  • verbose (bool) – add messages to log (default False)
addTopology(topofile, override=False)[source]

Include an additional topology (off) library in the collection.

Parameters:
  • topofile (str) – file name of topology, either full path or simple file name which will then be looked for in Biskit/data/amber/residues.
  • override (False) – override topologies or residue entries with same name (default False)
Returns:

dictionary of all residue types parsed from topofile indexed by three-letter residue name

:rtype : {str : AmberResidueType}

Raise:AmberResidueLibraryError if override==False and a topology or a residue with identical atom content have already been registered.
atomkey(residue)[source]

Create a string key encoding the atom content of residue.

Parameters:residue (PDBModel or AmberResidue) – model or AmberResidue
Returns:key formed from alphabetically sorted atom content of residue
Return type:str
byAtoms(akey, default=None)[source]

Identify a matching reference residue by atom content.

Parameters:akey (str or PDBModel) – atomkey or PDBModel with a single residue
Returns:matching reference residue OR None
Return type:AmberResidueType
byName(rescode, topo=None)[source]

Identify matching reference residue by residue name. Note: residue names are not guaranteed to be unique if several topology files have been read in (the default set of Amber topologies uses unique names though). The optional topo parameter can be used to specify in which topology the residue is looked up.

Note: residue 3 letter names are all UPPERCASE.

Parameters:
  • rescode (str) – three-letter name of residue to look up
  • topo (str) – optional (file) name of topology (see also: topokeys() )
Returns:

matching reference residue

Return type:

AmberResidueType

Raise:

KeyError if the topology or residue name are not found