SmilesWrite.h

Go to the documentation of this file.
00001 //
00002 //  Copyright (C) 2002-2008 Greg Landrum and Rational Discovery LLC
00003 //
00004 //   @@ All Rights Reserved @@
00005 //  This file is part of the RDKit.
00006 //  The contents are covered by the terms of the BSD license
00007 //  which is included in the file license.txt, found at the root
00008 //  of the RDKit source tree.
00009 //
00010 #ifndef _RD_SMILESWRITE_H
00011 #define _RD_SMILESWRITE_H
00012 
00013 #include <string>
00014 
00015 
00016 namespace RDKit{
00017   class Atom;
00018   class Bond;
00019   class ROMol;
00020   namespace SmilesWrite {
00021     //! \brief returns true if the atom number is in the SMILES organic subset
00022     bool inOrganicSubset(int atomicNumber);
00023 
00024     //! \brief returns the SMILES for an atom
00025     /*!
00026       \param atom : the atom to work with
00027       \param doKekule : we're doing kekulized smiles (e.g. don't use
00028         lower case for the atom label)
00029       \param bondIn : the bond we came into the atom on (used for
00030         chirality calculation
00031     */
00032     std::string GetAtomSmiles(const Atom *atom,bool doKekule=false,
00033                               const Bond *bondIn=0);
00034 
00035     //! \brief returns the SMILES for a bond
00036     /*!
00037       \param bond : the bond to work with
00038       \param atomToLeftIdx : the index of the atom preceding \c bond
00039         in the SMILES
00040       \param doKekule : we're doing kekulized smiles (e.g. write out
00041         bond orders for aromatic bonds)
00042     */
00043     std::string GetBondSmiles(const Bond *bond,int atomToLeftIdx=-1,
00044                               bool doKekule=false);
00045   } 
00046   
00047   //! \brief returns canonical SMILES for a molecule
00048   /*!
00049     \param mol : the molecule in question. NOTE that the molecule may
00050         be modified as part of the canonicalization process.
00051     \param doIsomericSmiles : include stereochemistry and isotope information
00052         in the SMILES
00053     \param doKekule : do Kekule smiles (i.e. don't use aromatic bonds)
00054     \param rootedAtAtom : make sure the SMILES starts at the specified atom.
00055         The resulting SMILES is not, of course, canonical.
00056     \param canonical : if false, no attempt will be made to canonicalize the SMILES
00057    */
00058   std::string MolToSmiles(ROMol &mol,bool doIsomericSmiles=false,
00059                           bool doKekule=false,int rootedAtAtom=-1,
00060                           bool canonical=true);
00061 }
00062 #endif