diff --git a/Code/GraphMol/Wrap/Atom.cpp b/Code/GraphMol/Wrap/Atom.cpp index d37bc4f7f..0149da125 100755 --- a/Code/GraphMol/Wrap/Atom.cpp +++ b/Code/GraphMol/Wrap/Atom.cpp @@ -1,6 +1,6 @@ // $Id$ // -// Copyright (C) 2003-2009 Greg Landrum and Rational Discovery LLC +// Copyright (C) 2003-2010 Greg Landrum and Rational Discovery LLC // // @@ All Rights Reserved @@ // @@ -22,6 +22,27 @@ namespace python = boost::python; namespace RDKit{ + namespace { + std::string qhelper(Atom::QUERYATOM_QUERY *q,int depth){ + std::string res=""; + if(q){ + for (unsigned int i=0;igetDescription()+"\n"; + for(Atom::QUERYATOM_QUERY::CHILD_VECT_CI ci=q->beginChildren(); + ci!=q->endChildren();++ci){ + res += qhelper((*ci).get(),depth+1); + } + } + return res; + } + } // end of local namespace + std::string describeQuery(const Atom*atom){ + std::string res=""; + if(atom->hasQuery()){ + res=qhelper(atom->getQuery(),0); + } + return res; + } void AtomSetProp(const Atom *atom, const char *key,std::string val) { //std::cerr<<"asp: "<(mol); + MolOps::setConjugation(wmol); + } + + void setHybridizationMol(ROMol &mol) { + RWMol &wmol = static_cast(mol); + MolOps::setHybridization(wmol); + } + VECT_INT_VECT getSymmSSSR(ROMol &mol) { VECT_INT_VECT rings; MolOps::symmetrizeSSSR(mol, rings); return rings; } - PyObject *getDistanceMatrix(ROMol &mol, bool useBO=false, bool useAtomWts=false,bool force=false, const char *prefix=0) { @@ -489,6 +498,12 @@ namespace RDKit{ python::def("SetAromaticity", setAromaticityMol, (python::arg("mol")), docString.c_str()); + python::def("SetConjugation", setConjugationMol, + (python::arg("mol")), + docString.c_str()); + python::def("SetHybridization", setHybridizationMol, + (python::arg("mol")), + docString.c_str());