BALL  1.4.79
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Classes | Protected Member Functions | Protected Attributes | List of all members
BALL::Peptides::NameConverter Class Reference

This class provides conversion of atom names between naming schemata. More...

#include <BALL/STRUCTURE/peptides.h>

Inheritance diagram for BALL::Peptides::NameConverter:
BALL::Embeddable

Classes

struct  Default
 Default values for options. More...
 
struct  Option
 Option names. More...
 

Public Attributes

Public Attributes
Options options
 options More...
 

Protected Member Functions

void readConversionTable_ () throw (Exception::FileNotFound())
 
void readPseudoAtomsConversionTable_ () throw (Exception::FileNotFound())
 

Protected Attributes

std::vector< Stringconventions_
 
std::vector< std::vector
< String > > 
conversion_table_
 
std::vector< Stringpseudo_conventions_
 
std::vector< std::vector
< std::vector< String > > > 
pseudo_conversion_table_
 

Constant Definitions

static const String VALUE_NA
 
 NameConverter ()
 
virtual ~NameConverter ()
 Destructor. More...
 
void setDefaultOptions ()
 
bool supportsNamingScheme (const String &scheme_name) const
 
bool supportsPseudoAtomNamingScheme (const String &scheme_name) const
 
String convertName (const String &amino_acid, const String &old_atom_name, const String &old_naming_scheme, const String &new_naming_scheme) const
 
bool matches (const String &amino_acid, const String &old_atom_name, const String &old_naming_scheme, const String &new_atom_name, const String &new_naming_scheme) const
 
std::vector< StringresolvePseudoAtoms (const String &amino_acid, const String &atom_name, const String &old_naming_scheme, const String &new_naming_scheme) const
 

Additional Inherited Members

- Public Types inherited from BALL::Embeddable
typedef std::vector< Embeddable * > EmbeddableVector
 
- Public Member Functions inherited from BALL::Embeddable
virtual void dump (std::ostream &s=std::cout, Size depth=0) const
 
 Embeddable (const String &identifier="<Embeddable>")
 
 Embeddable (const Embeddable &embeddable)
 
virtual ~Embeddable ()
 
void setIdentifier (const String &identifier)
 
const StringgetIdentifier () const
 
void unregisterThis ()
 
virtual void registerThis ()
 
- Static Protected Member Functions inherited from BALL::Embeddable
static void registerInstance_ (const std::type_info &type, const Embeddable *instance)
 
static void unregisterInstance_ (const Embeddable *instance)
 
static Size countInstances_ (const std::type_info &type)
 
static EmbeddablegetInstance_ (const std::type_info &type, Position index)
 
static EmbeddablegetInstance_ (const std::type_info &type, const String &identifier)
 

Detailed Description

This class provides conversion of atom names between naming schemata.

Name Converter class.

Converts hydrogen atom names between naming systems. The original version of this table was created by Charles Hoogstraten. The default ini file allows conversion between BMRB, SC, PDB, UCSF, MSI, XPLOR, SYBYL*, MIDAS*, and DIANA.

If no new atom name can be found the old name is returned.


Example code:

NameConverter converter();
if ( converter.supportsNamingScheme("BMRB")
&& converter.supportsNamingScheme("PDB"))
{
...
String atom_name = "HB2";
String pdb_name = converter.convertName("ALA", atom_name, "BMRB", "PDB");
...
}
if ( converter.supportsPseudoAtomNamingScheme("NMRSTAR")
&& converter.supportsPseudoAtomNamingScheme("PDB"))
{
std::vector<String> result = converter.resolvePseudoAtoms("R", "HB", "NMRSTAR", "PDB");
cout << "pseudo atom HB of residue R can be matched to " << result.size() << " PDB atoms." << endl;
Atom* atom = ...;
if (converter.matches(atom->getResidue()->getName(), atom->getName(), "PDB", "HG2", "NMRSTAR"))
{
cout << "atom " << atom->getName() << " is a HG2 pseudo atom." << endl;
}
}

Definition at line 150 of file peptides.h.

Constructor & Destructor Documentation

BALL::Peptides::NameConverter::NameConverter ( )

Standard constructor

virtual BALL::Peptides::NameConverter::~NameConverter ( )
inlinevirtual

Destructor.

Definition at line 187 of file peptides.h.

Member Function Documentation

String BALL::Peptides::NameConverter::convertName ( const String amino_acid,
const String old_atom_name,
const String old_naming_scheme,
const String new_naming_scheme 
) const

Convert atom name between two naming schemes.

If one of the naming schemes is unknown, or the name was not found, the old name is returned.

Returns
String - the converted name.
bool BALL::Peptides::NameConverter::matches ( const String amino_acid,
const String old_atom_name,
const String old_naming_scheme,
const String new_atom_name,
const String new_naming_scheme 
) const

Test whether two names for an atom are equivalent in different naming schemes.

The match can either be according the the conversion as defined in the INIFile or one atom is a pseudo atom and matches the other one according the PSEUDO_ATOMS_INIFile .

Returns
bool - true if the atom names can be matched, false otherwise.
void BALL::Peptides::NameConverter::readConversionTable_ ( )
throw (Exception::FileNotFound(
)
protected

Read the Conversion table from file.

void BALL::Peptides::NameConverter::readPseudoAtomsConversionTable_ ( )
throw (Exception::FileNotFound(
)
protected

Read the pseudo atoms conversion table from file.

std::vector<String> BALL::Peptides::NameConverter::resolvePseudoAtoms ( const String amino_acid,
const String atom_name,
const String old_naming_scheme,
const String new_naming_scheme 
) const

Resolve pseudo atoms among naming schemes.

If the input is a pseudo atom in the given naming scheme, convert it into the list of atoms in the desired naming scheme.

Parameters
amino_acidthe amino acid type of the atom
atom_namethe atom name to test
old_naming_schemethe naming scheme of the input
new_naming_schemethe desired naming scheme
Returns
const std::vector<String>& - the list of atoms this atom resolves to
void BALL::Peptides::NameConverter::setDefaultOptions ( )

Reset the options to default values.

bool BALL::Peptides::NameConverter::supportsNamingScheme ( const String scheme_name) const

Determine whether the Converter supports the naming scheme scheme_name.

Parameters
scheme_namenaming scheme in question
Returns
bool - true if the naming scheme is supported, false otherwise
bool BALL::Peptides::NameConverter::supportsPseudoAtomNamingScheme ( const String scheme_name) const

Determine whether the Converter supports the naming scheme scheme_name for pseudo atoms.

Parameters
scheme_namenaming scheme in question
Returns
bool - true if the naming scheme is supported, false otherwise

Member Data Documentation

std::vector<String> BALL::Peptides::NameConverter::conventions_
protected

Definition at line 263 of file peptides.h.

std::vector< std::vector <String> > BALL::Peptides::NameConverter::conversion_table_
protected

Definition at line 264 of file peptides.h.

Options BALL::Peptides::NameConverter::options

options

Definition at line 248 of file peptides.h.

std::vector<String> BALL::Peptides::NameConverter::pseudo_conventions_
protected

Definition at line 266 of file peptides.h.

std::vector< std::vector <std::vector <String> > > BALL::Peptides::NameConverter::pseudo_conversion_table_
protected

Definition at line 267 of file peptides.h.

const String BALL::Peptides::NameConverter::VALUE_NA
static

Definition at line 160 of file peptides.h.