RDKit::RWMol Class Reference

RWMol is a molecule class that is intended to be edited. More...

#include <RWMol.h>

Inheritance diagram for RDKit::RWMol:

RDKit::ROMol

List of all members.

Public Member Functions

 RWMol ()
 RWMol (const ROMol &other, bool quickCopy=false)
 copy constructor with a twist
void insertMol (const ROMol &other)
 insert the atoms and bonds from other into this molecule
unsigned int addAtom (bool updateLabel=true)
 adds an empty Atom to our collection
void replaceAtom (unsigned int idx, Atom *atom, bool updateLabel=false)
 replaces a particular Atom
GRAPH_NODE_TYPE getLastAtom ()
 returns a pointer to the highest-numbered Atom
GRAPH_NODE_TYPE getActiveAtom ()
 returns a pointer to the "active" Atom
void setActiveAtom (Atom *atom)
 sets our activeAtom
void setActiveAtom (unsigned int idx)
void removeAtom (unsigned int idx)
 removes an Atom from the molecule
void removeAtom (Atom *atom)
unsigned int addBond (unsigned int beginAtomIdx, unsigned int endAtomIdx, Bond::BondType order=Bond::UNSPECIFIED)
 adds a Bond between the indicated Atoms
unsigned int addBond (ATOM_SPTR beginAtom, ATOM_SPTR endAtom, Bond::BondType order=Bond::UNSPECIFIED)
unsigned int addBond (Atom *beginAtom, Atom *endAtom, Bond::BondType order=Bond::UNSPECIFIED)
BondcreatePartialBond (unsigned int beginAtomIdx, Bond::BondType order=Bond::UNSPECIFIED)
 starts a Bond and sets its beginAtomIdx
unsigned int finishPartialBond (unsigned int endAtomIdx, int bondBookmark, Bond::BondType order=Bond::UNSPECIFIED)
 finishes a partially constructed bond
void removeBond (unsigned int beginAtomIdx, unsigned int endAtomIdx)
 removes a bond from the molecule


Detailed Description

RWMol is a molecule class that is intended to be edited.

See documentation for ROMol for general remarks

Definition at line 20 of file RWMol.h.


Constructor & Destructor Documentation

RDKit::RWMol::RWMol (  )  [inline]

Definition at line 26 of file RWMol.h.

RDKit::RWMol::RWMol ( const ROMol other,
bool  quickCopy = false 
) [inline]

copy constructor with a twist

Parameters:
other the molecule to be copied
quickCopy (optional) if this is true, the resulting ROMol will not copy any of the properties or bookmarks and conformers from other. This can make the copy substantially faster (thus the name).

Definition at line 35 of file RWMol.h.


Member Function Documentation

void RDKit::RWMol::insertMol ( const ROMol other  ) 

insert the atoms and bonds from other into this molecule

unsigned int RDKit::RWMol::addAtom ( bool  updateLabel = true  ) 

adds an empty Atom to our collection

Parameters:
updateLabel (optional) if this is true, the new Atom will be our activeAtom
Returns:
the new number of atoms

void RDKit::RWMol::replaceAtom ( unsigned int  idx,
Atom atom,
bool  updateLabel = false 
)

replaces a particular Atom

Parameters:
idx the index of the Atom to replace
atom the new atom, which will be copied.
updateLabel (optional) if this is true, the new Atom will be our activeAtom

GRAPH_NODE_TYPE RDKit::RWMol::getLastAtom (  )  [inline]

returns a pointer to the highest-numbered Atom

Definition at line 67 of file RWMol.h.

References RDKit::ROMol::getAtomWithIdx(), and RDKit::ROMol::getNumAtoms().

GRAPH_NODE_TYPE RDKit::RWMol::getActiveAtom (  ) 

returns a pointer to the "active" Atom

If we have an activeAtom, it will be returned, otherwise the results of getLastAtom() will be returned.

void RDKit::RWMol::setActiveAtom ( Atom atom  ) 

sets our activeAtom

void RDKit::RWMol::setActiveAtom ( unsigned int  idx  ) 

void RDKit::RWMol::removeAtom ( unsigned int  idx  ) 

removes an Atom from the molecule

void RDKit::RWMol::removeAtom ( Atom atom  ) 

unsigned int RDKit::RWMol::addBond ( unsigned int  beginAtomIdx,
unsigned int  endAtomIdx,
Bond::BondType  order = Bond::UNSPECIFIED 
)

adds a Bond between the indicated Atoms

Returns:
the number of Bonds

unsigned int RDKit::RWMol::addBond ( ATOM_SPTR  beginAtom,
ATOM_SPTR  endAtom,
Bond::BondType  order = Bond::UNSPECIFIED 
)

unsigned int RDKit::RWMol::addBond ( Atom beginAtom,
Atom endAtom,
Bond::BondType  order = Bond::UNSPECIFIED 
)

Bond* RDKit::RWMol::createPartialBond ( unsigned int  beginAtomIdx,
Bond::BondType  order = Bond::UNSPECIFIED 
)

starts a Bond and sets its beginAtomIdx

Returns:
a pointer to the new bond
The caller should set a bookmark to the returned Bond in order to be able to later complete it:

        Bond *pBond = mol->createPartialBond(1);
	mol->setBondBookmark(pBond,666);
	... do some other stuff ...
	mol->finishPartialBond(2,666,Bond::SINGLE);
	mol->clearBondBookmark(666,pBond);
      

or, if we want to set the BondType initially:

        Bond *pBond = mol->createPartialBond(1,Bond::DOUBLE);
	mol->setBondBookmark(pBond,666);
	... do some other stuff ...
	mol->finishPartialBond(2,666);
	mol->clearBondBookmark(666,pBond);
      

the call to finishPartialBond() will take priority if you set the BondType in both calls.

unsigned int RDKit::RWMol::finishPartialBond ( unsigned int  endAtomIdx,
int  bondBookmark,
Bond::BondType  order = Bond::UNSPECIFIED 
)

finishes a partially constructed bond

Returns:
the final number of Bonds
See the documentation for createPartialBond() for more details

void RDKit::RWMol::removeBond ( unsigned int  beginAtomIdx,
unsigned int  endAtomIdx 
)

removes a bond from the molecule


The documentation for this class was generated from the following file:
Generated on Sat May 24 08:36:34 2008 for RDCode by  doxygen 1.5.3