MTK++ Latest version: 0.2.0

Public Member Functions | Public Attributes | Protected Types | Protected Member Functions | Protected Attributes
MTKpp::mol2Parser Class Reference

Reads and writes MOL2 format files. More...

#include <mtkpp/src/Parsers/mol2Parser.h>

Inheritance diagram for MTKpp::mol2Parser:
Inheritance graph
[legend]
Collaboration diagram for MTKpp::mol2Parser:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 mol2Parser ()
 baseParser Constructor
 ~mol2Parser ()
 baseParser Destructor
void Read (const std::string &i, collection *c)
 Read MOL2 file.
void Read (const std::string &i, molecule *m)
 Read MOL2 file.
void Write (const std::string &o, molecule *m)
 Write MOL2 file.
std::string getChargeType ()
 get charge type
double getTotalCharge ()
 get total charge
bool hasTotalCharge ()
 has total charge
virtual void Read ()
 Read function.
virtual void Write ()
 Write function.
std::ofstream & OpenFile (std::string fileName)
 Write function.
std::string determineElement (std::string &name)
 Preceive element symbol from the atom name.
void setError (int i)
 Error handling within Parsers.
bool getError ()
 Error handling within dcParser.
void setErrorMessage (std::string s)
 Error handling within Parsers.
std::string getErrorMessage ()
 Error handling within Parsers.

Public Attributes

collectionpCol
 collection pointer
moleculepMol
 molecule pointer
submoleculepSmol
 submolecule
atompAtom
 atom pointer
BondpBond
 Bond pointer.
atompBondAtom1
 atom pointer, Used in bonding section
atompBondAtom2
 atom pointer, Used in bonding section
std::string chargeType
 Charge type.
double totalCharge
 Total charge on the chemical specie described by the mol2.
bool hasTotalChargeRemark
 has total charge remark

Protected Types

typedef std::map< std::string,
std::string >::iterator 
nameMapIterator
 residue name map iterator

Protected Member Functions

bool ReadAtomLine (std::string &fileline, AtomLine *pthisAtom)
 Read atom line.
int getAtom (int i)
 Get atom index from map.
std::string get1LCode (std::string s)
 Get the 1-Letter residue code.
void buildupSubmolecule (collection *pCollection, std::string &residueID, unsigned int n, std::vector< AtomLine * > &atomLineVector)
 Asists building the backbone after accumulating the atoms structures as a residue or submolecule set. Adds a submolecule to the current molecule per vector of AtomLine's.

Protected Attributes

std::map< int, int > itsAtomMap
 map used in bonding section of write
std::map< std::string,
std::string > 
res21l
 Residue name to 1 letter code.
std::ofstream outputFileStream
 Output File Stream.
bool bError
 Error occured.
std::string errorMessage
 Error message.
unsigned int NUM_INDENTS_PER_SPACE

Detailed Description

Reads and writes MOL2 format files.

Author:
Martin Peters
Version:
0.1
Date:
2005

Member Typedef Documentation

typedef std::map<std::string, std::string>::iterator MTKpp::mol2Parser::nameMapIterator [protected]

residue name map iterator


Constructor & Destructor Documentation

MTKpp::mol2Parser::mol2Parser ( )

baseParser Constructor

References res21l.

MTKpp::mol2Parser::~mol2Parser ( )

baseParser Destructor


Member Function Documentation

void MTKpp::mol2Parser::Read ( const std::string &  i,
collection c 
)
void MTKpp::mol2Parser::Read ( const std::string &  i,
molecule m 
)
void MTKpp::mol2Parser::Write ( const std::string &  o,
molecule m 
)
std::string MTKpp::mol2Parser::getChargeType ( ) [inline]

get charge type

References chargeType.

double MTKpp::mol2Parser::getTotalCharge ( ) [inline]

get total charge

References totalCharge.

bool MTKpp::mol2Parser::hasTotalCharge ( ) [inline]

has total charge

References hasTotalChargeRemark.

bool MTKpp::mol2Parser::ReadAtomLine ( std::string &  fileline,
AtomLine pthisAtom 
) [protected]
int MTKpp::mol2Parser::getAtom ( int  i) [protected]

