Hi,

I would to know the number of bonds between two atoms within a
molecule (i.e. the shortest path).
Is there a function giving this information?

I only found this thread
http://forums.openbabel.org/OB-GetDistance-function-td959922.html
with a piece of code... but I still don't understand C++, especially
the "_name" and "->" stuff.

and this one, where the function seems to do what I want:
http://forums.openbabel.org/code-for-GenerateTopologicalDistanceMatrix-function-td960170.html

but I didn't found any mention of the
GenerateTopologicalDistanceMatrix or distancematrix functions in the
documentation.
Is it already implemented?
Should I paste this code somewhere in the OpenBabel source code and recompile?


Or if I just translate in my pybel script this piece of code

distancematrix.clear();
FOR_ATOMS_OF_MOL(a, mol) {
    for(OBMolAtomBFSIter b(mol, a->GetIdx()); b; ++b ){
       distancematrix[a->GetIdx()][b->GetIdx()]=b.CurrentDepth()-1;
    }
}

it should work?

Many thanks,
Pascal

------------------------------------------------------------------------------
Got Input?   Slashdot Needs You.
Take our quick survey online.  Come on, we don't ask for help often.
Plus, you'll get a chance to win $100 to spend on ThinkGeek.
http://p.sf.net/sfu/slashdot-survey
_______________________________________________
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss

Reply via email to