Loading...
Searching...
No Matches
BALL::FragmentDB Class Reference
Molecular Modeling » Molecular Structure » Miscellaneous

`#include <BALL/STRUCTURE/fragmentDB.h>`

## Classes

class | NoFragmentNode
class | NormalizeNamesProcessor
class | BuildBondsProcessor

## Public Types

Enums
enum | FragmentTypes { TYPE__UNKNOWN = -1 , TYPE__FRAGMENT , TYPE__RESIDUE , TYPE__MOLECULE }
Type Definitions
typedef short | Type
typedef StringHashMap< String > | NameMap

## Public Member Functions

Constructors and destructors
| FragmentDB ()
| FragmentDB (const String &filename)
| FragmentDB (const FragmentDB &db, bool deep=true)
FragmentDB & | operator= (const FragmentDB &db)
| Assignment operator.
virtual | ~FragmentDB ()
void | destroy ()
Database Setup
void | init ()
Inspectors and mutators
void | setFilename (const String &filename)
const String & | getFilename () const
bool | has (const String &fragment_name) const
const std::vector< Residue * > & | getFragments () const
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
std::vector< String > | getAvailableNamingStandards () const
Debugging and diagnostics
bool | isValid () const

## Friends

class | FragmentDB::AddHydrogensProcessor

## Public Variables

NormalizeNamesProcessor | normalize_names
ReconstructFragmentProcessor | add_hydrogens
BuildBondsProcessor | build_bonds
ResourceEntry * | tree

## 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.

Definition at line 44 of file fragmentDB.h.

## Member Typedef Documentation

## NameMap

typedef StringHashMap<String> BALL::FragmentDB::NameMap

A hash map used to convert one atom naming convention to another

Definition at line 76 of file fragmentDB.h.

## Type

typedef short BALL::FragmentDB::Type

Type definition for the fragment type

Definition at line 74 of file fragmentDB.h.

## Member Enumeration Documentation

## FragmentTypes

enum BALL::FragmentDB::FragmentTypes

Fragment types

Enumerator
TYPE__UNKNOWN |
TYPE__FRAGMENT |
TYPE__RESIDUE |
TYPE__MOLECULE |

Definition at line 59 of file fragmentDB.h.

## Constructor & Destructor Documentation

## FragmentDB() [1/3]

BALL::FragmentDB::FragmentDB | ( |  | ) |

Creates a default but invalid FragmentDB instance.

## FragmentDB() [2/3]

BALL::FragmentDB::FragmentDB | ( | const String & | filename | ) |

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

  Exception::FileNotFound | if the file is not found in the BALL_DATA_PATH

## FragmentDB() [3/3]

BALL::FragmentDB::FragmentDB | ( | const FragmentDB & | db,
|  | bool | deep = true )

Copy constructor.

## ~FragmentDB()

virtual BALL::FragmentDB::~FragmentDB | ( |  | ) |

virtual

Destructor.

## Member Function Documentation

## destroy()

void BALL::FragmentDB::destroy | ( |  | ) |

## getAvailableNamingStandards()

std::vector< String > BALL::FragmentDB::getAvailableNamingStandards | ( |  | ) | const

Return a vector of available naming standards

## getDefaultNamingStandard()

const String & BALL::FragmentDB::getDefaultNamingStandard | ( |  | ) | const

Return the default naming standard

## getFilename()

const String & BALL::FragmentDB::getFilename | ( |  | ) | const

Get the filename.

## getFragment()

const Fragment * BALL::FragmentDB::getFragment | ( | const String & | fragment_name | ) | const

Return a fragment.

## getFragmentCopy()

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

## getFragments()

const std::vector< Residue * > & BALL::FragmentDB::getFragments | ( |  | ) | const

inline

Definition at line 158 of file fragmentDB.h.

## getFragmentType()

FragmentDB::Type BALL::FragmentDB::getFragmentType | ( | const String & | fragment_name | ) | const

Return a fragment.

## getMoleculeCopy()

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

## getNamingStandard()

const StringHashMap< String > & BALL::FragmentDB::getNamingStandard | ( | const String & | std | ) | const

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

## getNamingStandards()

StringHashMap< NameMap > & BALL::FragmentDB::getNamingStandards | ( |  | ) |

Return a hash map containing all naming maps.

## getReferenceFragment()

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.

## getResidue()

const Residue * BALL::FragmentDB::getResidue | ( | const String & | fragment_name | ) | const

Return a residue.

## getResidueCopy()

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

## getVariantNames()

list< String > BALL::FragmentDB::getVariantNames | ( | const String & | name | ) | const

Return a list containing all variant names.

## has()

bool BALL::FragmentDB::has | ( | const String & | fragment_name | ) | const

Checks whether a specified fragment is known to the fragment database.

## init()

void BALL::FragmentDB::init | ( |  | ) |

Initialization of the database.

Exceptions

  Exception::FileNotFound | if the file is not found in the BALL_DATA_PATH
  Exception::NoFragmentNode | if the FragmentDB file did not contain any node entries

## isValid()

bool BALL::FragmentDB::isValid | ( |  | ) | const

## operator=()

FragmentDB & BALL::FragmentDB::operator= | ( | const FragmentDB & | db | ) |

Assignment operator.

## setFilename()

void BALL::FragmentDB::setFilename | ( | const String & | filename | ) |

Assigns a filename.

Exceptions

  Exception::FileNotFound | if the file is not found in the BALL_DATA_PATH

## Friends And Related Symbol Documentation

## FragmentDB::AddHydrogensProcessor

friend class FragmentDB::AddHydrogensProcessor

friend

Definition at line 49 of file fragmentDB.h.

## Member Data Documentation

## add_hydrogens

ReconstructFragmentProcessor BALL::FragmentDB::add_hydrogens

The standard hydrogen adder

Definition at line 480 of file fragmentDB.h.

## build_bonds

BuildBondsProcessor BALL::FragmentDB::build_bonds

The standard bond builder

Definition at line 484 of file fragmentDB.h.

## normalize_names

NormalizeNamesProcessor BALL::FragmentDB::normalize_names

The standard name normalization processor

Definition at line 476 of file fragmentDB.h.

## tree

ResourceEntry* BALL::FragmentDB::tree

The resource tree read from the database file

Definition at line 488 of file fragmentDB.h.