Get atom index from map.

Parameters:
iatom index
Returns:
atom index

References itsAtomMap.

std::string MTKpp::mol2Parser::get1LCode ( std::string  s) [protected]

Get the 1-Letter residue code.

Parameters:
s3-Letter code
Returns:
1-Letter code

References res21l.

Referenced by buildupSubmolecule().

void MTKpp::mol2Parser::buildupSubmolecule ( collection pCollection,
std::string &  residueID,
unsigned int  n,
std::vector< AtomLine * > &  atomLineVector 
) [protected]

Asists building the backbone after accumulating the atoms structures as a residue or submolecule set. Adds a submolecule to the current molecule per vector of AtomLine's.

Parameters:
pCollection?
residueID?
n?
atomLineVector?

References MTKpp::submolecule::addAtom(), MTKpp::molecule::addSubMolecule(), get1LCode(), MTKpp::elements::getElement(), pAtom, MTKpp::collection::pElements, pMol, pSmol, MTKpp::submolecule::set1LName(), MTKpp::atom::setCoords(), MTKpp::atom::setElement(), MTKpp::atom::setFileID(), MTKpp::atom::setFormalCharge(), MTKpp::submolecule::setIndex(), MTKpp::molecule::setMaxFileID(), MTKpp::atom::setName(), and MTKpp::submolecule::setName().

Referenced by Read().

void MTKpp::baseParser::Read ( ) [virtual, inherited]

Read function.

Referenced by MTKpp::acParser::Read(), and MTKpp::molParser::Read().

void MTKpp::baseParser::Write ( ) [virtual, inherited]
std::ofstream & MTKpp::baseParser::OpenFile ( std::string  fileName) [inherited]

Write function.

References MTKpp::baseParser::outputFileStream.

Referenced by main().

std::string MTKpp::baseParser::determineElement ( std::string &  name) [inherited]

Preceive element symbol from the atom name.

References MTKpp::GetAlphaChar(), and MTKpp::removeCharacter().

Referenced by MTKpp::pdbParser::Read(), and MTKpp::prepParser::readFragment().

void MTKpp::baseParser::setError ( int  i) [inline, inherited]
bool MTKpp::baseParser::getError ( ) [inline, inherited]

Error handling within dcParser.

Returns:
error

References MTKpp::baseParser::bError.

Referenced by main().

void MTKpp::baseParser::setErrorMessage ( std::string  s) [inline, inherited]
std::string MTKpp::baseParser::getErrorMessage ( ) [inline, inherited]

Error handling within Parsers.

Returns:
error message

References MTKpp::baseParser::errorMessage.

Referenced by main().


Member Data Documentation

collection pointer

molecule pointer

Referenced by buildupSubmolecule(), and Read().

submolecule

Referenced by buildupSubmolecule(), and Read().

atom pointer

Referenced by buildupSubmolecule(), and Write().

Bond pointer.

Referenced by Read(), and Write().

atom pointer, Used in bonding section

Referenced by Read().

atom pointer, Used in bonding section

Referenced by Read().

Charge type.

Referenced by getChargeType(), and Read().

Total charge on the chemical specie described by the mol2.

Referenced by getTotalCharge(), and Read().

has total charge remark

Referenced by hasTotalCharge(), and Read().

std::map<int, int> MTKpp::mol2Parser::itsAtomMap [protected]

map used in bonding section of write

Referenced by getAtom(), and Write().

std::map<std::string, std::string> MTKpp::mol2Parser::res21l [protected]

Residue name to 1 letter code.

Referenced by get1LCode(), and mol2Parser().

std::ofstream MTKpp::baseParser::outputFileStream [protected, inherited]

Output File Stream.

Referenced by MTKpp::baseParser::OpenFile().

bool MTKpp::baseParser::bError [protected, inherited]
std::string MTKpp::baseParser::errorMessage [protected, inherited]
unsigned int MTKpp::baseParser::NUM_INDENTS_PER_SPACE [protected, inherited]

The documentation for this class was generated from the following files:

Generated on Fri Dec 23 2011 09:28:57 for MTK++ by Doxygen 1.7.5.1