#include <fragmentDB.h>
Classes |
|
class | BuildBondsProcessor |
Bond
creation processor.
More... |
|
class | NoFragmentNode |
No fragment node found. More... |
|
class | NormalizeNamesProcessor |
Name normalization processor.
More... |
|
Public Types |
|
Enums
|
|
enum | FragmentTypes { TYPE__UNKNOWN = -1, TYPE__FRAGMENT, TYPE__RESIDUE, TYPE__MOLECULE } |
Fragment types. |
|
Type Definitions
|
|
typedef short | Type |
Type definition for the fragment
type. |
|
typedef StringHashMap< String > | NameMap |
A hash map used to convert one atom
naming convention to another. |
|
Public Member Functions |
|
Constructors and destructors
|
|
FragmentDB () | |
Creates a default but invalid
FragmentDB
instance. |
|
FragmentDB (const String &filename) throw (Exception::FileNotFound) | |
Creates a FragmentDB
object and reads the contents of filename .
|
|
FragmentDB (const FragmentDB &db, bool deep=true) | |
Copy constructor. |
|
FragmentDB & | operator= (const FragmentDB &db) |
Assignment operator. |
|
virtual | ~FragmentDB () |
Destructor. |
|
void | destroy () |
Database Setup
|
|
void | init () throw (Exception::FileNotFound, NoFragmentNode) |
Initialization of the
database. |
|
Inspectors and mutators
|
|
void | setFilename (const String &filename) throw (Exception::FileNotFound) |
Assigns a filename. |
|
const String & | getFilename () const |
Get the filename. |
|
bool | has (const String &fragment_name) const |
Checks whether a specified fragment
is known to the fragment database. |
|
const std::vector< Residue * > & | getFragments () |
FragmentDB::Type | getFragmentType (const String &fragment_name) const |
Return a fragment. |
|
list< String > | getVariantNames (const String &name) const |
Return a list containing all variant
names. |
|
const Fragment * | getFragment (const String &fragment_name) const |
Return a fragment. |
|
const Fragment * | getReferenceFragment (const Fragment &fragment) const |
Return a reference fragment.
|
|
const Residue * | getResidue (const String &fragment_name) const |
Return a residue. |
|
Fragment * | getFragmentCopy (const String &fragment_name) const |
Return a copy of a fragment.
|
|
Molecule * | getMoleculeCopy (const String &fragment_name) const |
Return a copy of a fragment as a
molecule. |
|
Residue * | getResidueCopy (const String &fragment_name) const |
Return a copy of a residue. |
|
const String & | getDefaultNamingStandard () const |
Return the default naming
standard. |
|
StringHashMap< NameMap > & | getNamingStandards () |
Return a hash map containing all
naming maps. |
|
const StringHashMap< String > & | getNamingStandard (const String &std) const throw (StringHashMap<String>::IllegalKey) |
Return the naming standard given by
std. |
|
std::vector< String > | getAvailableNamingStandards () const |
Return a vector of available naming
standards. |
|
Debugging and diagnostics
|
|
bool | isValid () const |
Public Attributes |
|
Public Variables
|
|
NormalizeNamesProcessor | normalize_names |
The standard name normalization
processor. |
|
ReconstructFragmentProcessor | add_hydrogens |
The standard hydrogen
adder. |
|
BuildBondsProcessor | build_bonds |
The standard bond
builder. |
|
ResourceEntry * | tree |
The resource tree read from the
database file. |
|
Friends |
|
class | FragmentDB::AddHydrogensProcessor |
The fragment database is used to store commonly used subunits as amino acids, sugars and the like. They are entered in a special format described below. The main resource file resides under data/fragments/Fragments.db.
BALL::FragmentDB::FragmentDB | ( | const String & | filename | ) | throw (Exception::FileNotFound) |
Creates a FragmentDB
object and reads the contents of filename
.
If filename is an empty string, the default value "fragments/Fragments.db" is used.
Exception::FileNotFound | if the file is not found in the BALL_DATA_PATH |
Return a copy of a fragment.
If a fragment with name fragment_name
exists in the fragment database, a copy is created and
returned. Otherwise, a null pointer is returned. Take care
to destruct the copy again to avoid memory leaks.
fragent_name | the name of the fragment in the database |
Return a copy of a fragment as a molecule.
If a fragment with name fragment_name
exists in the fragment database, a copy is created,
inserted into a new molecule, and returned. Otherwise, a
null pointer is returned. Take care to destruct the copy
again to avoid memory leaks.
fragent_name | the name of the fragment in the database |
const StringHashMap<String>& BALL::FragmentDB::getNamingStandard | ( | const String & | std | ) | const throw (StringHashMap<String>::IllegalKey) |
Return the naming standard given by std.
StringHashMap<String>::IllegalKey | if std is not a valid naming standard |
Return a reference fragment.
This method returns a standard template of a given
fragment or a NULL pointer if the fragment is not known.
The first criterion is the fragment name. If there exist
multiple variants of the fragment, the correct variant is
chosen according to the properties set in
fragment
.
Return a copy of a residue.
If a fragment with name fragment_name
exists in the fragment database, a copy is created and
returned as a residue. Otherwise, a null pointer is
returned. Take care to destruct the copy again to avoid
memory leaks.
fragent_name | the name of the fragment in the database |