BALL::FragmentDB Class Reference
[Miscellaneous]
#include <BALL/STRUCTURE/fragmentDB.h>
List of all members.
Classes |
class | BuildBondsProcessor |
class | NoFragmentNode |
class | NormalizeNamesProcessor |
Public Types |
|
|
enum | FragmentTypes { TYPE__UNKNOWN = -1,
TYPE__FRAGMENT,
TYPE__RESIDUE,
TYPE__MOLECULE
} |
|
|
typedef short | Type |
typedef StringHashMap< String > | NameMap |
Public Member Functions |
|
|
| FragmentDB () |
| FragmentDB (const String &filename) throw (Exception::FileNotFound) |
| FragmentDB (const FragmentDB &db, bool deep=true) |
FragmentDB & | operator= (const FragmentDB &db) |
| Assignment operator.
|
virtual | ~FragmentDB () |
void | destroy () |
|
|
void | init () throw (Exception::FileNotFound, NoFragmentNode) |
|
|
void | setFilename (const String &filename) throw (Exception::FileNotFound) |
const String & | getFilename () const |
bool | has (const String &fragment_name) const |
const std::vector< Residue * > & | getFragments () |
FragmentDB::Type | getFragmentType (const String &fragment_name) const |
list< String > | getVariantNames (const String &name) const |
const Fragment * | getFragment (const String &fragment_name) const |
const Fragment * | getReferenceFragment (const Fragment &fragment) const |
const Residue * | getResidue (const String &fragment_name) const |
Fragment * | getFragmentCopy (const String &fragment_name) const |
Molecule * | getMoleculeCopy (const String &fragment_name) const |
Residue * | getResidueCopy (const String &fragment_name) const |
const String & | getDefaultNamingStandard () const |
StringHashMap< NameMap > & | getNamingStandards () |
const StringHashMap< String > & | getNamingStandard (const String &std) const throw (StringHashMap<String>::IllegalKey) |
std::vector< String > | getAvailableNamingStandards () const |
|
|
bool | isValid () const |
Public Attributes |
|
|
NormalizeNamesProcessor | normalize_names |
ReconstructFragmentProcessor | add_hydrogens |
BuildBondsProcessor | build_bonds |
ResourceEntry * | tree |
Private Member Functions |
void | parseAtoms_ (ResourceEntry &entry, Fragment &fragment) |
void | parseBonds_ (ResourceEntry &entry, Fragment &fragment) |
void | parseProperties_ (ResourceEntry &entry, PropertyManager &property_man) |
void | parseDelete_ (ResourceEntry &entry, Fragment &fragment) |
void | parseRename_ (ResourceEntry &entry, Fragment &fragment) |
Position | addNewFragment_ (Residue *fragment) |
void | expandTree_ (ResourceEntry &root_entry) |
bool | expandFirst_ (ResourceEntry &root_entry) throw (Exception::FileNotFound) |
Private Attributes |
bool | valid_ |
String | filename_ |
String | default_standard_ |
std::vector< Residue * > | fragments_ |
NameMap | name_to_path_ |
StringHashMap< Position > | name_to_frag_index_ |
StringHashMap< list< Position > > | name_to_variants_ |
StringHashMap< NameMap > | standards_ |
Friends |
class | FragmentDB::AddHydrogensProcessor |
Detailed Description
FragmentDB - fragment database class. 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.
Member Typedef Documentation
A hash map used to convert one atom naming convention to another
Type definition for the fragment type
Member Enumeration Documentation
Fragment types
- Enumerator:
TYPE__UNKNOWN |
|
TYPE__FRAGMENT |
|
TYPE__RESIDUE |
|
TYPE__MOLECULE |
|
Constructor & Destructor Documentation
BALL::FragmentDB::FragmentDB |
( |
|
) |
|
Creates a default but invalid FragmentDB instance.
Creates a FragmentDB object and reads the contents of filename
. If filename is an empty string, the default value "fragments/Fragments.db" is used.
- Exceptions:
-
BALL::FragmentDB::FragmentDB |
( |
const FragmentDB & |
db, |
|
|
bool |
deep = true | |
|
) |
| | |
virtual BALL::FragmentDB::~FragmentDB |
( |
|
) |
[virtual] |
Member Function Documentation
Position BALL::FragmentDB::addNewFragment_ |
( |
Residue * |
fragment |
) |
[private] |
Add a new fragment pointer to the database (while parsing)
void BALL::FragmentDB::destroy |
( |
|
) |
|
void BALL::FragmentDB::expandTree_ |
( |
ResourceEntry & |
root_entry |
) |
[private] |
std::vector<String> BALL::FragmentDB::getAvailableNamingStandards |
( |
|
) |
const |
Return a vector of available naming standards
const String& BALL::FragmentDB::getDefaultNamingStandard |
( |
|
) |
const |
Return the default naming standard
const String& BALL::FragmentDB::getFilename |
( |
|
) |
const |
const Fragment* BALL::FragmentDB::getFragment |
( |
const String & |
fragment_name |
) |
const |
Fragment* BALL::FragmentDB::getFragmentCopy |
( |
const String & |
fragment_name |
) |
const |
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.
- Returns:
- a pointer to the copied fragment or 0
- Parameters:
-
| fragent_name | the name of the fragment in the database |
const std::vector<Residue*>& BALL::FragmentDB::getFragments |
( |
|
) |
[inline] |
Molecule* BALL::FragmentDB::getMoleculeCopy |
( |
const String & |
fragment_name |
) |
const |
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.
- Returns:
- a pointer to the copied fragment or 0
- Parameters:
-
| fragent_name | the name of the fragment in the database |
Return the naming standard given by std
- Returns:
- A StringHashMap that maps atom names to atom names
- Exceptions:
-
| StringHashMap<String>::IllegalKey | if std is not a valid naming standard |
Return a hash map containing all naming maps.
const Fragment* BALL::FragmentDB::getReferenceFragment |
( |
const Fragment & |
fragment |
) |
const |
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
.
const Residue* BALL::FragmentDB::getResidue |
( |
const String & |
fragment_name |
) |
const |
Residue* BALL::FragmentDB::getResidueCopy |
( |
const String & |
fragment_name |
) |
const |
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.
- Returns:
- a pointer to the copied fragment or 0
- Parameters:
-
| fragent_name | the name of the fragment in the database |
list<String> BALL::FragmentDB::getVariantNames |
( |
const String & |
name |
) |
const |
Return a list containing all variant names.
bool BALL::FragmentDB::has |
( |
const String & |
fragment_name |
) |
const |
Checks whether a specified fragment is known to the fragment database.
Initialization of the database.
bool BALL::FragmentDB::isValid |
( |
|
) |
const |
Friends And Related Function Documentation
friend class FragmentDB::AddHydrogensProcessor [friend] |
Member Data Documentation
The standard hydrogen adder
The standard bond builder
The standard name normalization processor
The resource tree read from the database file