Re: [Rdkit-discuss] compiling simple cpp script for OS X
Andreas, Could you please share your Makefile? I am also using the C++ API of RDKit on Mac. This is my current Makefile. CC= g++ OPENMPFLAG=#-fopenmp CXXFLAGS=-Wall -O2 -std=c++11 -I${RDBASE}/Code -I${RDBASE}/lib -I${RDBASE}/External -I${BOOSTBASE}/include -I${EGGBASE} LDFLAGS=-L${RDBASE}/lib -lRDKitDescriptors -lRDKitGraphMol -lRDKitInchi -lRDKitInfoTheory -lRDKitRDGeneral -lRDKitRDInchiLib -lRDKitSmilesParse -L${BOOSTBASE}/lib -lboost_system -lboost_filesystem MIDAS_CPP: main.cpp Database.h Database.cpp MidasCore.h MidasCore.cpp ParseConfigure.h ParseConfigure.cpp SettingInfo.h SettingInfo.cpp SpectrumUnit.cpp SpectrumUnit.h ParseSpectraFile.h ParseSpectraFile.cpp $(CC) $(OPENMPFLAG) $(CXXFLAGS) -o MIDAS main.cpp Database.cpp MidasCore.cpp ParseConfigure.cpp SettingInfo.cpp SpectrumUnit.cpp ParseSpectraFile.cpp ${EGGBASE}/EggCore.cpp ${EGGBASE}/FilesOperation.cpp ${EGGBASE}/GML.cpp ${EGGBASE}/GraphBasics.cpp ${EGGBASE}/GraphGrammar.cpp ${EGGBASE}/ParseRegularGraph.cpp ${EGGBASE}/Production.cpp ${EGGBASE}/ReadGML.cpp ${EGGBASE}/ReadGrammar.cpp ${EGGBASE}/ReadInputGraphs.cpp ${EGGBASE}/RegularGraph.cpp $(LDFLAGS) clean: rm MIDAS Hope it helps. Best, Yingfeng On Wed, Jan 9, 2019 at 3:40 PM Andreas Luttens wrote: > Hi, > > I have recently installed the RDKit from source for OS X, as described in > Docs/Book/install.md on the GitHub page. I believe make, and make install > worked out fine, but I have using trying to compile a basic cpp script. I > have set the RDBASE env variable and I included the compiler flags for > include (-I) and where to find the libraries (-L) as $RDBASE/Code and > $RDBASE/lib. Code contains header files and lib has its static and dynamic > library files. When I try to compile the example1.cpp code, I set the > -lGraphMol flag, std=c++11 flag and the verbose flag, but get the following > errors: > > ld: library not found for -lGraphMol > > I am not sure why it does not find the library files and I have yet to > successfully compile a cpp code with these libraries. > > Any help would be very appreciated! > > Best regards > > Andreas Luttens > ___ > Rdkit-discuss mailing list > Rdkit-discuss@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/rdkit-discuss > ___ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
Re: [Rdkit-discuss] InChI to Mol to InChi
Jason, I can see the image :-) Yingfeng On Mon, Dec 17, 2018 at 10:01 AM Jason Biggs wrote: > Is this the same issue as https://github.com/rdkit/rdkit/issues/1852? > where the input string specifies a trans double bond in a ring but > EmbedMolecule returns a cis configuration? I get different SMILES string > before and after embedding, > > C/C1=C/C/C=C(\C)C(=O)C[C@H](C(C)C)[C@H]2C=C(CC(=O)C1)C(=O)O2 > C/C1=C/C/C=C(/C)C(=O)C[C@H](C(C)C)[C@H]2C=C(CC(=O)C1)C(=O)O2 > > Getting the two highlighted atoms trans to each other seems difficult, and > the embedder doesn't check and reject for double-bond stereo like it does > for chiral centers. > > > [image: image.png] > > (does this copy/pasted image come across in the mailing list?) > > > Jason Biggs > > > > On Mon, Dec 17, 2018 at 7:24 AM JEAN-MARC NUZILLARD < > jm.nuzill...@univ-reims.fr> wrote: > >> Dear all, >> >> I tried to transform an InChI into a Mol and back to InChi. >> >> The following code: >> >> inchi1 = >> >> "InChI=1S/C20H26O4/c1-12(2)17-11-18(22)14(4)7-5-6-13(3)8-16(21)9-15-10-19(17)24-20(15)23/h6-7,10,12,17,19H,5,8-9,11H2,1-4H3/b13-6-,14-7+/t17-,19-/m1/s1" >> m = Chem.MolFromInchi(inchi1) >> m = Chem.AddHs(m) >> AllChem.EmbedMolecule(m) >> inchi2 = Chem.MolToInchi(m) >> print(inchi1) >> print(inchi2) >> print("EQUAL" if inchi1 == inchi2 else "DIFFERENT") >> >> returns DIFFERENT. >> >> Removing the EmbedMolecule step returns EQUAL. >> >> How could I change that? >> >> >> All the best, >> >> Jean-Marc >> >> >> ___ >> Rdkit-discuss mailing list >> Rdkit-discuss@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss >> > ___ > Rdkit-discuss mailing list > Rdkit-discuss@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/rdkit-discuss > ___ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
Re: [Rdkit-discuss] implicit conversion of smart pointer with version 2018_03_4
Greg, I figure it out. Adding const should work. const Atom *atom = (*pCurrentROMol)[*atBegin]; Thanks. Yingfeng On Wed, Dec 12, 2018 at 10:21 AM Yingfeng Wang wrote: > Greg, > > I figure out the problem. Removing "->get()" can solve the problem. > > Here is the updated version. > > boost::tie(firstB,lastB) = pCurrentROMol->getEdges(); > > while(firstB!=lastB) > > { > > auto bond = (*pCurrentROMol)[*firstB]; > > ... > > sEdgeLabel += ((queryIsBondInRing(bond)) ? "ring|" : "linear|" ); > > ... > > ++firstB; > > } > > > The original version was > > > boost::tie(firstB,lastB) = pCurrentROMol->getEdges(); > > while(firstB!=lastB) > > { > > boost::shared_ptr bond = (*pCurrentROMol)[*firstB]; > > ... > > sEdgeLabel += ((queryIsBondInRing(bond.get())) ? "ring|" : "linear|" > ); > > ... > > ++firstB; > > } > > > However, I still have a question. Why "Atom *atom" and "Bond *bond" do not > work? Yes, "auto" solves the problem, but I feel it just covers the > essential issue. > > > Thanks. > > Yingfeng > > > > > On Wed, Dec 12, 2018 at 9:50 AM Yingfeng Wang wrote: > >> Greg, >> >> Thanks. The first way does not work. I got the following error message. >> >> *Database.cpp:148:15: **error: **cannot initialize a variable of type >> 'RDKit::Atom *'* >> >> * with an rvalue of type 'const RDKit::Atom *'* >> >> Atom *atom = (*pCurrentROMol)[*atBegin]; >> >> >> The second way, which uses "auto", works. I also updated the code for >> bond and got a new error with the following error message. >> >> *Database.cpp:164:49: **error: **no member named 'get' in 'RDKit::Bond'* >> >> sEdgeLabel += ((queryIsBondInRing(bond->get())) ? "ring|" : >> "linear|" ); >> >> * ^* >> >> 1 error generated. >> >> Could you please confirm that the updated class Bond removes method >> get()? If this is the case, which method should I use? >> >> Again, thank you very much for your help! >> >> Yingfeng >> >> >> >> On Wed, Dec 12, 2018 at 12:58 AM Greg Landrum >> wrote: >> >>> Hi Yingfeng, >>> >>> As part of the move over to Modern C++ we also changed the way atoms and >>> bonds are stored in molecules: you now get raw pointers back instead of >>> smart pointers. >>> If you change your code from: >>> boost::shared_ptr atom = (*pCurrentROMol)[*atBegin]; >>> to: >>> Atom *atom = (*pCurrentROMol)[*atBegin]; >>> or, even simpler: >>> auto atom = (*pCurrentROMol)[*atBegin]; >>> >>> things should work. >>> -greg >>> >>> >>> On Wed, Dec 12, 2018 at 12:36 AM Yingfeng Wang >>> wrote: >>> >>>> I am using the C++ library of RDKit on Mac. My C++ code works with >>>> RDKit_2017_09_3. However, after I switch to RDKit 2018_03_4, I got the >>>> following error when compiling my C++ source code. >>>> >>>> *Database.cpp:148:33: **error: **no viable conversion from 'const >>>> RDKit::Atom *' to* >>>> >>>> * 'boost::shared_ptr'* >>>> >>>> boost::shared_ptr atom = (*pCurrentROMol)[*atBegin]; >>>> >>>> *^ ~~* >>>> >>>> */usr/local/Cellar/boost/1.68.0/include/boost/smart_ptr/shared_ptr.hpp:358:21: >>>> **note: * >>>> >>>> candidate constructor not viable: no known conversion from >>>> >>>> 'const RDKit::Atom *' to 'boost::detail::sp_nullptr_t' (aka >>>> 'nullptr_t') >>>> >>>> for 1st argument >>>> >>>> BOOST_CONSTEXPR shared_ptr( boost::detail::sp_nullptr_t ) >>>> BOOST_SP_N... >>>> >>>> *^* >>>> >>>> */usr/local/Cellar/boost/1.68.0/include/boost/smart_ptr/shared_ptr.hpp:422:5: >>>> **note: * >>>> >>>> candidate constructor not viable: no known conversion from >>>> >>>> 'const RDKit::Atom *' to 'const boost::shared_ptr >>>> &' for 1st >>>> >>>> argument >>>> >>>> shared_pt
Re: [Rdkit-discuss] implicit conversion of smart pointer with version 2018_03_4
Greg, I figure out the problem. Removing "->get()" can solve the problem. Here is the updated version. boost::tie(firstB,lastB) = pCurrentROMol->getEdges(); while(firstB!=lastB) { auto bond = (*pCurrentROMol)[*firstB]; ... sEdgeLabel += ((queryIsBondInRing(bond)) ? "ring|" : "linear|" ); ... ++firstB; } The original version was boost::tie(firstB,lastB) = pCurrentROMol->getEdges(); while(firstB!=lastB) { boost::shared_ptr bond = (*pCurrentROMol)[*firstB]; ... sEdgeLabel += ((queryIsBondInRing(bond.get())) ? "ring|" : "linear|" ); ... ++firstB; } However, I still have a question. Why "Atom *atom" and "Bond *bond" do not work? Yes, "auto" solves the problem, but I feel it just covers the essential issue. Thanks. Yingfeng On Wed, Dec 12, 2018 at 9:50 AM Yingfeng Wang wrote: > Greg, > > Thanks. The first way does not work. I got the following error message. > > *Database.cpp:148:15: **error: **cannot initialize a variable of type > 'RDKit::Atom *'* > > * with an rvalue of type 'const RDKit::Atom *'* > > Atom *atom = (*pCurrentROMol)[*atBegin]; > > > The second way, which uses "auto", works. I also updated the code for bond > and got a new error with the following error message. > > *Database.cpp:164:49: **error: **no member named 'get' in 'RDKit::Bond'* > > sEdgeLabel += ((queryIsBondInRing(bond->get())) ? "ring|" : > "linear|" ); > > * ^* > > 1 error generated. > > Could you please confirm that the updated class Bond removes method get()? > If this is the case, which method should I use? > > Again, thank you very much for your help! > > Yingfeng > > > > On Wed, Dec 12, 2018 at 12:58 AM Greg Landrum > wrote: > >> Hi Yingfeng, >> >> As part of the move over to Modern C++ we also changed the way atoms and >> bonds are stored in molecules: you now get raw pointers back instead of >> smart pointers. >> If you change your code from: >> boost::shared_ptr atom = (*pCurrentROMol)[*atBegin]; >> to: >> Atom *atom = (*pCurrentROMol)[*atBegin]; >> or, even simpler: >> auto atom = (*pCurrentROMol)[*atBegin]; >> >> things should work. >> -greg >> >> >> On Wed, Dec 12, 2018 at 12:36 AM Yingfeng Wang >> wrote: >> >>> I am using the C++ library of RDKit on Mac. My C++ code works with >>> RDKit_2017_09_3. However, after I switch to RDKit 2018_03_4, I got the >>> following error when compiling my C++ source code. >>> >>> *Database.cpp:148:33: **error: **no viable conversion from 'const >>> RDKit::Atom *' to* >>> >>> * 'boost::shared_ptr'* >>> >>> boost::shared_ptr atom = (*pCurrentROMol)[*atBegin]; >>> >>> *^ ~~* >>> >>> */usr/local/Cellar/boost/1.68.0/include/boost/smart_ptr/shared_ptr.hpp:358:21: >>> **note: * >>> >>> candidate constructor not viable: no known conversion from >>> >>> 'const RDKit::Atom *' to 'boost::detail::sp_nullptr_t' (aka >>> 'nullptr_t') >>> >>> for 1st argument >>> >>> BOOST_CONSTEXPR shared_ptr( boost::detail::sp_nullptr_t ) >>> BOOST_SP_N... >>> >>> *^* >>> >>> */usr/local/Cellar/boost/1.68.0/include/boost/smart_ptr/shared_ptr.hpp:422:5: >>> **note: * >>> >>> candidate constructor not viable: no known conversion from >>> >>> 'const RDKit::Atom *' to 'const boost::shared_ptr &' >>> for 1st >>> >>> argument >>> >>> shared_ptr( shared_ptr const & r ) BOOST_SP_NOEXCEPT : px( r.px ), >>> p... >>> >>> *^* >>> >>> I am using Clang on Mac. The version information is given as follows. >>> >>> g++ -v >>> >>> Configured with: --prefix=/Library/Developer/CommandLineTools/usr >>> --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/c++/4.2.1 >>> >>> Apple LLVM version 10.0.0 (clang-1000.10.44.4) >>> >>> Target: x86_64-apple-darwin18.2.0 >>> >>> Thread model: posix >>> >>> I notice that "Starting with the 2018_03 release, the RDKit core C++ >>> code is written in modern C++; for this release that means C++11. " >>> >>> Actually, I also use -std=c++11 when compiling my C++ source code. I >>> also tested RDKit 2018_09_1 and got the similar error. I am wondering how >>> to fix this problem. >>> >>> Thanks. >>> >>> Yingfeng >>> >>> >>> ___ >>> Rdkit-discuss mailing list >>> Rdkit-discuss@lists.sourceforge.net >>> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss >>> >> ___ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
Re: [Rdkit-discuss] implicit conversion of smart pointer with version 2018_03_4
Dan, Thank you for your reply. I copy the corresponding code segment here. ROMol::VERTEX_ITER atBegin,atEnd; boost::tie(atBegin,atEnd) = pCurrentROMol->getVertices(); while(atBegin!=atEnd) { boost::shared_ptr atom = (*pCurrentROMol)[*atBegin]; pCurNode = new Node(); pCurNode->iNodeId = atom->getIdx(); pCurNode->sLabel = atom->getSymbol(); pCurGML->mNodeIdPos.insert(pair(pCurNode->iNodeId, pCurGML->vpNodes.size())); pCurGML->vpNodes.push_back(pCurNode); ++atBegin; } The purpose here is to traverse all atoms. Best, Yingfeng On Wed, Dec 12, 2018 at 12:50 AM Dan Nealschneider < dan.nealschnei...@schrodinger.com> wrote: > boost::shared_ptr atom = (*pCurrentROMol)[*atBegin] > > should probably be: > > boost::shared_ptr atom((*pCurrentROMol)[*atBegin]); > > Although I'm skeptical of the correctness of this code, because > ROMol::operator[] returns a pointer to an atom owned by the ROMol. If your > take ownership of the atom with a shared_ptr and then allow the shared_ptr > to clean it up you're asking for trouble. Maybe you were trying to copy the > atom, and control ownership with the shared_ptr? > > - dan nealschneider > > (né wandschneider) > > Senior Developer > Schr*ö*dinger, Inc > Portland, OR > > > > > On Tue, Dec 11, 2018 at 3:36 PM Yingfeng Wang wrote: > >> I am using the C++ library of RDKit on Mac. My C++ code works with >> RDKit_2017_09_3. However, after I switch to RDKit 2018_03_4, I got the >> following error when compiling my C++ source code. >> >> *Database.cpp:148:33: **error: **no viable conversion from 'const >> RDKit::Atom *' to* >> >> * 'boost::shared_ptr'* >> >> boost::shared_ptr atom = (*pCurrentROMol)[*atBegin]; >> >> *^ ~~* >> >> */usr/local/Cellar/boost/1.68.0/include/boost/smart_ptr/shared_ptr.hpp:358:21: >> **note: * >> >> candidate constructor not viable: no known conversion from >> >> 'const RDKit::Atom *' to 'boost::detail::sp_nullptr_t' (aka >> 'nullptr_t') >> >> for 1st argument >> >> BOOST_CONSTEXPR shared_ptr( boost::detail::sp_nullptr_t ) >> BOOST_SP_N... >> >> *^* >> >> */usr/local/Cellar/boost/1.68.0/include/boost/smart_ptr/shared_ptr.hpp:422:5: >> **note: * >> >> candidate constructor not viable: no known conversion from >> >> 'const RDKit::Atom *' to 'const boost::shared_ptr &' >> for 1st >> >> argument >> >> shared_ptr( shared_ptr const & r ) BOOST_SP_NOEXCEPT : px( r.px ), >> p... >> >> *^* >> >> I am using Clang on Mac. The version information is given as follows. >> >> g++ -v >> >> Configured with: --prefix=/Library/Developer/CommandLineTools/usr >> --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/c++/4.2.1 >> >> Apple LLVM version 10.0.0 (clang-1000.10.44.4) >> >> Target: x86_64-apple-darwin18.2.0 >> >> Thread model: posix >> >> I notice that "Starting with the 2018_03 release, the RDKit core C++ >> code is written in modern C++; for this release that means C++11. " >> >> Actually, I also use -std=c++11 when compiling my C++ source code. I >> also tested RDKit 2018_09_1 and got the similar error. I am wondering how >> to fix this problem. >> >> Thanks. >> >> Yingfeng >> >> >> ___ >> Rdkit-discuss mailing list >> Rdkit-discuss@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss >> > ___ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
Re: [Rdkit-discuss] implicit conversion of smart pointer with version 2018_03_4
Greg, Thanks. The first way does not work. I got the following error message. *Database.cpp:148:15: **error: **cannot initialize a variable of type 'RDKit::Atom *'* * with an rvalue of type 'const RDKit::Atom *'* Atom *atom = (*pCurrentROMol)[*atBegin]; The second way, which uses "auto", works. I also updated the code for bond and got a new error with the following error message. *Database.cpp:164:49: **error: **no member named 'get' in 'RDKit::Bond'* sEdgeLabel += ((queryIsBondInRing(bond->get())) ? "ring|" : "linear|" ); * ^* 1 error generated. Could you please confirm that the updated class Bond removes method get()? If this is the case, which method should I use? Again, thank you very much for your help! Yingfeng On Wed, Dec 12, 2018 at 12:58 AM Greg Landrum wrote: > Hi Yingfeng, > > As part of the move over to Modern C++ we also changed the way atoms and > bonds are stored in molecules: you now get raw pointers back instead of > smart pointers. > If you change your code from: > boost::shared_ptr atom = (*pCurrentROMol)[*atBegin]; > to: > Atom *atom = (*pCurrentROMol)[*atBegin]; > or, even simpler: > auto atom = (*pCurrentROMol)[*atBegin]; > > things should work. > -greg > > > On Wed, Dec 12, 2018 at 12:36 AM Yingfeng Wang wrote: > >> I am using the C++ library of RDKit on Mac. My C++ code works with >> RDKit_2017_09_3. However, after I switch to RDKit 2018_03_4, I got the >> following error when compiling my C++ source code. >> >> *Database.cpp:148:33: **error: **no viable conversion from 'const >> RDKit::Atom *' to* >> >> * 'boost::shared_ptr'* >> >> boost::shared_ptr atom = (*pCurrentROMol)[*atBegin]; >> >> *^ ~~* >> >> */usr/local/Cellar/boost/1.68.0/include/boost/smart_ptr/shared_ptr.hpp:358:21: >> **note: * >> >> candidate constructor not viable: no known conversion from >> >> 'const RDKit::Atom *' to 'boost::detail::sp_nullptr_t' (aka >> 'nullptr_t') >> >> for 1st argument >> >> BOOST_CONSTEXPR shared_ptr( boost::detail::sp_nullptr_t ) >> BOOST_SP_N... >> >> *^* >> >> */usr/local/Cellar/boost/1.68.0/include/boost/smart_ptr/shared_ptr.hpp:422:5: >> **note: * >> >> candidate constructor not viable: no known conversion from >> >> 'const RDKit::Atom *' to 'const boost::shared_ptr &' >> for 1st >> >> argument >> >> shared_ptr( shared_ptr const & r ) BOOST_SP_NOEXCEPT : px( r.px ), >> p... >> >> *^* >> >> I am using Clang on Mac. The version information is given as follows. >> >> g++ -v >> >> Configured with: --prefix=/Library/Developer/CommandLineTools/usr >> --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/c++/4.2.1 >> >> Apple LLVM version 10.0.0 (clang-1000.10.44.4) >> >> Target: x86_64-apple-darwin18.2.0 >> >> Thread model: posix >> >> I notice that "Starting with the 2018_03 release, the RDKit core C++ >> code is written in modern C++; for this release that means C++11. " >> >> Actually, I also use -std=c++11 when compiling my C++ source code. I >> also tested RDKit 2018_09_1 and got the similar error. I am wondering how >> to fix this problem. >> >> Thanks. >> >> Yingfeng >> >> >> ___ >> Rdkit-discuss mailing list >> Rdkit-discuss@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss >> > ___ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
[Rdkit-discuss] implicit conversion of smart pointer with version 2018_03_4
I am using the C++ library of RDKit on Mac. My C++ code works with RDKit_2017_09_3. However, after I switch to RDKit 2018_03_4, I got the following error when compiling my C++ source code. *Database.cpp:148:33: **error: **no viable conversion from 'const RDKit::Atom *' to* * 'boost::shared_ptr'* boost::shared_ptr atom = (*pCurrentROMol)[*atBegin]; *^ ~~* */usr/local/Cellar/boost/1.68.0/include/boost/smart_ptr/shared_ptr.hpp:358:21: **note: * candidate constructor not viable: no known conversion from 'const RDKit::Atom *' to 'boost::detail::sp_nullptr_t' (aka 'nullptr_t') for 1st argument BOOST_CONSTEXPR shared_ptr( boost::detail::sp_nullptr_t ) BOOST_SP_N... *^* */usr/local/Cellar/boost/1.68.0/include/boost/smart_ptr/shared_ptr.hpp:422:5: **note: * candidate constructor not viable: no known conversion from 'const RDKit::Atom *' to 'const boost::shared_ptr &' for 1st argument shared_ptr( shared_ptr const & r ) BOOST_SP_NOEXCEPT : px( r.px ), p... *^* I am using Clang on Mac. The version information is given as follows. g++ -v Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/c++/4.2.1 Apple LLVM version 10.0.0 (clang-1000.10.44.4) Target: x86_64-apple-darwin18.2.0 Thread model: posix I notice that "Starting with the 2018_03 release, the RDKit core C++ code is written in modern C++; for this release that means C++11. " Actually, I also use -std=c++11 when compiling my C++ source code. I also tested RDKit 2018_09_1 and got the similar error. I am wondering how to fix this problem. Thanks. Yingfeng ___ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
Re: [Rdkit-discuss] minGW fails to build rdkit
Paolo, Could you please let me know the version of your minGW and how you got or built boost with minGW. I kept getting errors like "duplicate section" with different size. Thanks. Yingfeng On Tue, Dec 20, 2016 at 10:13 AM, Yingfeng Wang <ywang...@gmail.com> wrote: > Paolo, > > Thanks. I figure out this problem. The new cmake command is > > cmake -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ > -DMSVC_RUNTIME_DLL=C:/Windows/System32/msvcr100.dll > -DRDK_USE_BOOST_SERIALIZATION=OFF -DBOOST_ROOT=C:/boost > -DCMAKE_INSTALL_PREFIX=C:/software/RDKit/install_2016_09_2 > -DRDK_BUILD_INCHI_SUPPORT=ON -DRDK_BUILD_PYTHON_WRAPPERS=OFF -G "MinGW > Makefiles" .. > > In comparison of the old command, I removed "" and replaced "\" by "/". > The same error does not happen. Then I got a new error, "duplicate section" > with different size when link to my boost library. I searched internet, and > it looks this is a compiling problem when I build boost using minGW. I will > update on you if I get some progress. > > Again, thank you very much for your help! > > Yingfeng > > On Tue, Dec 20, 2016 at 5:13 AM, Paolo Tosco <paolo.to...@unito.it> wrote: > >> Dear Yingfeng, >> >> I can build the latest RDKIt trunk from a MSYS2 shell using the following >> cmake command: >> >> cmake -DEIGEN3_INCLUDE_DIR=/c/build/include/eigen3 >> -DBOOST_LIBRARYDIR=/mingw64/bin -DBOOST_ROOT=/mingw64 >> -DPYTHON_NUMPY_INCLUDE_PATH=/mingw64/include/python2.7 >> -DRDK_USE_BOOST_SERIALIZATION=OFF -G"MSYS Makefiles" .. >> >> I had to switch serialization off to avoid a bunch of errors while >> building FilterCatalog; so far I haven't had time to investigate this >> further. >> >> You should be able to succeed also from a CMD shell using >> mingw32-make.exe. >> >> Make sure you start from a clean build directory before issuing the cmake >> command. >> >> Cheers, >> p. >> >> >> On 12/20/16 04:47, Yingfeng Wang wrote: >> >> I try to use minGW to build rdkit_2016_09_2, which is from the following >> link. >> >> https://github.com/rdkit/rdkit/archive/Release_2016_09_2.zip >> >> cmake command is >> >> cmake -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ >> -DMSVC_RUNTIME_DLL="C:\Windows\System32\msvcr100.dll" >> -DBOOST_ROOT="C:\boost" >> -DCMAKE_INSTALL_PREFIX=C:\software\RDKit\install_2016_09_2 >> -DRDK_BUILD_INCHI_SUPPORT=ON -DRDK_BUILD_PYTHON_WRAPPERS=OFF -G "MinGW >> Makefiles" .. >> >> Error happens when running mingw32-make >> Error message is given as follows. >> >> Scanning dependencies of target RDGeneral >> [ 12%] Building CXX object Code/RDGeneral/CMakeFiles/RDGe >> neral.dir/Invariant.cpp.obj >> 'ccache' is not recognized as an internal or external command, >> operable program or batch file. >> Code\RDGeneral\CMakeFiles\RDGeneral.dir\build.make:62: recipe for target >> 'Code/RDGeneral/CMakeFiles/RDGeneral.dir/Invariant.cpp.obj' failed >> mingw32-make[2]: *** >> [Code/RDGeneral/CMakeFiles/RDGeneral.dir/Invariant.cpp.obj] >> Error 1 >> CMakeFiles\Makefile2:494: recipe for target >> 'Code/RDGeneral/CMakeFiles/RDGeneral.dir/all' >> failed >> mingw32-make[1]: *** [Code/RDGeneral/CMakeFiles/RDGeneral.dir/all] Error >> 2 >> Makefile:159: recipe for target 'all' failed >> mingw32-make: *** [all] Error 2 >> >> By the way, the information of compiler is given in the following. >> >> C:\software\RDKit\rdkit-Release_2016_09_2\build>g++ -v >> Reading specs from c:/mingw_win_build/bin/../lib/ >> gcc/i686-w64-mingw32/4.8.3/specs >> COLLECT_GCC=g++ >> COLLECT_LTO_WRAPPER=c:/mingw_win_build/bin/../libexec/gcc/i6 >> 86-w64-mingw32/4.8.3 >> /lto-wrapper.exe >> Target: i686-w64-mingw32 >> Configured with: ../gcc-4.8.3/configure --prefix=/opt/windows_32 >> --with-sysroot=/opt/windows_32 --libdir=/opt/windows_32/lib >> --mandir=/opt/windows_32/man --infodir=/opt/windows_32/info --enable-shared >> --disable-bootstrap --disable-multilib--with-arch=pentium3 >> --enable-threads=posix --enable-languages=c,c++ --enable-checking=release >> --enable-libgomp --with-system-zlib >> --with-python-dir=/lib/python2.7/site-packages >> --disable-libunwind-exceptions --enable-__cxa_atexit --enable-libssp >> --with-gnu-ld --verbose --enable-java-home >> --with-java-home=/opt/windows_32/lib/jvm/jre >> --with-jvm-root-dir=/opt/windows_32/lib/jvm >> --with-jvm-jar-dir=/opt/windows_32/lib/jvm/jvm-exports &
Re: [Rdkit-discuss] minGW fails to build rdkit
Paolo, Thanks. I figure out this problem. The new cmake command is cmake -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DMSVC_RUNTIME_DLL=C:/Windows/System32/msvcr100.dll -DRDK_USE_BOOST_SERIALIZATION=OFF -DBOOST_ROOT=C:/boost -DCMAKE_INSTALL_PREFIX=C:/software/RDKit/install_2016_09_2 -DRDK_BUILD_INCHI_SUPPORT=ON -DRDK_BUILD_PYTHON_WRAPPERS=OFF -G "MinGW Makefiles" .. In comparison of the old command, I removed "" and replaced "\" by "/". The same error does not happen. Then I got a new error, "duplicate section" with different size when link to my boost library. I searched internet, and it looks this is a compiling problem when I build boost using minGW. I will update on you if I get some progress. Again, thank you very much for your help! Yingfeng On Tue, Dec 20, 2016 at 5:13 AM, Paolo Tosco <paolo.to...@unito.it> wrote: > Dear Yingfeng, > > I can build the latest RDKIt trunk from a MSYS2 shell using the following > cmake command: > > cmake -DEIGEN3_INCLUDE_DIR=/c/build/include/eigen3 > -DBOOST_LIBRARYDIR=/mingw64/bin -DBOOST_ROOT=/mingw64 > -DPYTHON_NUMPY_INCLUDE_PATH=/mingw64/include/python2.7 > -DRDK_USE_BOOST_SERIALIZATION=OFF -G"MSYS Makefiles" .. > > I had to switch serialization off to avoid a bunch of errors while > building FilterCatalog; so far I haven't had time to investigate this > further. > > You should be able to succeed also from a CMD shell using mingw32-make.exe. > > Make sure you start from a clean build directory before issuing the cmake > command. > > Cheers, > p. > > > On 12/20/16 04:47, Yingfeng Wang wrote: > > I try to use minGW to build rdkit_2016_09_2, which is from the following > link. > > https://github.com/rdkit/rdkit/archive/Release_2016_09_2.zip > > cmake command is > > cmake -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ > -DMSVC_RUNTIME_DLL="C:\Windows\System32\msvcr100.dll" > -DBOOST_ROOT="C:\boost" -DCMAKE_INSTALL_PREFIX=C:\ > software\RDKit\install_2016_09_2 -DRDK_BUILD_INCHI_SUPPORT=ON > -DRDK_BUILD_PYTHON_WRAPPERS=OFF -G "MinGW Makefiles" .. > > Error happens when running mingw32-make > Error message is given as follows. > > Scanning dependencies of target RDGeneral > [ 12%] Building CXX object Code/RDGeneral/CMakeFiles/ > RDGeneral.dir/Invariant.cpp.obj > 'ccache' is not recognized as an internal or external command, > operable program or batch file. > Code\RDGeneral\CMakeFiles\RDGeneral.dir\build.make:62: recipe for target > 'Code/RDGeneral/CMakeFiles/RDGeneral.dir/Invariant.cpp.obj' failed > mingw32-make[2]: *** [Code/RDGeneral/CMakeFiles/ > RDGeneral.dir/Invariant.cpp.obj] Error 1 > CMakeFiles\Makefile2:494: recipe for target > 'Code/RDGeneral/CMakeFiles/RDGeneral.dir/all' > failed > mingw32-make[1]: *** [Code/RDGeneral/CMakeFiles/RDGeneral.dir/all] Error 2 > Makefile:159: recipe for target 'all' failed > mingw32-make: *** [all] Error 2 > > By the way, the information of compiler is given in the following. > > C:\software\RDKit\rdkit-Release_2016_09_2\build>g++ -v > Reading specs from c:/mingw_win_build/bin/../lib/ > gcc/i686-w64-mingw32/4.8.3/specs > COLLECT_GCC=g++ > COLLECT_LTO_WRAPPER=c:/mingw_win_build/bin/../libexec/gcc/ > i686-w64-mingw32/4.8.3 > /lto-wrapper.exe > Target: i686-w64-mingw32 > Configured with: ../gcc-4.8.3/configure --prefix=/opt/windows_32 > --with-sysroot=/opt/windows_32 --libdir=/opt/windows_32/lib > --mandir=/opt/windows_32/man --infodir=/opt/windows_32/info --enable-shared > --disable-bootstrap --disable-multilib--with-arch=pentium3 > --enable-threads=posix --enable-languages=c,c++ --enable-checking=release > --enable-libgomp --with-system-zlib > --with-python-dir=/lib/python2.7/site-packages > --disable-libunwind-exceptions --enable-__cxa_atexit --enable-libssp > --with-gnu-ld --verbose --enable-java-home > --with-java-home=/opt/windows_32/lib/jvm/jre > --with-jvm-root-dir=/opt/windows_32/lib/jvm > --with-jvm-jar-dir=/opt/windows_32/lib/jvm/jvm-exports > --with-arch-directory=amd64 --with-antlr-jar='/home/ > adrien/projects/win-builds-1.5/slackware64-current/d/gcc/antlr-*.jar' > --disable-java-awt --disable-gtktest --build=x86_64-slackware-linux > --host=i686-w64-mingw32 --target=i686-w64-mingw32 > Thread model: posix > gcc version 4.8.3 (GCC) > > Could you please give me any hints? > > Thank you very much in advance! > > Yingfeng > > > -- > Developer Access Program for Intel Xeon Phi Processors > Access to Intel Xeon Phi processor-based developer platforms. > With one year of Intel Parallel Studio XE. > Training and support from Colfax. > Order your pl
[Rdkit-discuss] minGW fails to build rdkit
I try to use minGW to build rdkit_2016_09_2, which is from the following link. https://github.com/rdkit/rdkit/archive/Release_2016_09_2.zip cmake command is cmake -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DMSVC_RUNTIME_DLL="C:\Windows\System32\msvcr100.dll" -DBOOST_ROOT="C:\boost" -DCMAKE_INSTALL_PREFIX=C:\software\RDKit\install_2016_09_2 -DRDK_BUILD_INCHI_SUPPORT=ON -DRDK_BUILD_PYTHON_WRAPPERS=OFF -G "MinGW Makefiles" .. Error happens when running mingw32-make Error message is given as follows. Scanning dependencies of target RDGeneral [ 12%] Building CXX object Code/RDGeneral/CMakeFiles/RDGeneral.dir/Invariant.cpp.obj 'ccache' is not recognized as an internal or external command, operable program or batch file. Code\RDGeneral\CMakeFiles\RDGeneral.dir\build.make:62: recipe for target 'Code/RDGeneral/CMakeFiles/RDGeneral.dir/Invariant.cpp.obj' failed mingw32-make[2]: *** [Code/RDGeneral/CMakeFiles/RDGeneral.dir/Invariant.cpp.obj] Error 1 CMakeFiles\Makefile2:494: recipe for target 'Code/RDGeneral/CMakeFiles/RDGeneral.dir/all' failed mingw32-make[1]: *** [Code/RDGeneral/CMakeFiles/RDGeneral.dir/all] Error 2 Makefile:159: recipe for target 'all' failed mingw32-make: *** [all] Error 2 By the way, the information of compiler is given in the following. C:\software\RDKit\rdkit-Release_2016_09_2\build>g++ -v Reading specs from c:/mingw_win_build/bin/../lib/gcc/i686-w64-mingw32/4.8.3/specs COLLECT_GCC=g++ COLLECT_LTO_WRAPPER=c:/mingw_win_build/bin/../libexec/gcc/i686-w64-mingw32/4.8.3 /lto-wrapper.exe Target: i686-w64-mingw32 Configured with: ../gcc-4.8.3/configure --prefix=/opt/windows_32 --with-sysroot=/opt/windows_32 --libdir=/opt/windows_32/lib --mandir=/opt/windows_32/man --infodir=/opt/windows_32/info --enable-shared --disable-bootstrap --disable-multilib--with-arch=pentium3 --enable-threads=posix --enable-languages=c,c++ --enable-checking=release --enable-libgomp --with-system-zlib --with-python-dir=/lib/python2.7/site-packages --disable-libunwind-exceptions --enable-__cxa_atexit --enable-libssp --with-gnu-ld --verbose --enable-java-home --with-java-home=/opt/windows_32/lib/jvm/jre --with-jvm-root-dir=/opt/windows_32/lib/jvm --with-jvm-jar-dir=/opt/windows_32/lib/jvm/jvm-exports --with-arch-directory=amd64 --with-antlr-jar='/home/adrien/projects/win-builds-1.5/slackware64-current/d/gcc/antlr-*.jar' --disable-java-awt --disable-gtktest --build=x86_64-slackware-linux --host=i686-w64-mingw32 --target=i686-w64-mingw32 Thread model: posix gcc version 4.8.3 (GCC) Could you please give me any hints? Thank you very much in advance! Yingfeng -- Developer Access Program for Intel Xeon Phi Processors Access to Intel Xeon Phi processor-based developer platforms. With one year of Intel Parallel Studio XE. Training and support from Colfax. Order your platform today.http://sdm.link/intel___ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
Re: [Rdkit-discuss] link RDKit C++ libraries when using g++ on linux
Greg, I figure it out. I made two mistakes. Firstly, gcc4.8 should be used consistently. For example, it would make everything smooth, if I consistently use gcc4.8 when building boost and rdkit, and compiling my own code. Secondly, library linking part should be specified after source code. So the correct command should be make opt/gcc-4.8.2/usr/local/gcc-4.8.2/bin/g++ -O2 -std=c++11 -I/home/wyf/software/RDKit/rdkit-Release_2015_03_1/Code -I/home/wyf/software/RDKit/rdkit-Release_2015_03_1/lib -I/home/wyf/software/RDKit/rdkit-Release_2015_03_1/External -I/home/wyf/anaconda3/pkgs/boost-1.60.0-py27_0/include -I/home/wyf/projects/EGG/egg -o MIDAS main.cpp Database.cpp MidasCore.cpp ParseConfigure.cpp SettingInfo.cpp SpectrumUnit.cpp ParseSpectraFile.cpp /home/wyf/projects/EGG/egg/EggCore.cpp /home/wyf/projects/EGG/egg/FilesOperation.cpp /home/wyf/projects/EGG/egg/GML.cpp /home/wyf/projects/EGG/egg/GraphBasics.cpp /home/wyf/projects/EGG/egg/GraphGrammar.cpp /home/wyf/projects/EGG/egg/ParseRegularGraph.cpp /home/wyf/projects/EGG/egg/Production.cpp /home/wyf/projects/EGG/egg/ReadGML.cpp /home/wyf/projects/EGG/egg/ReadGrammar.cpp /home/wyf/projects/EGG/egg/ReadInputGraphs.cpp /home/wyf/projects/EGG/egg/RegularGraph.cpp -L/home/wyf/software/RDKit/rdkit-Release_2015_03_1/lib -lAlignment -lCatalogs -lChemReactions -lChemTransforms -lChemicalFeatures -lDataStructs -lDepictor -lDescriptors -lDistGeomHelpers -lDistGeometry -lEigenSolvers -lFMCS -lFileParsers -lFingerprints -lForceField -lForceFieldHelpers -lFragCatalog -lGraphMol -lhc -lInchi -lInfoTheory -lMolAlign -lMolCatalog -lMolChemicalFeatures -lMolDraw2D -lMolHash -lMolTransforms -lOptimizer -lPartialCharges -lRDBoost -lRDGeneral -lRDGeometryLib -lRDInchiLib -lSLNParse -lShapeHelpers -lSimDivPickers -lSmilesParse -lSubgraphs -lSubstructMatch -L/home/wyf/anaconda3/pkgs/boost-1.60.0-py27_0/lib -lboost_system -lboost_filesystem Hope my experience can help others to avoid the similar problem. Thanks. Yingfeng On Tue, May 31, 2016 at 10:22 PM, Yingfeng Wang <ywang...@gmail.com> wrote: > Greg, > > I want to update on you that I just use ctest to make sure that RDKit was > correctly installed. All tests are passed including testInchi. I still > can't figure out why Inchi related functions got undefined error. > > Thanks. > Yingfeng > > On Mon, May 30, 2016 at 9:36 AM, Yingfeng Wang <ywang...@gmail.com> wrote: > >> Greg, >> >> >> All errors happen in the process of compiling, which means I even cannot >> get the binary file to run on Ubuntu, although everything looks good with >> LLVM on Mac. The complete command is given as follows, >> >> make >> /opt/gcc-4.8.2/usr/local/gcc-4.8.2/bin/g++ -O2 -std=c++11 >> -I/home/wyf/software/RDKit/rdkit-Release_2015_03_1/Code >> -I/home/wyf/software/RDKit/rdkit-Release_2015_03_1/lib >> -I/home/wyf/software/RDKit/rdkit-Release_2015_03_1/External >> -I/home/wyf/anaconda3/pkgs/boost-1.60.0-py27_0/include >> -I/home/wyf/projects/EGG/egg >> -L/home/wyf/software/RDKit/rdkit-Release_2015_03_1/lib -lAlignment >> -lCatalogs -lChemReactions -lChemTransforms -lChemicalFeatures >> -lDataStructs -lDepictor -lDescriptors -lDistGeomHelpers -lDistGeometry >> -lEigenSolvers -lFMCS -lFileParsers -lFingerprints -lForceField >> -lForceFieldHelpers -lFragCatalog -lGraphMol -lhc -lInchi -lInfoTheory >> -lMolAlign -lMolCatalog -lMolChemicalFeatures -lMolDraw2D -lMolHash >> -lMolTransforms -lOptimizer -lPartialCharges -lRDBoost -lRDGeneral >> -lRDGeometryLib -lRDInchiLib -lSLNParse -lShapeHelpers -lSimDivPickers >> -lSmilesParse -lSubgraphs -lSubstructMatch >> -L/home/wyf/anaconda3/pkgs/boost-1.60.0-py27_0/lib -lboost_system >> -lboost_filesystem -o MIDAS main.cpp Database.cpp MidasCore.cpp >> ParseConfigure.cpp SettingInfo.cpp SpectrumUnit.cpp ParseSpectraFile.cpp >> /home/wyf/projects/EGG/egg/EggCore.cpp >> /home/wyf/projects/EGG/egg/FilesOperation.cpp >> /home/wyf/projects/EGG/egg/GML.cpp >> /home/wyf/projects/EGG/egg/GraphBasics.cpp >> /home/wyf/projects/EGG/egg/GraphGrammar.cpp >> /home/wyf/projects/EGG/egg/ParseRegularGraph.cpp >> /home/wyf/projects/EGG/egg/Production.cpp >> /home/wyf/projects/EGG/egg/ReadGML.cpp >> /home/wyf/projects/EGG/egg/ReadGrammar.cpp >> /home/wyf/projects/EGG/egg/ReadInputGraphs.cpp >> /home/wyf/projects/EGG/egg/RegularGraph.cpp >> >> where all the following files are codes implemented by myself. >> >> main.cpp Database.cpp MidasCore.cpp ParseConfigure.cpp SettingInfo.cpp >> SpectrumUnit.cpp ParseSpectraFile.cpp >> /home/wyf/projects/EGG/egg/EggCore.cpp >> /home/wyf/projects/EGG/egg/FilesOperation.cpp >> /home/wyf/projects/EGG/egg/GML.cpp >> /home/wyf/projects/EGG/egg/GraphBasics.cpp >>
Re: [Rdkit-discuss] link RDKit C++ libraries when using g++ on linux
Greg, All errors happen in the process of compiling, which means I even cannot get the binary file to run on Ubuntu, although everything looks good with LLVM on Mac. The complete command is given as follows, make /opt/gcc-4.8.2/usr/local/gcc-4.8.2/bin/g++ -O2 -std=c++11 -I/home/wyf/software/RDKit/rdkit-Release_2015_03_1/Code -I/home/wyf/software/RDKit/rdkit-Release_2015_03_1/lib -I/home/wyf/software/RDKit/rdkit-Release_2015_03_1/External -I/home/wyf/anaconda3/pkgs/boost-1.60.0-py27_0/include -I/home/wyf/projects/EGG/egg -L/home/wyf/software/RDKit/rdkit-Release_2015_03_1/lib -lAlignment -lCatalogs -lChemReactions -lChemTransforms -lChemicalFeatures -lDataStructs -lDepictor -lDescriptors -lDistGeomHelpers -lDistGeometry -lEigenSolvers -lFMCS -lFileParsers -lFingerprints -lForceField -lForceFieldHelpers -lFragCatalog -lGraphMol -lhc -lInchi -lInfoTheory -lMolAlign -lMolCatalog -lMolChemicalFeatures -lMolDraw2D -lMolHash -lMolTransforms -lOptimizer -lPartialCharges -lRDBoost -lRDGeneral -lRDGeometryLib -lRDInchiLib -lSLNParse -lShapeHelpers -lSimDivPickers -lSmilesParse -lSubgraphs -lSubstructMatch -L/home/wyf/anaconda3/pkgs/boost-1.60.0-py27_0/lib -lboost_system -lboost_filesystem -o MIDAS main.cpp Database.cpp MidasCore.cpp ParseConfigure.cpp SettingInfo.cpp SpectrumUnit.cpp ParseSpectraFile.cpp /home/wyf/projects/EGG/egg/EggCore.cpp /home/wyf/projects/EGG/egg/FilesOperation.cpp /home/wyf/projects/EGG/egg/GML.cpp /home/wyf/projects/EGG/egg/GraphBasics.cpp /home/wyf/projects/EGG/egg/GraphGrammar.cpp /home/wyf/projects/EGG/egg/ParseRegularGraph.cpp /home/wyf/projects/EGG/egg/Production.cpp /home/wyf/projects/EGG/egg/ReadGML.cpp /home/wyf/projects/EGG/egg/ReadGrammar.cpp /home/wyf/projects/EGG/egg/ReadInputGraphs.cpp /home/wyf/projects/EGG/egg/RegularGraph.cpp where all the following files are codes implemented by myself. main.cpp Database.cpp MidasCore.cpp ParseConfigure.cpp SettingInfo.cpp SpectrumUnit.cpp ParseSpectraFile.cpp /home/wyf/projects/EGG/egg/EggCore.cpp /home/wyf/projects/EGG/egg/FilesOperation.cpp /home/wyf/projects/EGG/egg/GML.cpp /home/wyf/projects/EGG/egg/GraphBasics.cpp /home/wyf/projects/EGG/egg/GraphGrammar.cpp /home/wyf/projects/EGG/egg/ParseRegularGraph.cpp /home/wyf/projects/EGG/egg/Production.cpp /home/wyf/projects/EGG/egg/ReadGML.cpp /home/wyf/projects/EGG/egg/ReadGrammar.cpp /home/wyf/projects/EGG/egg/ReadInputGraphs.cpp /home/wyf/projects/EGG/egg/RegularGraph.cpp The complete error message is /tmp/ccVylXhF.o: In function `Database::ROMol2GML(RDKit::ROMol const*)': Database.cpp:(.text+0x6f5): undefined reference to `_ZNK5RDKit4Atom9getSymbolB5cxx11Ev' /tmp/ccVylXhF.o: In function `Database::readOfficialDatabaseFile(std::basic_ifstream<char, std::char_traits >&, std::__cxx11::basic_string<char, std::char_traits, std::allocator >&)': Database.cpp:(.text+0x1f47): undefined reference to `RDKit::InchiToMol(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, RDKit::ExtraInchiReturnValues&, bool, bool)' /tmp/ccVylXhF.o: In function `Database::readInternalDatabaseFile(std::basic_ifstream<char, std::char_traits >&, std::__cxx11::basic_string<char, std::char_traits, std::allocator >&)': Database.cpp:(.text+0x3e83): undefined reference to `RDKit::InchiToMol(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, RDKit::ExtraInchiReturnValues&, bool, bool)' /tmp/cc8T3SzB.o: In function `SpectrumUnit::completeNewFrag(fragType*, fragType const*, std::vector<bondInfo, std::allocator > const&, bool const&)': SpectrumUnit.cpp:(.text+0x4276): undefined reference to `_ZN5RDKit11MolToSmilesB5cxx11ERKNS_5ROMolEbbibbb' /tmp/cc8T3SzB.o: In function `SpectrumUnit::scoreCompound(compoundType const*)': SpectrumUnit.cpp:(.text+0x62e2): undefined reference to `_ZN5RDKit11MolToSmilesB5cxx11ERKNS_5ROMolEbbibbb' collect2: error: ld returned 1 exit status make: *** [MIDAS_CPP] Error 1 It looks to me is a linking problem, but I don't know how to figure it out. Thanks. Yingfneg On Mon, May 30, 2016 at 9:00 AM, Greg Landrum <greg.land...@gmail.com> wrote: > Hi Yingfeng, > > The first thing to do is make sure that you're linking against the correct > libraries. > Are the error messages above from when you built your program (in which > case LD_LIBRARY_PATH has no effect) or when you ran it? > If it's when you linked: please show the entire command line that was > executed. > If it's when you ran the program: please show the results of "ldd EXENAME" > where EXENAME is the program you're running. > > Best. > -greg > > > On Mon, May 30, 2016 at 5:25 AM, Yingfeng Wang <ywang...@gmail.com> wrote: > >> I use the following setting for Apple LLVM version 6.0 (clang-600.0.57). >> >> CXXFLAGS= -Wall -O2 -std=c++11 -I ${RDBASE}/Code -I ${RDBASE}/lib -I >> ${RDBASE}/External -I ${BOOSTBA
[Rdkit-discuss] link RDKit C++ libraries when using g++ on linux
I use the following setting for Apple LLVM version 6.0 (clang-600.0.57). CXXFLAGS= -Wall -O2 -std=c++11 -I ${RDBASE}/Code -I ${RDBASE}/lib -I ${RDBASE}/External -I ${BOOSTBASE}/include LDFLAGS=-L${RDBASE}/lib -lAlignment -lCatalogs -lChemReactions -lChemTransforms -lChemicalFeatures -lDataStructs -lDepictor -lDescriptors -lDistGeomHelpers -lDistGeometry -lEigenSolvers -lFMCS -lFileParsers -lFingerprints -lForceField -lForceFieldHelpers -lFragCatalog -lGraphMol -lhc -lInchi -lInfoTheory -lMolAlign -lMolCatalog -lMolChemicalFeatures -lMolDraw2D -lMolHash -lMolTransforms -lOptimizer -lPartialCharges -lRDBoost -lRDGeneral -lRDGeometryLib -lRDInchiLib -lSLNParse -lShapeHelpers -lSimDivPickers -lSmilesParse -lSubgraphs -lSubstructMatch export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$RDBASE/lib It works perfectly. However, the similar setting doesn't work with g++ 4.8 on Ubuntu. The only difference is that I use LD_LIBRARY_PATH export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$RDBASE/lib I got undefined reference error. For example, /tmp/ccpvJQVN.o: In function `Database::ROMol2GML(RDKit::ROMol const*)': Database.cpp:(.text+0x6f5): undefined reference to `_ZNK5RDKit4Atom9getSymbolB5cxx11Ev' /tmp/ccpvJQVN.o: In function `Database::readOfficialDatabaseFile(std::basic_ifstream&, std::__cxx11::basic_string &)': Database.cpp:(.text+0x1f47): undefined reference to `RDKit::InchiToMol(std::__cxx11::basic_string const&, RDKit::ExtraInchiReturnValues&, bool, bool)' /tmp/ccpvJQVN.o: In function `Database::readInternalDatabaseFile(std::basic_ifstream &, std::__cxx11::basic_string &)': Database.cpp:(.text+0x3e83): undefined reference to `RDKit::InchiToMol(std::__cxx11::basic_string const&, RDKit::ExtraInchiReturnValues&, bool, bool)' Could anyone give me some hints for solving this problem? Thank you very much! Yingfeng -- What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic patterns at an interface-level. Reveals which users, apps, and protocols are consuming the most bandwidth. Provides multi-vendor support for NetFlow, J-Flow, sFlow and other flows. Make informed decisions using capacity planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e___ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
Re: [Rdkit-discuss] ring bond query
Brian, Thank you very much! It works. The updated code is given as follows. #include #include #include #include #include #include using namespace RDKit; using namespace std; int main(int argc, const char * argv[]) { RWMol* pCurMol; MolGraph curTopology; vector<vector > viiRingBonds; string sSmiles = "Oc1ncnnc1-c1c1"; list<boost::list_edge > >::const_iterator itEdge; pCurMol = SmilesToMol(sSmiles, 0, false); MolOps::findSSSR(*(pCurMol)); curTopology = pCurMol->getTopology(); viiRingBonds = pCurMol->getRingInfo()->bondRings(); for (itEdge = curTopology.m_edges.begin(); itEdge != curTopology.m_edges.end(); ++itEdge) if (queryIsBondInRing(itEdge->m_property.get())) cout<<"get one ring bond"<<endl; return 0; } On Wed, Apr 13, 2016 at 12:06 PM, Brian Kelley <fustiga...@gmail.com> wrote: > Not sure if it will help, but the python version of IsInRing checks to see > if the sssr is initialized. Here is the C++ code that is used, you may be > able to adapt it to your needs: > > bool BondIsInRing(const Bond *bond) { > if (!bond->getOwningMol().getRingInfo()->isInitialized()) { > MolOps::findSSSR(bond->getOwningMol()); > } > return bond->getOwningMol().getRingInfo()->numBondRings(bond->getIdx()) > != 0; > } > > > On Wed, Apr 13, 2016 at 11:59 AM, Yingfeng Wang <ywang...@gmail.com> > wrote: > >> Paolo, >> >> Thanks. As I mentioned in the end of my question, setting this flag true >> may cause other problems. In the python version, the sanitize flag is also >> false, but it works. Is it possible to figure out a workaround for checking >> whether each bond is in a ring in the C++ version? >> >> Best, >> Yingfeng >> >> On Wed, Apr 13, 2016 at 11:53 AM, Paolo Tosco <paolo.to...@unito.it> >> wrote: >> >>> Dear Yingfeng, >>> >>> the reason why RingInfo is not initialized is that you are invoking >>> SmilesToMol() with the sanitize flag set to false; setting that parameter >>> to true in the SmilesToMol() call should fix your problem. >>> >>> Kind regards, >>> Paolo >>> >>> >>> On 4/13/2016 16:48, Yingfeng Wang wrote: >>> >>> This is my C++ code. >>> >>> >>> #include >>> #include >>> #include >>> #include >>> #include >>> >>> using namespace RDKit; >>> using namespace std; >>> >>> int main(int argc, const char * argv[]) >>> { >>> RWMol* pCurMol; >>> MolGraph curTopology; >>> vector<vector > viiRingBonds; >>> string sSmiles = "Oc1ncnnc1-c1c1"; >>> list<boost::list_edge > >>> >::const_iterator itEdge; >>> >>> pCurMol = SmilesToMol(sSmiles, 0, false); >>> curTopology = pCurMol->getTopology(); >>> viiRingBonds = pCurMol->getRingInfo()->bondRings(); >>> for (itEdge = curTopology.m_edges.begin(); itEdge != >>> curTopology.m_edges.end(); ++itEdge) >>> if (queryIsBondInRing(itEdge->m_property.get())) >>> cout<<"get one ring bond"<<endl; >>> >>> return 0; >>> } >>> >>> It crashes in the following line >>> >>> queryIsBondInRing(itEdge->m_property.get()) >>> >>> with the following information. >>> >>> Pre-condition Violation >>> RingInfo not initialized >>> Violation occurred on line 67 in file >>> /Users/yingfeng/software/RDKit/rdkit-Release_2015_03_1/Code/GraphMol/RingInfo.cpp >>> Failed Expression: df_init >>> >>> >>> libc++abi.dylib: terminating with uncaught exception of type >>> Invar::Invariant: Pre-condition Violation >>> >>> >>> Actually, the corresponding python version works. >>> >>> >>> from rdkit import Chem >>> >>> sSmiles = "Oc1ncnnc1-c1c1" >>> >>> curMol =Chem.MolFromSmiles(sSmiles, False) >>> >>> iBondsNum = curMol.GetNumBonds() >>> >>> for i in range(iBondsNum): >>> ... current_bond = curMol.GetBondWithIdx(i) >>> ... if current_bond.IsInRing(): >>> ... print i >>> ... >>> 1 >>> 2 >>> 3 >>> 4 >>> 5 >>> 7 >>> 8 >>
Re: [Rdkit-discuss] ring bond query
Paolo, Thanks. As I mentioned in the end of my question, setting this flag true may cause other problems. In the python version, the sanitize flag is also false, but it works. Is it possible to figure out a workaround for checking whether each bond is in a ring in the C++ version? Best, Yingfeng On Wed, Apr 13, 2016 at 11:53 AM, Paolo Tosco <paolo.to...@unito.it> wrote: > Dear Yingfeng, > > the reason why RingInfo is not initialized is that you are invoking > SmilesToMol() with the sanitize flag set to false; setting that parameter > to true in the SmilesToMol() call should fix your problem. > > Kind regards, > Paolo > > > On 4/13/2016 16:48, Yingfeng Wang wrote: > > This is my C++ code. > > > #include > #include > #include > #include > #include > > using namespace RDKit; > using namespace std; > > int main(int argc, const char * argv[]) > { > RWMol* pCurMol; > MolGraph curTopology; > vector<vector > viiRingBonds; > string sSmiles = "Oc1ncnnc1-c1c1"; > list<boost::list_edge > > >::const_iterator itEdge; > > pCurMol = SmilesToMol(sSmiles, 0, false); > curTopology = pCurMol->getTopology(); > viiRingBonds = pCurMol->getRingInfo()->bondRings(); > for (itEdge = curTopology.m_edges.begin(); itEdge != > curTopology.m_edges.end(); ++itEdge) > if (queryIsBondInRing(itEdge->m_property.get())) > cout<<"get one ring bond"<<endl; > > return 0; > } > > It crashes in the following line > > queryIsBondInRing(itEdge->m_property.get()) > > with the following information. > > Pre-condition Violation > RingInfo not initialized > Violation occurred on line 67 in file > /Users/yingfeng/software/RDKit/rdkit-Release_2015_03_1/Code/GraphMol/RingInfo.cpp > Failed Expression: df_init > > > libc++abi.dylib: terminating with uncaught exception of type > Invar::Invariant: Pre-condition Violation > > > Actually, the corresponding python version works. > > >>> from rdkit import Chem > >>> sSmiles = "Oc1ncnnc1-c1c1" > >>> curMol =Chem.MolFromSmiles(sSmiles, False) > >>> iBondsNum = curMol.GetNumBonds() > >>> for i in range(iBondsNum): > ... current_bond = curMol.GetBondWithIdx(i) > ... if current_bond.IsInRing(): > ... print i > ... > 1 > 2 > 3 > 4 > 5 > 7 > 8 > 9 > 10 > 11 > 12 > 13 > > > Please note that the problem cannot be solved by using > SmilesToMol(sSmiles, 0, true); > > because it may cause other problems, e.g., > string sSmiles = "c.c"; > Therefore, I would like to stay with SmilesToMol(sSmiles, 0, false); > > Could you please give me some hints for fixing the C++ version, and > getting the similar results of the python version. > > > -- > Find and fix application performance issues faster with Applications Manager > Applications Manager provides deep performance insights into multiple tiers of > your business applications. It resolves application problems quickly and > reduces your MTTR. Get your free > trial!https://ad.doubleclick.net/ddm/clk/302982198;130105516;z > > > > ___ > Rdkit-discuss mailing > listRdkit-discuss@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/rdkit-discuss > > > -- Find and fix application performance issues faster with Applications Manager Applications Manager provides deep performance insights into multiple tiers of your business applications. It resolves application problems quickly and reduces your MTTR. Get your free trial! https://ad.doubleclick.net/ddm/clk/302982198;130105516;z___ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
Re: [Rdkit-discuss] GetMol and GetMolFrags in C++
David, Yes, it is very clear. I am confident to use the version Igor suggested now. Thanks. Yingfeng On Mon, Apr 11, 2016 at 8:36 AM, David Hall <li...@cowsandmilk.net> wrote: > When I want to replicate one of RDKit’s python functions in C++, I go to > the source. RDKit has very readable wrappers that make this a surprisingly > nice approach (many other pieces of software have pretty ugly wrappers, so > this is a major compliment to RDKit). > > For this, I think the source is: > > > https://github.com/rdkit/rdkit/blob/master/Code/GraphMol/Wrap/MolOps.cpp#L483 > > There is a nice if-else that shows you how to get the behaviors of asMols > = False, then asMols=True. There is obviously a little bit of manipulation > to get the output into python, but hopefully it is clear how one might make > a similar pure C++ function. > > -David > > > On Apr 11, 2016, at 8:24 AM, Yingfeng Wang <ywang...@gmail.com> wrote: > > lgor, > > Yes, this version looks good. But, I am wondering whether I can specify > asMols. I specify asMols in the python version of my tool, so I want to do > the same thing for getting the same result in my C++ code. Or could you > help me to confirm that the version you mentioned actually has the same > effect as asMols = true? > > Thanks. > Yingfeng > > On Sun, Apr 10, 2016 at 11:35 PM, Igor Filippov <igor.v.filip...@gmail.com > > wrote: > >> Did you want >> std::vector<boost::shared_ptr> <http://rdkit.org/docs/cppapi/classRDKit_1_1ROMol.html>> > >> RDKit::MolOps::getMolFrags ( const ROMol >> <http://rdkit.org/docs/cppapi/classRDKit_1_1ROMol.html> & *mol*, bool >> *sanitizeFrags* = true, >> by any chance? This will return a vector of ROMol's which correspond to >> the contiguous fragments. >> >> Igor >> >> >> On Sun, Apr 10, 2016 at 11:04 PM, Yingfeng Wang <ywang...@gmail.com> >> wrote: >> >>> Greg, >>> >>> Thanks. In python, I am using GetMolFrags by the following way, >>> >>> Chem.GetMolFrags(current_modified_mol, asMols=True, sanitizeFrags=False) >>> >>> However, there is not a version at the link you mentioned allows me to >>> specify asMols. Could you please give me more hints? >>> >>> Thanks. >>> Yingfeng >>> >>> On Sun, Apr 10, 2016 at 10:49 PM, Greg Landrum <greg.land...@gmail.com> >>> wrote: >>> >>>> >>>> >>>> On Mon, Apr 11, 2016 at 1:35 AM, Yingfeng Wang <ywang...@gmail.com> >>>> wrote: >>>>> >>>>> >>>>> Thanks. Say, the current RWMol object has 10 bonds, so ids of these >>>>> bonds should be from 1-10. Now, I remove one bond. How do I reset all nine >>>>> bonds with ids from 1-9 (if one or two atoms are gone with this bond, I >>>>> also want to reset the ids of these atoms). >>>>> >>>> >>>> You don't need to do that, it happens automatically >>>> >>>> >>>>> In addition, say, there are two fragments after one bond is removed. >>>>> How do I get these two fragments as mols. In python, I can use >>>>> Chem.GetMolFrags. But how do I get my job done in C++? >>>>> >>>> >>>> There are a number of different versions of MolOps::getMolFrags(), pick >>>> the on that does what you like: >>>> >>>> http://rdkit.org/docs/cppapi/namespaceRDKit_1_1MolOps.html#ad8100d785d32fb3c173b83949766b87b >>>> >>>> Since the Python and C++ function/method names are often similar to >>>> each other, a good way to find answers like this is to google for the name >>>> of the Python function you are looking for and look for the link to the C++ >>>> documentation in the results. >>>> >>>> Best, >>>> -greg >>>> >>> >>> >>> >>> -- >>> Find and fix application performance issues faster with Applications >>> Manager >>> Applications Manager provides deep performance insights into multiple >>> tiers of >>> your business applications. It resolves application problems quickly and >>> reduces your MTTR. Get your free trial! http://pubads.g.doubleclick.net/ >>> gampad/clk?id=1444514301=/ca-pub-7940484522588532 >>> <http://pubads.g.doubleclick.net/gampad/clk?id=1444514301=/ca-pub-7940484522588532> >>> _
Re: [Rdkit-discuss] GetMol and GetMolFrags in C++
lgor, Yes, this version looks good. But, I am wondering whether I can specify asMols. I specify asMols in the python version of my tool, so I want to do the same thing for getting the same result in my C++ code. Or could you help me to confirm that the version you mentioned actually has the same effect as asMols = true? Thanks. Yingfeng On Sun, Apr 10, 2016 at 11:35 PM, Igor Filippov <igor.v.filip...@gmail.com> wrote: > Did you want > std::vector<boost::shared_ptr <http://rdkit.org/docs/cppapi/classRDKit_1_1ROMol.html>> > > RDKit::MolOps::getMolFrags ( const ROMol > <http://rdkit.org/docs/cppapi/classRDKit_1_1ROMol.html> & *mol*, bool > *sanitizeFrags* = true, > by any chance? This will return a vector of ROMol's which correspond to > the contiguous fragments. > > Igor > > > On Sun, Apr 10, 2016 at 11:04 PM, Yingfeng Wang <ywang...@gmail.com> > wrote: > >> Greg, >> >> Thanks. In python, I am using GetMolFrags by the following way, >> >> Chem.GetMolFrags(current_modified_mol, asMols=True, sanitizeFrags=False) >> >> However, there is not a version at the link you mentioned allows me to >> specify asMols. Could you please give me more hints? >> >> Thanks. >> Yingfeng >> >> On Sun, Apr 10, 2016 at 10:49 PM, Greg Landrum <greg.land...@gmail.com> >> wrote: >> >>> >>> >>> On Mon, Apr 11, 2016 at 1:35 AM, Yingfeng Wang <ywang...@gmail.com> >>> wrote: >>>> >>>> >>>> Thanks. Say, the current RWMol object has 10 bonds, so ids of these >>>> bonds should be from 1-10. Now, I remove one bond. How do I reset all nine >>>> bonds with ids from 1-9 (if one or two atoms are gone with this bond, I >>>> also want to reset the ids of these atoms). >>>> >>> >>> You don't need to do that, it happens automatically >>> >>> >>>> In addition, say, there are two fragments after one bond is removed. >>>> How do I get these two fragments as mols. In python, I can use >>>> Chem.GetMolFrags. But how do I get my job done in C++? >>>> >>> >>> There are a number of different versions of MolOps::getMolFrags(), pick >>> the on that does what you like: >>> >>> http://rdkit.org/docs/cppapi/namespaceRDKit_1_1MolOps.html#ad8100d785d32fb3c173b83949766b87b >>> >>> Since the Python and C++ function/method names are often similar to each >>> other, a good way to find answers like this is to google for the name of >>> the Python function you are looking for and look for the link to the C++ >>> documentation in the results. >>> >>> Best, >>> -greg >>> >> >> >> >> -- >> Find and fix application performance issues faster with Applications >> Manager >> Applications Manager provides deep performance insights into multiple >> tiers of >> your business applications. It resolves application problems quickly and >> reduces your MTTR. Get your free trial! http://pubads.g.doubleclick.net/ >> gampad/clk?id=1444514301=/ca-pub-7940484522588532 >> <http://pubads.g.doubleclick.net/gampad/clk?id=1444514301=/ca-pub-7940484522588532> >> ___ >> Rdkit-discuss mailing list >> Rdkit-discuss@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss >> >> > -- Find and fix application performance issues faster with Applications Manager Applications Manager provides deep performance insights into multiple tiers of your business applications. It resolves application problems quickly and reduces your MTTR. Get your free trial! http://pubads.g.doubleclick.net/ gampad/clk?id=1444514301=/ca-pub-7940484522588532___ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
Re: [Rdkit-discuss] GetMol and GetMolFrags in C++
Greg, Thanks. In python, I am using GetMolFrags by the following way, Chem.GetMolFrags(current_modified_mol, asMols=True, sanitizeFrags=False) However, there is not a version at the link you mentioned allows me to specify asMols. Could you please give me more hints? Thanks. Yingfeng On Sun, Apr 10, 2016 at 10:49 PM, Greg Landrum <greg.land...@gmail.com> wrote: > > > On Mon, Apr 11, 2016 at 1:35 AM, Yingfeng Wang <ywang...@gmail.com> wrote: >> >> >> Thanks. Say, the current RWMol object has 10 bonds, so ids of these bonds >> should be from 1-10. Now, I remove one bond. How do I reset all nine bonds >> with ids from 1-9 (if one or two atoms are gone with this bond, I also want >> to reset the ids of these atoms). >> > > You don't need to do that, it happens automatically > > >> In addition, say, there are two fragments after one bond is removed. How >> do I get these two fragments as mols. In python, I can use >> Chem.GetMolFrags. But how do I get my job done in C++? >> > > There are a number of different versions of MolOps::getMolFrags(), pick > the on that does what you like: > > http://rdkit.org/docs/cppapi/namespaceRDKit_1_1MolOps.html#ad8100d785d32fb3c173b83949766b87b > > Since the Python and C++ function/method names are often similar to each > other, a good way to find answers like this is to google for the name of > the Python function you are looking for and look for the link to the C++ > documentation in the results. > > Best, > -greg > -- Find and fix application performance issues faster with Applications Manager Applications Manager provides deep performance insights into multiple tiers of your business applications. It resolves application problems quickly and reduces your MTTR. Get your free trial! http://pubads.g.doubleclick.net/ gampad/clk?id=1444514301=/ca-pub-7940484522588532___ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
Re: [Rdkit-discuss] GetMol and GetMolFrags in C++
Brian, Thanks. Say, the current RWMol object has 10 bonds, so ids of these bonds should be from 1-10. Now, I remove one bond. How do I reset all nine bonds with ids from 1-9 (if one or two atoms are gone with this bond, I also want to reset the ids of these atoms). In addition, say, there are two fragments after one bond is removed. How do I get these two fragments as mols. In python, I can use Chem.GetMolFrags. But how do I get my job done in C++? Again, thank you very much! Yingfeng On Sun, Apr 10, 2016 at 6:31 PM, Brian Kelley <fustiga...@gmail.com> wrote: > In C++ you don't have to, RWMol can be sent to any function that takes an > ROMol. > > Actually, this is true now in Python as well. > > In C++ if you really need to copy the molecule: > > ROMol mol = new ROMol( *rwmol ); > > But you really don't have to. > > > Brian Kelley > > > On Apr 10, 2016, at 6:27 PM, Yingfeng Wang <ywang...@gmail.com> wrote: > > > > In python, I have GetMol() for Chem.EditableMol. I can also use > Chem.GetMolFrags(...). Could you please help me to know how to get similar > functions in C++? > > > > For example, I remove two bonds in an RWMol object, how do I use > GetMol() and GetMolFrags(...) in C++? > > > > Thanks. > > > > Yingfeng > > > -- > > Find and fix application performance issues faster with Applications > Manager > > Applications Manager provides deep performance insights into multiple > tiers of > > your business applications. It resolves application problems quickly and > > reduces your MTTR. Get your free trial! http://pubads.g.doubleclick.net/ > > gampad/clk?id=1444514301=/ca-pub-7940484522588532 > > ___ > > Rdkit-discuss mailing list > > Rdkit-discuss@lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/rdkit-discuss > -- Find and fix application performance issues faster with Applications Manager Applications Manager provides deep performance insights into multiple tiers of your business applications. It resolves application problems quickly and reduces your MTTR. Get your free trial! http://pubads.g.doubleclick.net/ gampad/clk?id=1444514301=/ca-pub-7940484522588532___ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
[Rdkit-discuss] GetMol and GetMolFrags in C++
In python, I have GetMol() for Chem.EditableMol. I can also use Chem.GetMolFrags(...). Could you please help me to know how to get similar functions in C++? For example, I remove two bonds in an RWMol object, how do I use GetMol() and GetMolFrags(...) in C++? Thanks. Yingfeng -- Find and fix application performance issues faster with Applications Manager Applications Manager provides deep performance insights into multiple tiers of your business applications. It resolves application problems quickly and reduces your MTTR. Get your free trial! http://pubads.g.doubleclick.net/ gampad/clk?id=1444514301=/ca-pub-7940484522588532___ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
Re: [Rdkit-discuss] compiling error with C++ on maverick
Brian, I think this is a good idea. Basically, I want to address the following two situations: 1) A user wants to compile my C++ source code. I want to provide my source code and Makefile, and remind to install RDKit first (I don't think we need to mention boost, which is required by RDKit). 2) A user wants to use the binary file of my tool. So I want to use a CMakeList.txt to generate a Makefile, which can compile my code into a stand alone binary file without additional installation of boost and RDKit. I will distribute these binary files. I don't think users will be sensitive to sizes of these binary files, if they don't need to worry about boost and RDKit. Thanks. Yingfeng On Wed, Mar 16, 2016 at 10:03 AM, Brian Kelley <fustiga...@gmail.com> wrote: > One thing we could fairly easily set up is a "companion" CMakeLists.txt > for a sample C++ project that builds a test project against a built > distribution. It could prove useful as a basis for building C++ extensions. > > Basically we would hedge our bets and just link against everything :) > > Cheers, > Brian > > On Wed, Mar 16, 2016 at 8:47 AM, Yingfeng Wang <ywang...@gmail.com> wrote: > >> Riccardo, >> >> Thank you very much! >> >> Yingfeng >> >> On Wed, Mar 16, 2016 at 4:08 AM, Riccardo Vianello < >> riccardo.viane...@gmail.com> wrote: >> >>> Hi Yingfeng, >>> >>> do you use cmake to build your own project? in case you did, some cmake >>> configuration files are usually installed together with the RDKit libraries >>> and may help manage these details: >>> >>> rdkit-config.cmake >>> rdkit-config-version.cmake >>> rdkit-targets.cmake >>> rdkit-targets-release.cmake >>> >>> The location of these files (matching the libraries installation path in >>> the current RDKit version) should be passed on the cmake command line: >>> >>> $ cmake -D RDKit_DIR=/rdkit/libraries/installation/path/lib [...] >>> >>> And the CMakeLists.txt script can then use the information from these >>> files to configure the build: >>> >>> find_package(RDKit REQUIRED) >>> include_directories(${RDKit_INCLUDE_DIRS}) >>> [...] >>> add_library(mylibrary [...]) >>> target_link_libraries(mylibrary Descriptors Fingerprints GraphMol) >>> >>> Specifying the most direct dependencies should be usually sufficient, >>> and cmake should be able to complement this information with the target >>> dependencies originally collected during the RDKit build and then tracked >>> in the configuration files. >>> >>> Best, >>> Riccardo >>> >>> >> >> >> -- >> Transform Data into Opportunity. >> Accelerate data analysis in your applications with >> Intel Data Analytics Acceleration Library. >> Click to learn more. >> http://pubads.g.doubleclick.net/gampad/clk?id=278785231=/4140 >> ___ >> Rdkit-discuss mailing list >> Rdkit-discuss@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss >> >> > -- Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. http://pubads.g.doubleclick.net/gampad/clk?id=278785231=/4140___ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
Re: [Rdkit-discuss] compiling error with C++ on maverick
Peter, Thanks. Do you mean -lLibA_static -lLibB_static -lLibC_static -lLibA_static -lLibB_static -lLibC_static ? So, by this way, we don't need to worry about the order of these three libraries. Best, Yingfeng On Wed, Mar 16, 2016 at 12:36 AM, Peter S. Shenkin <shen...@gmail.com> wrote: > I'm not sure how this works with modern linkers, but "back in the old > days", you could kludge it by putting all libraries on the link line twice, > This also resolved circular references. > > -P. > > On Wed, Mar 16, 2016 at 12:05 AM, Greg Landrum <greg.land...@gmail.com> > wrote: > >> Though that would be useful information, I'm afraid that's not something >> I've ever put together. >> >> -greg >> >> >> >> On Tue, Mar 15, 2016 at 6:26 PM, Yingfeng Wang <ywang...@gmail.com> >> wrote: >> >>> Greg, >>> >>> Could you please give me an order of all libraries? Say, I want to link >>> all RDKit static libraries. I know most of which could be unnecessary, but >>> I just want to make my situation easy. So, if I cannot figure out a better >>> plan, this way at least works. >>> >>> Thanks. >>> Yingfeng >>> >>> On Mon, Mar 14, 2016 at 8:16 AM, Greg Landrum <greg.land...@gmail.com> >>> wrote: >>> >>>> >>>> >>>> On Sat, Mar 12, 2016 at 5:00 AM, Yingfeng Wang <ywang...@gmail.com> >>>> wrote: >>>> >>>>> Greg, >>>>> >>>>> Thanks. Your suggestion solves my problem. I add the following part in >>>>> my compiling command. >>>>> >>>>> -L/Users/yingfeng/software/RDKit/rdkit-Release_2015_03_1/lib >>>>> -lRDInchiLib -lInChi -lGraphMol -lRDGeneral >>>>> >>>>> and the complete compiling command is >>>>> >>>>> g++ -Wall -O2 -std=c++11 -I >>>>> /Users/yingfeng/software/RDKit/rdkit-Release_2015_03_1/Code -I >>>>> /Users/yingfeng/software/RDKit/rdkit-Release_2015_03_1/External -I >>>>> /usr/local/Cellar/boost/1.60.0_1/include >>>>> -L/Users/yingfeng/software/RDKit/rdkit-Release_2015_03_1/lib -lRDInchiLib >>>>> -lInChi -lGraphMol -lRDGeneral -o MYTEST main.cpp >>>>> >>>>> Is there a way to figure out which library I should link? Actually, my >>>>> backup plan is to link all libraries in >>>>> /Users/yingfeng/software/RDKit/rdkit-Release_2015_03_1/lib >>>>> >>>> >>>> That's one approach, but it's kind of overkill. :-) >>>> The big thing is to know which library the functionality you are >>>> calling comes from. You can generally tell this from the header files (i.e. >>>> if you include something from "DataStructs", then you need to include the >>>> DataStructs library). this isn't perfect because some libraries have >>>> dependencies on others, but it often works The other approach is to look in >>>> the RDKit source code at the CMakeLists.txt file for the libraries you are >>>> using and look to see which extra libraries they include when building the >>>> tests. >>>> >>>> This isn't very well documented. I think this kind of documentation is >>>> tricky to generate, so I don't want to do it unless it's going to help a >>>> large number of people, and it's not at all clear to me how many C++ RDKit >>>> users there are. >>>> >>>> By the way, is there a way to guarantee that users using my binary file >>>>> (e.g. MYTEST in this case) do not need to install RDKit? I tried -static, >>>>> but it didn't work. For example, I hope a user can run MYTEST on another >>>>> Mac without RDKit. >>>>> >>>> >>>> If you link against the _static version of the libraries (i.e. >>>> -lGraphMol_static instead of -lGraphMol), then you should end up with a >>>> version that doesn't require an RDKit install to run. It can be trickier to >>>> get these commands right because on many (all?) systems, there is an order >>>> dependency to static linkage. So since SmilesParse_static depends on >>>> GraphMol_static, GraphMol_static needs to appear *after* SmilesParse_static >>>> in the link line. >>>> >>>> I hope this helps, >>>> -greg >>>> >>>> >>>> >>> >> >> >> -- >> Transform Data into Opportunity. >> Accelerate data analysis in your applications with >> Intel Data Analytics Acceleration Library. >> Click to learn more. >> http://pubads.g.doubleclick.net/gampad/clk?id=278785231=/4140 >> ___ >> Rdkit-discuss mailing list >> Rdkit-discuss@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss >> >> > -- Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. http://pubads.g.doubleclick.net/gampad/clk?id=278785231=/4140___ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
Re: [Rdkit-discuss] compiling error with C++ on maverick
Peter, Thanks. This is a PERFECT general solution to all of this kind of headaches! Best, Yingfeng On Wed, Mar 16, 2016 at 10:27 AM, Peter S. Shenkin <shen...@gmail.com> wrote: > Yes, that's exactly what I meant. I'm not sure whether this sort of thing > still works in our troubled times, but it's easy enough to try. > > -P. > > On Wed, Mar 16, 2016 at 8:46 AM, Yingfeng Wang <ywang...@gmail.com> wrote: > >> Peter, >> >> Thanks. Do you mean >> >> -lLibA_static -lLibB_static -lLibC_static -lLibA_static -lLibB_static >> -lLibC_static >> >> ? >> >> So, by this way, we don't need to worry about the order of these three >> libraries. >> >> Best, >> Yingfeng >> >> On Wed, Mar 16, 2016 at 12:36 AM, Peter S. Shenkin <shen...@gmail.com> >> wrote: >> >>> I'm not sure how this works with modern linkers, but "back in the old >>> days", you could kludge it by putting all libraries on the link line twice, >>> This also resolved circular references. >>> >>> -P. >>> >>> On Wed, Mar 16, 2016 at 12:05 AM, Greg Landrum <greg.land...@gmail.com> >>> wrote: >>> >>>> Though that would be useful information, I'm afraid that's not >>>> something I've ever put together. >>>> >>>> -greg >>>> >>>> >>>> >>>> On Tue, Mar 15, 2016 at 6:26 PM, Yingfeng Wang <ywang...@gmail.com> >>>> wrote: >>>> >>>>> Greg, >>>>> >>>>> Could you please give me an order of all libraries? Say, I want to >>>>> link all RDKit static libraries. I know most of which could be >>>>> unnecessary, >>>>> but I just want to make my situation easy. So, if I cannot figure out a >>>>> better plan, this way at least works. >>>>> >>>>> Thanks. >>>>> Yingfeng >>>>> >>>>> On Mon, Mar 14, 2016 at 8:16 AM, Greg Landrum <greg.land...@gmail.com> >>>>> wrote: >>>>> >>>>>> >>>>>> >>>>>> On Sat, Mar 12, 2016 at 5:00 AM, Yingfeng Wang <ywang...@gmail.com> >>>>>> wrote: >>>>>> >>>>>>> Greg, >>>>>>> >>>>>>> Thanks. Your suggestion solves my problem. I add the following part >>>>>>> in my compiling command. >>>>>>> >>>>>>> -L/Users/yingfeng/software/RDKit/rdkit-Release_2015_03_1/lib >>>>>>> -lRDInchiLib -lInChi -lGraphMol -lRDGeneral >>>>>>> >>>>>>> and the complete compiling command is >>>>>>> >>>>>>> g++ -Wall -O2 -std=c++11 -I >>>>>>> /Users/yingfeng/software/RDKit/rdkit-Release_2015_03_1/Code -I >>>>>>> /Users/yingfeng/software/RDKit/rdkit-Release_2015_03_1/External -I >>>>>>> /usr/local/Cellar/boost/1.60.0_1/include >>>>>>> -L/Users/yingfeng/software/RDKit/rdkit-Release_2015_03_1/lib >>>>>>> -lRDInchiLib >>>>>>> -lInChi -lGraphMol -lRDGeneral -o MYTEST main.cpp >>>>>>> >>>>>>> Is there a way to figure out which library I should link? Actually, >>>>>>> my backup plan is to link all libraries in >>>>>>> /Users/yingfeng/software/RDKit/rdkit-Release_2015_03_1/lib >>>>>>> >>>>>> >>>>>> That's one approach, but it's kind of overkill. :-) >>>>>> The big thing is to know which library the functionality you are >>>>>> calling comes from. You can generally tell this from the header files >>>>>> (i.e. >>>>>> if you include something from "DataStructs", then you need to include the >>>>>> DataStructs library). this isn't perfect because some libraries have >>>>>> dependencies on others, but it often works The other approach is to look >>>>>> in >>>>>> the RDKit source code at the CMakeLists.txt file for the libraries you >>>>>> are >>>>>> using and look to see which extra libraries they include when building >>>>>> the >>>>>> tests. >>>>>> >>>>>> This isn't very well documented. I think this kind of documentation >>>>>> is tricky to generate, so
Re: [Rdkit-discuss] compiling error with C++ on maverick
Greg, Could you please give me an order of all libraries? Say, I want to link all RDKit static libraries. I know most of which could be unnecessary, but I just want to make my situation easy. So, if I cannot figure out a better plan, this way at least works. Thanks. Yingfeng On Mon, Mar 14, 2016 at 8:16 AM, Greg Landrum <greg.land...@gmail.com> wrote: > > > On Sat, Mar 12, 2016 at 5:00 AM, Yingfeng Wang <ywang...@gmail.com> wrote: > >> Greg, >> >> Thanks. Your suggestion solves my problem. I add the following part in my >> compiling command. >> >> -L/Users/yingfeng/software/RDKit/rdkit-Release_2015_03_1/lib >> -lRDInchiLib -lInChi -lGraphMol -lRDGeneral >> >> and the complete compiling command is >> >> g++ -Wall -O2 -std=c++11 -I >> /Users/yingfeng/software/RDKit/rdkit-Release_2015_03_1/Code -I >> /Users/yingfeng/software/RDKit/rdkit-Release_2015_03_1/External -I >> /usr/local/Cellar/boost/1.60.0_1/include >> -L/Users/yingfeng/software/RDKit/rdkit-Release_2015_03_1/lib -lRDInchiLib >> -lInChi -lGraphMol -lRDGeneral -o MYTEST main.cpp >> >> Is there a way to figure out which library I should link? Actually, my >> backup plan is to link all libraries in >> /Users/yingfeng/software/RDKit/rdkit-Release_2015_03_1/lib >> > > That's one approach, but it's kind of overkill. :-) > The big thing is to know which library the functionality you are calling > comes from. You can generally tell this from the header files (i.e. if you > include something from "DataStructs", then you need to include the > DataStructs library). this isn't perfect because some libraries have > dependencies on others, but it often works The other approach is to look in > the RDKit source code at the CMakeLists.txt file for the libraries you are > using and look to see which extra libraries they include when building the > tests. > > This isn't very well documented. I think this kind of documentation is > tricky to generate, so I don't want to do it unless it's going to help a > large number of people, and it's not at all clear to me how many C++ RDKit > users there are. > > By the way, is there a way to guarantee that users using my binary file >> (e.g. MYTEST in this case) do not need to install RDKit? I tried -static, >> but it didn't work. For example, I hope a user can run MYTEST on another >> Mac without RDKit. >> > > If you link against the _static version of the libraries (i.e. > -lGraphMol_static instead of -lGraphMol), then you should end up with a > version that doesn't require an RDKit install to run. It can be trickier to > get these commands right because on many (all?) systems, there is an order > dependency to static linkage. So since SmilesParse_static depends on > GraphMol_static, GraphMol_static needs to appear *after* SmilesParse_static > in the link line. > > I hope this helps, > -greg > > > -- Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. http://pubads.g.doubleclick.net/gampad/clk?id=278785231=/4140___ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
Re: [Rdkit-discuss] compiling error with C++ on maverick
Greg, Thanks. Your suggestion solves my problem. I add the following part in my compiling command. -L/Users/yingfeng/software/RDKit/rdkit-Release_2015_03_1/lib -lRDInchiLib -lInChi -lGraphMol -lRDGeneral and the complete compiling command is g++ -Wall -O2 -std=c++11 -I /Users/yingfeng/software/RDKit/rdkit-Release_2015_03_1/Code -I /Users/yingfeng/software/RDKit/rdkit-Release_2015_03_1/External -I /usr/local/Cellar/boost/1.60.0_1/include -L/Users/yingfeng/software/RDKit/rdkit-Release_2015_03_1/lib -lRDInchiLib -lInChi -lGraphMol -lRDGeneral -o MYTEST main.cpp Is there a way to figure out which library I should link? Actually, my backup plan is to link all libraries in /Users/yingfeng/software/RDKit/rdkit-Release_2015_03_1/lib By the way, is there a way to guarantee that users using my binary file (e.g. MYTEST in this case) do not need to install RDKit? I tried -static, but it didn't work. For example, I hope a user can run MYTEST on another Mac without RDKit. Again, thank you very much for your help! Yingfeng On Fri, Mar 11, 2016 at 11:48 PM, Greg Landrum <greg.land...@gmail.com> wrote: > Yingfeng, > > you have forgotten to link against the rdkit libraries. If you are using > the InChI code, you need to link against: RDInchiLib, InChi, GraphMol, and > RDGeneral. There may be a few others as well. > > -greg > > > > > > On Sat, Mar 12, 2016 at 5:13 AM, Yingfeng Wang <ywang...@gmail.com> wrote: > >> After installing RDKit, I try to compile the following code in main.cpp, >> >> #include >> #include >> >> using namespace RDKit; >> using namespace std; >> >> int main(int argc, const char * argv[]) { >> string curInchi = >> "InChI=1S/C10H9N3O/c1-7-11-10(14)9(13-12-7)8-5-3-2-4-6-8/h2-6H,1H3,(H,11,12,14)"; >> InchiToInchiKey(curInchi); >> //cout << "Hello, World!" << endl; >> return 0; >> } >> >> with the following command, >> >> g++ -Wall -O2 -std=c++11 -I >> /Users/yingfeng/software/RDKit/rdkit-Release_2015_03_1/Code -I >> /Users/yingfeng/software/RDKit/rdkit-Release_2015_03_1/External -I >> /usr/local/Cellar/boost/1.60.0_1/include -o MYTEST main.cpp >> >> on my maverick Macbook. The RDKit has been installed at >> >> /Users/yingfeng/software/RDKit/rdkit-Release_2015_03_1/ >> >> while boost is at >> /usr/local/Cellar/boost/1.60.0_1/ >> >> The compiler information is >> >> g++ -v >> Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr >> --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/c++/4.2.1 >> Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn) >> Target: x86_64-apple-darwin13.4.0 >> Thread model: posix >> >> However, I got the following the error message. >> >> Undefined symbols for architecture x86_64: >> "RDKit::InchiToInchiKey(std::__1::basic_string<char, >> std::__1::char_traits, std::__1::allocator > const&)", >> referenced from: >> _main in main-dd8650.o >> ld: symbol(s) not found for architecture x86_64 >> clang: error: linker command failed with exit code 1 (use -v to see >> invocation) >> >> I am very sure inchi.h and inchi.cpp are available at >> /Users/yingfeng/software/RDKit/rdkit-Release_2015_03_1/External/INCHI-API/ >> >> and function >> std::string InchiToInchiKey(const std::string ) >> >> is defined in inchi.cpp. >> >> Could you please give me some hints for solving this problem? >> >> Thanks. >> >> Yingfeng >> >> >> -- >> Transform Data into Opportunity. >> Accelerate data analysis in your applications with >> Intel Data Analytics Acceleration Library. >> Click to learn more. >> http://pubads.g.doubleclick.net/gampad/clk?id=278785111=/4140 >> ___ >> Rdkit-discuss mailing list >> Rdkit-discuss@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss >> >> > -- Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. http://pubads.g.doubleclick.net/gampad/clk?id=278785111=/4140___ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
[Rdkit-discuss] compiling error with C++ on maverick
After installing RDKit, I try to compile the following code in main.cpp, #include #include using namespace RDKit; using namespace std; int main(int argc, const char * argv[]) { string curInchi = "InChI=1S/C10H9N3O/c1-7-11-10(14)9(13-12-7)8-5-3-2-4-6-8/h2-6H,1H3,(H,11,12,14)"; InchiToInchiKey(curInchi); //cout << "Hello, World!" << endl; return 0; } with the following command, g++ -Wall -O2 -std=c++11 -I /Users/yingfeng/software/RDKit/rdkit-Release_2015_03_1/Code -I /Users/yingfeng/software/RDKit/rdkit-Release_2015_03_1/External -I /usr/local/Cellar/boost/1.60.0_1/include -o MYTEST main.cpp on my maverick Macbook. The RDKit has been installed at /Users/yingfeng/software/RDKit/rdkit-Release_2015_03_1/ while boost is at /usr/local/Cellar/boost/1.60.0_1/ The compiler information is g++ -v Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/c++/4.2.1 Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn) Target: x86_64-apple-darwin13.4.0 Thread model: posix However, I got the following the error message. Undefined symbols for architecture x86_64: "RDKit::InchiToInchiKey(std::__1::basic_stringconst&)", referenced from: _main in main-dd8650.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) I am very sure inchi.h and inchi.cpp are available at /Users/yingfeng/software/RDKit/rdkit-Release_2015_03_1/External/INCHI-API/ and function std::string InchiToInchiKey(const std::string ) is defined in inchi.cpp. Could you please give me some hints for solving this problem? Thanks. Yingfeng -- Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. http://pubads.g.doubleclick.net/gampad/clk?id=278785111=/4140___ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
Re: [Rdkit-discuss] identify anti-aromatic bonds
Greg, Thanks. Yingfeng On Fri, Aug 28, 2015 at 6:13 AM, Greg Landrum greg.land...@gmail.com wrote: Well, here's a way to find the rings where all of the bonds are conjugated: In [1]: from rdkit import Chem In [2]: m = Chem.MolFromSmiles('C1CC1CC(=O)c1nnc2cc(-c3ccc(OC)cc3)nn2c1CC') In [3]: ri = m.GetRingInfo() In [4]: brs = ri.BondRings() In [5]: conjugatedRings = [] In [6]: for i,br in enumerate(brs): conj=True for b in br: if not m.GetBondWithIdx(b).GetIsConjugated(): conj=False break if conj: conjugatedRings.append(i) ...: Then, using those indices, you can find the lists of atoms that are in each of those conjugated rings: In [7]: ars = ri.AtomRings() In [8]: conjugatedAtomRings = [ars[x] for x in conjugatedRings] In [9]: len(ars) Out[9]: 4 In [10]: len(conjugatedAtomRings) Out[10]: 3 In [11]: conjugatedAtomRings Out[11]: [(7, 8, 9, 21, 22, 6), (10, 9, 21, 20, 11), (13, 14, 15, 18, 19, 12)] From this point it's a matter of deciding how you want to count electrons from each atom. The approach used in the RDKit C++ code is described, more or less accurately, here: http://rdkit.org/docs/RDKit_Book.html#aromaticity -greg On Thu, Aug 27, 2015 at 5:36 PM, Yingfeng Wang ywang...@gmail.com wrote: Greg, Thanks. I believe identifying anti-aromatic bonds even just with simple rings will be very helpful to my project. Could you please give me some links or sample codes about identifying all the conjugated simple rings and do an electron count? Would you also like to share me some relevant rules you think could be reasonable? By the way, if there is a hard way to identify all anti-aromatic bonds, could you also please give me some hints? If fortunately I can implement it, I will share it by posting my code in this mailing list. Thanks. Yingfeng On Thu, Aug 27, 2015 at 10:08 AM, Greg Landrum greg.land...@gmail.com wrote: Hi Yingfeng, Non-aromatic is not a problem, but there's no easy way I can think of off the top of my head for identifying anti-aromatic systems without making C++ code changes. If you were willing to limit yourself to simple rings, you could write some python code to identify all the conjugated simple rings and do an electron count according to whatever rules you think are relevant. -greg On Thu, Aug 27, 2015 at 1:52 PM, Yingfeng Wang ywang...@gmail.com wrote: Could anyone please share your experience with identifying non-aromatic bonds using RDKit? I would greatly appreciate your help. Yingfeng On Mon, Aug 24, 2015 at 9:42 PM, Yingfeng Wang ywang...@gmail.com wrote: Sorry, my previous email has a typo. According to the following link, http://www.rdkit.org/docs/RDKit_Book.html I get sample code for identifying aromatic bonds like from rdkit import Chem m=Chem.MolFromSmiles('O=C1C=CC(=O)C2=C1OC=CO2') m.GetBondBetweenAtoms(6,7).GetIsAromatic() Is there a way to identify anti-aromatic bonds using Rdkit? Thanks. Yingfeng On Mon, Aug 24, 2015 at 9:38 PM, Yingfeng Wang ywang...@gmail.com wrote: According to the following link, http://www.rdkit.org/docs/RDKit_Book.html I get sample code for identifying identify anti-aromatic bonds like from rdkit import Chem m=Chem.MolFromSmiles('O=C1C=CC(=O)C2=C1OC=CO2') m.GetBondBetweenAtoms(6,7).GetIsAromatic() Is there a way to identify anti-aromatic bonds using Rdkit? Thanks. Yingfeng -- ___ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss -- ___ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
Re: [Rdkit-discuss] identify anti-aromatic bonds
Could anyone please share your experience with identifying non-aromatic bonds using RDKit? I would greatly appreciate your help. Yingfeng On Mon, Aug 24, 2015 at 9:42 PM, Yingfeng Wang ywang...@gmail.com wrote: Sorry, my previous email has a typo. According to the following link, http://www.rdkit.org/docs/RDKit_Book.html I get sample code for identifying aromatic bonds like from rdkit import Chem m=Chem.MolFromSmiles('O=C1C=CC(=O)C2=C1OC=CO2') m.GetBondBetweenAtoms(6,7).GetIsAromatic() Is there a way to identify anti-aromatic bonds using Rdkit? Thanks. Yingfeng On Mon, Aug 24, 2015 at 9:38 PM, Yingfeng Wang ywang...@gmail.com wrote: According to the following link, http://www.rdkit.org/docs/RDKit_Book.html I get sample code for identifying identify anti-aromatic bonds like from rdkit import Chem m=Chem.MolFromSmiles('O=C1C=CC(=O)C2=C1OC=CO2') m.GetBondBetweenAtoms(6,7).GetIsAromatic() Is there a way to identify anti-aromatic bonds using Rdkit? Thanks. Yingfeng -- ___ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
[Rdkit-discuss] identify anti-aromatic bonds
According to the following link, http://www.rdkit.org/docs/RDKit_Book.html I get sample code for identifying identify anti-aromatic bonds like from rdkit import Chem m=Chem.MolFromSmiles('O=C1C=CC(=O)C2=C1OC=CO2') m.GetBondBetweenAtoms(6,7).GetIsAromatic() Is there a way to identify anti-aromatic bonds using Rdkit? Thanks. Yingfeng -- ___ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
Re: [Rdkit-discuss] identify anti-aromatic bonds
Sorry, my previous email has a typo. According to the following link, http://www.rdkit.org/docs/RDKit_Book.html I get sample code for identifying aromatic bonds like from rdkit import Chem m=Chem.MolFromSmiles('O=C1C=CC(=O)C2=C1OC=CO2') m.GetBondBetweenAtoms(6,7).GetIsAromatic() Is there a way to identify anti-aromatic bonds using Rdkit? Thanks. Yingfeng On Mon, Aug 24, 2015 at 9:38 PM, Yingfeng Wang ywang...@gmail.com wrote: According to the following link, http://www.rdkit.org/docs/RDKit_Book.html I get sample code for identifying identify anti-aromatic bonds like from rdkit import Chem m=Chem.MolFromSmiles('O=C1C=CC(=O)C2=C1OC=CO2') m.GetBondBetweenAtoms(6,7).GetIsAromatic() Is there a way to identify anti-aromatic bonds using Rdkit? Thanks. Yingfeng -- ___ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
Re: [Rdkit-discuss] generate 2D figure
Adrian, Thanks. Actually, 'c1cc[nH]c1' is a fragment. I have a aromatic molecule, and break one ring bond. RDKit returns the Smiles format of the fragment. And I want to draw this fragment. In this case, it is 'c1cc[nH]c1'. So I am wondering whether there is a way to draw this kind of fragments. Again, thank you very much for your help. Yingfeng On Thu, Feb 20, 2014 at 7:09 AM, Adrian Jasiński jasinski.adr...@gmail.comwrote: m = Chem.MolFromSmiles('ccc[nH]c', sanitize=False) I think that in this example there is a problem with your SMILES. Why you use lower case? In SMILES format it's a aromatic molecule but you don't have the beginning and ending of aromatic bond noted by number. If you have aromatic molecule you should write it like that: m = Chem.MolFromSmiles('c1cc[nH]c1') if it is not aromatic than use upper case: m = Chem.MolFromSmiles('CCC[NH]C') and than try: AllChem.Compute2DCoords(m) for second example: m = Chem.MolFromSmiles('C(=O)OCCO') AllChem.Compute2DCoords(m) 2014-02-19 21:46 GMT+01:00 Yingfeng Wang ywang...@gmail.com: Here are more details. If I use m = Chem.MolFromSmiles('ccc[nH]c', sanitize=False) AllChem.Compute2DCoords(m) It works. But I get trouble with m = Chem.MolFromSmiles('C(=O)OCCO', sanitize=False) AllChem.Compute2DCoords(m) I got Pre-condition Violation getNumImplicitHs() called without preceding call to calcImplicitValence() Violation occurred on line 170 in file /home/yf1/software/RDKit/install_version/latest/Code/GraphMol/Atom.cpp Failed Expression: d_implicitValence-1 Traceback (most recent call last): File stdin, line 1, in module RuntimeError: Pre-condition Violation On Wed, Feb 19, 2014 at 3:27 PM, Yingfeng Wang ywang...@gmail.comwrote: Adrian, I meet a weird case. import matplotlib.offsetbox from rdkit import Chem from rdkit.Chem import AllChem from rdkit.Chem import Draw m = Chem.MolFromSmiles('ccc[nH]c') I got non-ring atom 0 marked aromatic AllChem.Compute2DCoords(m) Traceback (most recent call last): File stdin, line 1, in module Boost.Python.ArgumentError: Python argument types in rdkit.Chem.rdDepictor.Compute2DCoords(NoneType) did not match C++ signature: Compute2DCoords(RDKit::ROMol {lvalue} mol, bool canonOrient=True, bool clearConfs=True, boost::python::dict {lvalue} coordMap={}, unsigned int nFlipsPerSample=0, unsigned int nSample=0, int sampleSeed=0, bool permuteDeg4Nodes=False, double bondLength=-1.0) Actually, ccc[nH]c is a fragment. Could you please help me to know whether there is a work around to this case? Thanks. Yingfeng On Mon, Feb 17, 2014 at 2:58 PM, Yingfeng Wang ywang...@gmail.comwrote: Adrian, Thanks, it works. Yingfeng On Mon, Feb 17, 2014 at 12:50 PM, Adrian Jasiński jasinski.adr...@gmail.com wrote: If you read all from tutorial you will find a example: suppl = Chem.SDMolSupplier('data/cdk2.sdf') ms = [x for x in suppl if x is not None] for m in ms: tmp=AllChem.Compute2DCoords(m) from rdkit.Chem import Draw Draw.MolToFile(ms[0],'images/cdk2_mol1.png') Draw.MolToFile(ms[1],'images/cdk2_mol2.png') for this example with you pasted you can just write mol to file: from rdkit.Chem import AllChem from rdkit import Chem m = Chem.MolFromSmiles('c1nccc2n1ccc2') AllChem.Compute2DCoords(m) Draw.MolToFile(m,'example.png') pozdrawiam Adrian Jasiński 2014-02-17 18:34 GMT+01:00 Yingfeng Wang ywang...@gmail.com: I want to draw a 2D figure of a compound. And I follow the example given at the following link, http://www.rdkit.org/docs/GettingStartedInPython.html My code is given as follows, from rdkit.Chem import AllChem from rdkit import Chem m = Chem.MolFromSmiles('c1nccc2n1ccc2') AllChem.Compute2DCoords(m) 0 template = Chem.MolFromSmiles('c1nccc2n1ccc2') AllChem.Compute2DCoords(template) 0 AllChem.GenerateDepictionMatching2DStructure(m,template) However, I got nothing. I am wondering what the correct way is to generate the 2D figure of c1nccc2n1ccc2. Thanks. Yingfeng -- Managing the Performance of Cloud-Based Applications Take advantage of what the Cloud has to offer - Avoid Common Pitfalls. Read the Whitepaper. http://pubads.g.doubleclick.net/gampad/clk?id=121054471iu=/4140/ostg.clktrk ___ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss -- Managing the Performance of Cloud-Based Applications Take advantage of what the Cloud has to offer - Avoid Common Pitfalls. Read the Whitepaper. http://pubads.g.doubleclick.net/gampad/clk?id=121054471iu=/4140/ostg.clktrk___ Rdkit-discuss mailing
Re: [Rdkit-discuss] generate 2D figure
Here are more details. If I use m = Chem.MolFromSmiles('ccc[nH]c', sanitize=False) AllChem.Compute2DCoords(m) It works. But I get trouble with m = Chem.MolFromSmiles('C(=O)OCCO', sanitize=False) AllChem.Compute2DCoords(m) I got Pre-condition Violation getNumImplicitHs() called without preceding call to calcImplicitValence() Violation occurred on line 170 in file /home/yf1/software/RDKit/install_version/latest/Code/GraphMol/Atom.cpp Failed Expression: d_implicitValence-1 Traceback (most recent call last): File stdin, line 1, in module RuntimeError: Pre-condition Violation On Wed, Feb 19, 2014 at 3:27 PM, Yingfeng Wang ywang...@gmail.com wrote: Adrian, I meet a weird case. import matplotlib.offsetbox from rdkit import Chem from rdkit.Chem import AllChem from rdkit.Chem import Draw m = Chem.MolFromSmiles('ccc[nH]c') I got non-ring atom 0 marked aromatic AllChem.Compute2DCoords(m) Traceback (most recent call last): File stdin, line 1, in module Boost.Python.ArgumentError: Python argument types in rdkit.Chem.rdDepictor.Compute2DCoords(NoneType) did not match C++ signature: Compute2DCoords(RDKit::ROMol {lvalue} mol, bool canonOrient=True, bool clearConfs=True, boost::python::dict {lvalue} coordMap={}, unsigned int nFlipsPerSample=0, unsigned int nSample=0, int sampleSeed=0, bool permuteDeg4Nodes=False, double bondLength=-1.0) Actually, ccc[nH]c is a fragment. Could you please help me to know whether there is a work around to this case? Thanks. Yingfeng On Mon, Feb 17, 2014 at 2:58 PM, Yingfeng Wang ywang...@gmail.com wrote: Adrian, Thanks, it works. Yingfeng On Mon, Feb 17, 2014 at 12:50 PM, Adrian Jasiński jasinski.adr...@gmail.com wrote: If you read all from tutorial you will find a example: suppl = Chem.SDMolSupplier('data/cdk2.sdf') ms = [x for x in suppl if x is not None] for m in ms: tmp=AllChem.Compute2DCoords(m) from rdkit.Chem import Draw Draw.MolToFile(ms[0],'images/cdk2_mol1.png') Draw.MolToFile(ms[1],'images/cdk2_mol2.png') for this example with you pasted you can just write mol to file: from rdkit.Chem import AllChem from rdkit import Chem m = Chem.MolFromSmiles('c1nccc2n1ccc2') AllChem.Compute2DCoords(m) Draw.MolToFile(m,'example.png') pozdrawiam Adrian Jasiński 2014-02-17 18:34 GMT+01:00 Yingfeng Wang ywang...@gmail.com: I want to draw a 2D figure of a compound. And I follow the example given at the following link, http://www.rdkit.org/docs/GettingStartedInPython.html My code is given as follows, from rdkit.Chem import AllChem from rdkit import Chem m = Chem.MolFromSmiles('c1nccc2n1ccc2') AllChem.Compute2DCoords(m) 0 template = Chem.MolFromSmiles('c1nccc2n1ccc2') AllChem.Compute2DCoords(template) 0 AllChem.GenerateDepictionMatching2DStructure(m,template) However, I got nothing. I am wondering what the correct way is to generate the 2D figure of c1nccc2n1ccc2. Thanks. Yingfeng -- Managing the Performance of Cloud-Based Applications Take advantage of what the Cloud has to offer - Avoid Common Pitfalls. Read the Whitepaper. http://pubads.g.doubleclick.net/gampad/clk?id=121054471iu=/4140/ostg.clktrk ___ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss -- Managing the Performance of Cloud-Based Applications Take advantage of what the Cloud has to offer - Avoid Common Pitfalls. Read the Whitepaper. http://pubads.g.doubleclick.net/gampad/clk?id=121054471iu=/4140/ostg.clktrk___ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
[Rdkit-discuss] generate 2D figure
I want to draw a 2D figure of a compound. And I follow the example given at the following link, http://www.rdkit.org/docs/GettingStartedInPython.html My code is given as follows, from rdkit.Chem import AllChem from rdkit import Chem m = Chem.MolFromSmiles('c1nccc2n1ccc2') AllChem.Compute2DCoords(m) 0 template = Chem.MolFromSmiles('c1nccc2n1ccc2') AllChem.Compute2DCoords(template) 0 AllChem.GenerateDepictionMatching2DStructure(m,template) However, I got nothing. I am wondering what the correct way is to generate the 2D figure of c1nccc2n1ccc2. Thanks. Yingfeng -- Managing the Performance of Cloud-Based Applications Take advantage of what the Cloud has to offer - Avoid Common Pitfalls. Read the Whitepaper. http://pubads.g.doubleclick.net/gampad/clk?id=121054471iu=/4140/ostg.clktrk___ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
[Rdkit-discuss] compound mass calculation
I have two different compounds with the same formula. But I got different mass. sInchi = InChI=1S/C5H9NO4/c6-3(5(9)10)1-2-4(7)8/h3H,1-2,6H2,(H,7,8)(H,9,10)/p-1/t3-/m0/s1 current_mol = Chem.MolFromInchi(sInchi) current_mass = Descriptors.ExactMolWt(current_mol) print current_mass 146.045332736 sInchi = InChI=1S/C5H9NO4/c6-4(5(9)10)1-3(8)2-7/h2-4,8H,1,6H2,(H,9,10)/t3-,4+/m1/s1 current_mol = Chem.MolFromInchi(sInchi) current_mass = Descriptors.ExactMolWt(current_mol) print current_mass 147.053157768 Could you please check this problem? Thanks. Yingfeng -- Rapidly troubleshoot problems before they affect your business. Most IT organizations don't have a clear picture of how application performance affects their revenue. With AppDynamics, you get 100% visibility into your Java,.NET, PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro! http://pubads.g.doubleclick.net/gampad/clk?id=84349831iu=/4140/ostg.clktrk___ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
Re: [Rdkit-discuss] compound mass calculation
Peter, Thanks. Yes, I am only interested in the mass. Could you please let me know the function for getting the charge? By the way, how do I the charge is caused by losing or getting protons instead of electrons? Yingfeng On Wed, Dec 18, 2013 at 10:43 PM, Peter Gedeck peter.ged...@gmail.comwrote: Hello, Here is RDkit code that will neutralize a compound: http://code.google.com/p/rdkit/wiki/NeutralisingCompounds If you are only interested in the mass, you could get the charge of the compound and add or delete hydrogen masses. Also, ask on the RDkit list. Best, Peter On 19 December 2013 11:18, Yingfeng Wang ywang...@gmail.com wrote: Peter, Thanks. Is there is a way to calculate the neutral mass of a compound even if the Inchi indicates that this compound is negatively charged? Yingfeng On Wed, Dec 18, 2013 at 7:50 PM, Peter Gedeck peter.ged...@gmail.comwrote: Hello Yingfeng, The molecular formula in the inchi key is not the same as the one from the molecule that is encoded. It ignores charges. You can see this when you convert the mol to a SMILES: sInchi = InChI=1S/C5H9NO4/c6-3(5(9)10)1-2-4(7)8/h3H,1-2,6H2,(H,7,8)(H,9,10)/p-1/t3-/m0/s1 current_mol = Chem.MolFromInchi(sInchi) Descriptors.ExactMolWt(current_mol) 146.0453327361 Chem.MolToSmiles(current_mol) 'NC(CCC(=O)[O-])C(=O)O' sInchi = InChI=1S/C5H9NO4/c6-4(5(9)10)1-3(8)2-7/h2-4,8H,1,6H2,(H,9,10)/t3-,4+/m1/s1 current_mol = Chem.MolFromInchi(sInchi) Descriptors.ExactMolWt(current_mol) 147.0531577681 Chem.MolToSmiles(current_mol) 'NC(CC(O)C=O)C(=O)O' The first molecule is negatively charged and has a proton less than the second molecule which is neutral. This explains the difference in molecular weight. Best, Peter On 19 December 2013 06:50, Yingfeng Wang ywang...@gmail.com wrote: I have two different compounds with the same formula. But I got different mass. sInchi = InChI=1S/C5H9NO4/c6-3(5(9)10)1-2-4(7)8/h3H,1-2,6H2,(H,7,8)(H,9,10)/p-1/t3-/m0/s1 current_mol = Chem.MolFromInchi(sInchi) current_mass = Descriptors.ExactMolWt(current_mol) print current_mass 146.045332736 sInchi = InChI=1S/C5H9NO4/c6-4(5(9)10)1-3(8)2-7/h2-4,8H,1,6H2,(H,9,10)/t3-,4+/m1/s1 current_mol = Chem.MolFromInchi(sInchi) current_mass = Descriptors.ExactMolWt(current_mol) print current_mass 147.053157768 Could you please check this problem? Thanks. Yingfeng -- Rapidly troubleshoot problems before they affect your business. Most IT organizations don't have a clear picture of how application performance affects their revenue. With AppDynamics, you get 100% visibility into your Java,.NET, PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro! http://pubads.g.doubleclick.net/gampad/clk?id=84349831iu=/4140/ostg.clktrk ___ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss -- Rapidly troubleshoot problems before they affect your business. Most IT organizations don't have a clear picture of how application performance affects their revenue. With AppDynamics, you get 100% visibility into your Java,.NET, PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro! http://pubads.g.doubleclick.net/gampad/clk?id=84349831iu=/4140/ostg.clktrk___ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
Re: [Rdkit-discuss] install RDKit on CentOS
Matthew, No. I am just a regular user. The administrator has decided to update the whole system, but I don't know when. Yingfeng On Tue, Jul 16, 2013 at 1:08 AM, Matthew Lardy mla...@gmail.com wrote: Hi Yingfeng, Forgive me if I am jumping in without knowing all that you have tried, but did you try pulling boost with Yum? I was able to get RDKit, and the Java wrappers, to cleanly compile on CentOS 6.4 with that flavor of boost. Matt On Mon, Jul 15, 2013 at 9:39 PM, Greg Landrum greg.land...@gmail.comwrote: On Mon, Jul 15, 2013 at 7:49 AM, Yingfeng Wang ywang...@gmail.comwrote: I also tried boost 1.49.0, and met same problem. If necessary, I can try 1.51. hmm, ok, so much for that idea. Let's try something else. On Sunday, July 14, 2013, Yingfeng Wang wrote: I failed to install RDKit on CentOS. The error message is [ 85%] Built target MolChemicalFeatures Linking CXX executable testSLNParse [ 85%] Built target rdSLNParse /home/yingfeng/software/boost/boost_1_54_0/stage/lib/libboost_regex.so: undefined reference to `std::__detail::_List_node_base::_M_unhook()@GLIBCXX_3.4.15' /home/yingfeng/software/boost/boost_1_54_0/stage/lib/libboost_regex.so: undefined reference to `std::overflow_error::~overflow_error()@GLIBCXX_3.4.15' /home/yingfeng/software/boost/boost_1_54_0/stage/lib/libboost_regex.so: undefined reference to `std::__detail::_List_node_base::_M_hook(std::__detail::_List_node_base*)@GLIBCXX_3.4.15' /home/yingfeng/software/boost/boost_1_54_0/stage/lib/libboost_regex.so: undefined reference to `std::ctypechar::_M_widen_init() const@GLIBCXX_3.4.11' /home/yingfeng/software/boost/boost_1_54_0/stage/lib/libboost_regex.so: undefined reference to `std::invalid_argument::~invalid_argument()@GLIBCXX_3.4.15' /home/yingfeng/software/boost/boost_1_54_0/stage/lib/libboost_regex.so: undefined reference to `std::__detail::_List_node_base::_M_transfer(std::__detail::_List_node_base*, std::__detail::_List_node_base*)@GLIBCXX_3.4.15' collect2: ld returned 1 exit status make[2]: *** [Code/GraphMol/SLNParse/testSLNParse] Error 1 make[1]: *** [Code/GraphMol/SLNParse/CMakeFiles/testSLNParse.dir/all] Error 2 This error is happening during the build of the SLN parser. The easiest solution, if you aren't planning on using SLN, is to disable that part of the build by providing cmake with the argument: -DRDK_BUILD_SLN_SUPPORT=OFF and then re-running make. If you want to find the real solution, I need a bit more information. It looks like there is something strange/wrong about your boost.regex build (it looks like it could be using a different version of libstdc++), so we're going to have to track that down. Start with sending the output of this command: ldd /home/yingfeng/software/boost/boost_1_54_0/stage/lib/ libboost_regex.so next look in the lib/ directory of wherever you're doing the RDKit build and send the result of running ldd on one of the .so files in that directory. finally, do the following: VERBOSE=1 make testSLNParse and send the part of the (very long) output that includes the actual build command and the error message. This will be towards the bottom of the output and the build command will look something like this (the paths will of course be completely different for you): /usr/bin/c++ -O3 -DNDEBUG -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/testSLNParse.dir/test.cpp.o -o testSLNParse -L/usr/local/lib ../../../lib/libSLNParse.2013.06.1beta1.dylib ../../../lib/libSmilesParse.2013.06.1beta1.dylib ../../../lib/libSubstructMatch.2013.06.1beta1.dylib ../../../lib/libGraphMol.2013.06.1beta1.dylib ../../../lib/libRDGeometryLib.2013.06.1beta1.dylib ../../../lib/libRDGeneral.2013.06.1beta1.dylib /usr/local/lib/libboost_regex.dylib ../../../lib/libDataStructs.2013.06.1beta1.dylib ../../../lib/libRDGeneral.2013.06.1beta1.dylib -lpthread -greg -- See everything from the browser to the database with AppDynamics Get end-to-end visibility with application monitoring from AppDynamics Isolate bottlenecks and diagnose root cause in seconds. Start your free trial of AppDynamics Pro today! http://pubads.g.doubleclick.net/gampad/clk?id=48808831iu=/4140/ostg.clktrk ___ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss -- See everything from the browser to the database with AppDynamics Get end-to-end visibility with application monitoring from AppDynamics Isolate bottlenecks and diagnose root cause in seconds. Start your free trial of AppDynamics Pro today! http://pubads.g.doubleclick.net/gampad/clk?id=48808831iu=/4140/ostg.clktrk___ Rdkit-discuss mailing list Rdkit-discuss
Re: [Rdkit-discuss] install RDKit on CentOS
Matthew, Thanks. Yingfeng On Tue, Jul 16, 2013 at 10:11 AM, Matthew Lardy mla...@gmail.com wrote: Yingfeng, That's really unfortunate! Hopefully, you can punch through this quickly! Best, Matthew On Tue, Jul 16, 2013 at 5:29 AM, Yingfeng Wang ywang...@gmail.com wrote: Matthew, No. I am just a regular user. The administrator has decided to update the whole system, but I don't know when. Yingfeng On Tue, Jul 16, 2013 at 1:08 AM, Matthew Lardy mla...@gmail.com wrote: Hi Yingfeng, Forgive me if I am jumping in without knowing all that you have tried, but did you try pulling boost with Yum? I was able to get RDKit, and the Java wrappers, to cleanly compile on CentOS 6.4 with that flavor of boost. Matt On Mon, Jul 15, 2013 at 9:39 PM, Greg Landrum greg.land...@gmail.comwrote: On Mon, Jul 15, 2013 at 7:49 AM, Yingfeng Wang ywang...@gmail.comwrote: I also tried boost 1.49.0, and met same problem. If necessary, I can try 1.51. hmm, ok, so much for that idea. Let's try something else. On Sunday, July 14, 2013, Yingfeng Wang wrote: I failed to install RDKit on CentOS. The error message is [ 85%] Built target MolChemicalFeatures Linking CXX executable testSLNParse [ 85%] Built target rdSLNParse /home/yingfeng/software/boost/boost_1_54_0/stage/lib/libboost_regex.so: undefined reference to `std::__detail::_List_node_base::_M_unhook()@GLIBCXX_3.4.15' /home/yingfeng/software/boost/boost_1_54_0/stage/lib/libboost_regex.so: undefined reference to `std::overflow_error::~overflow_error()@GLIBCXX_3.4.15' /home/yingfeng/software/boost/boost_1_54_0/stage/lib/libboost_regex.so: undefined reference to `std::__detail::_List_node_base::_M_hook(std::__detail::_List_node_base*)@GLIBCXX_3.4.15' /home/yingfeng/software/boost/boost_1_54_0/stage/lib/libboost_regex.so: undefined reference to `std::ctypechar::_M_widen_init() const@GLIBCXX_3.4.11' /home/yingfeng/software/boost/boost_1_54_0/stage/lib/libboost_regex.so: undefined reference to `std::invalid_argument::~invalid_argument()@GLIBCXX_3.4.15' /home/yingfeng/software/boost/boost_1_54_0/stage/lib/libboost_regex.so: undefined reference to `std::__detail::_List_node_base::_M_transfer(std::__detail::_List_node_base*, std::__detail::_List_node_base*)@GLIBCXX_3.4.15' collect2: ld returned 1 exit status make[2]: *** [Code/GraphMol/SLNParse/testSLNParse] Error 1 make[1]: *** [Code/GraphMol/SLNParse/CMakeFiles/testSLNParse.dir/all] Error 2 This error is happening during the build of the SLN parser. The easiest solution, if you aren't planning on using SLN, is to disable that part of the build by providing cmake with the argument: -DRDK_BUILD_SLN_SUPPORT=OFF and then re-running make. If you want to find the real solution, I need a bit more information. It looks like there is something strange/wrong about your boost.regex build (it looks like it could be using a different version of libstdc++), so we're going to have to track that down. Start with sending the output of this command: ldd /home/yingfeng/software/boost/boost_1_54_0/stage/lib/ libboost_regex.so next look in the lib/ directory of wherever you're doing the RDKit build and send the result of running ldd on one of the .so files in that directory. finally, do the following: VERBOSE=1 make testSLNParse and send the part of the (very long) output that includes the actual build command and the error message. This will be towards the bottom of the output and the build command will look something like this (the paths will of course be completely different for you): /usr/bin/c++ -O3 -DNDEBUG -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/testSLNParse.dir/test.cpp.o -o testSLNParse -L/usr/local/lib ../../../lib/libSLNParse.2013.06.1beta1.dylib ../../../lib/libSmilesParse.2013.06.1beta1.dylib ../../../lib/libSubstructMatch.2013.06.1beta1.dylib ../../../lib/libGraphMol.2013.06.1beta1.dylib ../../../lib/libRDGeometryLib.2013.06.1beta1.dylib ../../../lib/libRDGeneral.2013.06.1beta1.dylib /usr/local/lib/libboost_regex.dylib ../../../lib/libDataStructs.2013.06.1beta1.dylib ../../../lib/libRDGeneral.2013.06.1beta1.dylib -lpthread -greg -- See everything from the browser to the database with AppDynamics Get end-to-end visibility with application monitoring from AppDynamics Isolate bottlenecks and diagnose root cause in seconds. Start your free trial of AppDynamics Pro today! http://pubads.g.doubleclick.net/gampad/clk?id=48808831iu=/4140/ostg.clktrk ___ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss -- See everything from the browser to the database with AppDynamics Get end-to-end visibility with application monitoring
Re: [Rdkit-discuss] install RDKit on CentOS
Greg, I tried your suggestion of -DRDK_BUILD_SLN_SUPPORT=OFF. The installation went through make and make install, but failed at make test. I tried python testBV.py and got Segmentation fault. It seems this CentOS version is really not friendly to RDkit. Since I just installed RDkit on an Opensuse machine, which is also very powerful, I decide to give up installing RDkit on CentOS. Anyway, thank you very much for your help. And I am looking forward to the new version of RDkit. Yingfeng On Tue, Jul 16, 2013 at 12:39 AM, Greg Landrum greg.land...@gmail.comwrote: On Mon, Jul 15, 2013 at 7:49 AM, Yingfeng Wang ywang...@gmail.com wrote: I also tried boost 1.49.0, and met same problem. If necessary, I can try 1.51. hmm, ok, so much for that idea. Let's try something else. On Sunday, July 14, 2013, Yingfeng Wang wrote: I failed to install RDKit on CentOS. The error message is [ 85%] Built target MolChemicalFeatures Linking CXX executable testSLNParse [ 85%] Built target rdSLNParse /home/yingfeng/software/boost/boost_1_54_0/stage/lib/libboost_regex.so: undefined reference to `std::__detail::_List_node_base::_M_unhook()@GLIBCXX_3.4.15' /home/yingfeng/software/boost/boost_1_54_0/stage/lib/libboost_regex.so: undefined reference to `std::overflow_error::~overflow_error()@GLIBCXX_3.4.15' /home/yingfeng/software/boost/boost_1_54_0/stage/lib/libboost_regex.so: undefined reference to `std::__detail::_List_node_base::_M_hook(std::__detail::_List_node_base*)@GLIBCXX_3.4.15' /home/yingfeng/software/boost/boost_1_54_0/stage/lib/libboost_regex.so: undefined reference to `std::ctypechar::_M_widen_init() const@GLIBCXX_3.4.11' /home/yingfeng/software/boost/boost_1_54_0/stage/lib/libboost_regex.so: undefined reference to `std::invalid_argument::~invalid_argument()@GLIBCXX_3.4.15' /home/yingfeng/software/boost/boost_1_54_0/stage/lib/libboost_regex.so: undefined reference to `std::__detail::_List_node_base::_M_transfer(std::__detail::_List_node_base*, std::__detail::_List_node_base*)@GLIBCXX_3.4.15' collect2: ld returned 1 exit status make[2]: *** [Code/GraphMol/SLNParse/testSLNParse] Error 1 make[1]: *** [Code/GraphMol/SLNParse/CMakeFiles/testSLNParse.dir/all] Error 2 This error is happening during the build of the SLN parser. The easiest solution, if you aren't planning on using SLN, is to disable that part of the build by providing cmake with the argument: -DRDK_BUILD_SLN_SUPPORT=OFF and then re-running make. If you want to find the real solution, I need a bit more information. It looks like there is something strange/wrong about your boost.regex build (it looks like it could be using a different version of libstdc++), so we're going to have to track that down. Start with sending the output of this command: ldd /home/yingfeng/software/boost/boost_1_54_0/stage/lib/libboost_regex.so next look in the lib/ directory of wherever you're doing the RDKit build and send the result of running ldd on one of the .so files in that directory. finally, do the following: VERBOSE=1 make testSLNParse and send the part of the (very long) output that includes the actual build command and the error message. This will be towards the bottom of the output and the build command will look something like this (the paths will of course be completely different for you): /usr/bin/c++ -O3 -DNDEBUG -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/testSLNParse.dir/test.cpp.o -o testSLNParse -L/usr/local/lib ../../../lib/libSLNParse.2013.06.1beta1.dylib ../../../lib/libSmilesParse.2013.06.1beta1.dylib ../../../lib/libSubstructMatch.2013.06.1beta1.dylib ../../../lib/libGraphMol.2013.06.1beta1.dylib ../../../lib/libRDGeometryLib.2013.06.1beta1.dylib ../../../lib/libRDGeneral.2013.06.1beta1.dylib /usr/local/lib/libboost_regex.dylib ../../../lib/libDataStructs.2013.06.1beta1.dylib ../../../lib/libRDGeneral.2013.06.1beta1.dylib -lpthread -greg -- See everything from the browser to the database with AppDynamics Get end-to-end visibility with application monitoring from AppDynamics Isolate bottlenecks and diagnose root cause in seconds. Start your free trial of AppDynamics Pro today! http://pubads.g.doubleclick.net/gampad/clk?id=48808831iu=/4140/ostg.clktrk___ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
Re: [Rdkit-discuss] install RDKit on CentOS
Gianluca, I am using CentOS 5.8. But I am just a regular user. So I prefer to install RDkit by building it from source. Thanks. Yingfeng On Mon, Jul 15, 2013 at 5:51 AM, Gianluca Sforna gia...@gmail.com wrote: On Sun, Jul 14, 2013 at 10:57 PM, Yingfeng Wang ywang...@gmail.com wrote: I failed to install RDKit on CentOS. Which version of centos? I have packages for version 6 (64 bit) ready to install with yum in http://giallu.fedorapeople.org/rdkit-2013.03/el6-x86_64/ -- Gianluca Sforna http://morefedora.blogspot.com http://identi.ca/giallu - http://twitter.com/giallu -- See everything from the browser to the database with AppDynamics Get end-to-end visibility with application monitoring from AppDynamics Isolate bottlenecks and diagnose root cause in seconds. Start your free trial of AppDynamics Pro today! http://pubads.g.doubleclick.net/gampad/clk?id=48808831iu=/4140/ostg.clktrk___ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
Re: [Rdkit-discuss] install RDKit on CentOS
Hi Greg, I just tried 1.51, and got same problem. Thanks. Yingfeng On Mon, Jul 15, 2013 at 7:49 AM, Yingfeng Wang ywang...@gmail.com wrote: Greg, I also tried boost 1.49.0, and met same problem. If necessary, I can try 1.51. Yingfeng On Mon, Jul 15, 2013 at 5:02 AM, Greg Landrum greg.land...@gmail.comwrote: Hi Yingfeng, I have not yet built the RDKit with boost 1.54.0. This makes it hard for me to know if the problem is the new version of boost, centos, or something with your configuration. Any chance that you can go back to an older version of boost like 1.51? -greg On Sunday, July 14, 2013, Yingfeng Wang wrote: I failed to install RDKit on CentOS. The error message is [ 85%] Built target MolChemicalFeatures Linking CXX executable testSLNParse [ 85%] Built target rdSLNParse /home/yingfeng/software/boost/boost_1_54_0/stage/lib/libboost_regex.so: undefined reference to `std::__detail::_List_node_base::_M_unhook()@GLIBCXX_3.4.15' /home/yingfeng/software/boost/boost_1_54_0/stage/lib/libboost_regex.so: undefined reference to `std::overflow_error::~overflow_error()@GLIBCXX_3.4.15' /home/yingfeng/software/boost/boost_1_54_0/stage/lib/libboost_regex.so: undefined reference to `std::__detail::_List_node_base::_M_hook(std::__detail::_List_node_base*)@GLIBCXX_3.4.15' /home/yingfeng/software/boost/boost_1_54_0/stage/lib/libboost_regex.so: undefined reference to `std::ctypechar::_M_widen_init() const@GLIBCXX_3.4.11' /home/yingfeng/software/boost/boost_1_54_0/stage/lib/libboost_regex.so: undefined reference to `std::invalid_argument::~invalid_argument()@GLIBCXX_3.4.15' /home/yingfeng/software/boost/boost_1_54_0/stage/lib/libboost_regex.so: undefined reference to `std::__detail::_List_node_base::_M_transfer(std::__detail::_List_node_base*, std::__detail::_List_node_base*)@GLIBCXX_3.4.15' collect2: ld returned 1 exit status make[2]: *** [Code/GraphMol/SLNParse/testSLNParse] Error 1 make[1]: *** [Code/GraphMol/SLNParse/CMakeFiles/testSLNParse.dir/all] Error 2 I tried cmake -D BOOST_ROOT=/home/yingfeng/software/boost/boost_1_54_0 .. cmake -D BOOST_ROOT=/home/yingfeng/software/boost/boost_1_54_0 -D Boost_USE_STATIC_LIBS=OFF.. cmake -D BOOST_ROOT=/home/yingfeng/software/boost/boost_1_54_0 -D Boost_USE_STATIC_LIBS=OFF -D Boost_NO_SYSTEM_PATHS=ON .. Thanks. Yingfeng -- See everything from the browser to the database with AppDynamics Get end-to-end visibility with application monitoring from AppDynamics Isolate bottlenecks and diagnose root cause in seconds. Start your free trial of AppDynamics Pro today! http://pubads.g.doubleclick.net/gampad/clk?id=48808831iu=/4140/ostg.clktrk___ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
[Rdkit-discuss] install RDKit on CentOS
I failed to install RDKit on CentOS. The error message is [ 85%] Built target MolChemicalFeatures Linking CXX executable testSLNParse [ 85%] Built target rdSLNParse /home/yingfeng/software/boost/boost_1_54_0/stage/lib/libboost_regex.so: undefined reference to `std::__detail::_List_node_base::_M_unhook()@GLIBCXX_3.4.15' /home/yingfeng/software/boost/boost_1_54_0/stage/lib/libboost_regex.so: undefined reference to `std::overflow_error::~overflow_error()@GLIBCXX_3.4.15' /home/yingfeng/software/boost/boost_1_54_0/stage/lib/libboost_regex.so: undefined reference to `std::__detail::_List_node_base::_M_hook(std::__detail::_List_node_base*)@GLIBCXX_3.4.15' /home/yingfeng/software/boost/boost_1_54_0/stage/lib/libboost_regex.so: undefined reference to `std::ctypechar::_M_widen_init() const@GLIBCXX_3.4.11' /home/yingfeng/software/boost/boost_1_54_0/stage/lib/libboost_regex.so: undefined reference to `std::invalid_argument::~invalid_argument()@GLIBCXX_3.4.15' /home/yingfeng/software/boost/boost_1_54_0/stage/lib/libboost_regex.so: undefined reference to `std::__detail::_List_node_base::_M_transfer(std::__detail::_List_node_base*, std::__detail::_List_node_base*)@GLIBCXX_3.4.15' collect2: ld returned 1 exit status make[2]: *** [Code/GraphMol/SLNParse/testSLNParse] Error 1 make[1]: *** [Code/GraphMol/SLNParse/CMakeFiles/testSLNParse.dir/all] Error 2 I tried cmake -D BOOST_ROOT=/home/yingfeng/software/boost/boost_1_54_0 .. cmake -D BOOST_ROOT=/home/yingfeng/software/boost/boost_1_54_0 -D Boost_USE_STATIC_LIBS=OFF.. cmake -D BOOST_ROOT=/home/yingfeng/software/boost/boost_1_54_0 -D Boost_USE_STATIC_LIBS=OFF -D Boost_NO_SYSTEM_PATHS=ON .. Thanks. Yingfeng -- See everything from the browser to the database with AppDynamics Get end-to-end visibility with application monitoring from AppDynamics Isolate bottlenecks and diagnose root cause in seconds. Start your free trial of AppDynamics Pro today! http://pubads.g.doubleclick.net/gampad/clk?id=48808831iu=/4140/ostg.clktrk___ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
Re: [Rdkit-discuss] random compound
Dear Greg, Could you please help me to check whether function RandomizeMol(mol) is able to generate a random compound? http://www.rdkit.org/docs/api/rdkit.Chem.Randomize-module.html#RandomizeMol If so, could you please give me more details? Thanks. On Tue, Jul 2, 2013 at 11:22 AM, Greg Landrum greg.land...@gmail.comwrote: On Tue, Jul 2, 2013 at 5:20 PM, Yingfeng Wang ywang...@gmail.com wrote: If I have the formula, is RDKit able to generate a random compound based on the given formula? It's not, but it is kind of an interesting problem to think about.[1] -greg [1] Note: this is absolutely *not* me saying that I'm going to do it. :-) -- This SF.net email is sponsored by Windows: Build for Windows Store. http://p.sf.net/sfu/windows-dev2dev___ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
Re: [Rdkit-discuss] mass of proton
Greg, I totally got two cases. The inchi formats of them are InChI=1S/p+1 and InChI=1S/H2/h1H. The former has been reported. The mass of later is 1.007825032. So I think it could also be a bug. Yingfeng On Sat, Jun 22, 2013 at 5:26 AM, Greg Landrum greg.land...@gmail.comwrote: Hi Yingfeng, On Fri, Jun 21, 2013 at 4:40 PM, Yingfeng Wang ywang...@gmail.com wrote: With the following code, from rdkit import Chem from rdkit.Chem import Descriptors from rdkit.Chem import AllChem a = Chem.MolFromSmiles([H+]) Descriptors.ExactMolWt(a) 0.0 snip Is it normal? Nope. It's a bug. Thanks for reporting it! -greg -- This SF.net email is sponsored by Windows: Build for Windows Store. http://p.sf.net/sfu/windows-dev2dev___ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
Re: [Rdkit-discuss] mass of proton
-40-37(7,8)26-34(42)28-39(40,10)44-40/h11-21,23-24,33-34,41-43H,25-28H2,1-10H3/b12-11+,17-13+,18-14+,24-23+,29-15+,30-16+,31-19+,32-20-/t22-,33-,34-,38+,39+,40-/m0/s1 [15:29:28] Allene-style stereochemistry is not supported yet and will be ignored. InChI=1S/C55H71N4O6.Mg/c1-12-38-35(8)42-27-43-36(9)40(23-24-48(61)65-26-25-34(7)22-16-21-33(6)20-15-19-32(5)18-14-17-31(3)4)52(58-43)50-51(55(63)64-11)54(62)49-37(10)44(59-53(49)50)28-46-39(13-2)41(30-60)47(57-46)29-45(38)56-42;/h12,25,27-33,36,40,51H,1,13-24,26H2,2-11H3,(H-,56,57,58,59,60,62);/q-1;+2/p-1/b34-25+;/t32-,33-,36+,40+,51-;/m1./s1 [15:30:09] WARNING: Problems/mismatches: Mobile-H( Hydrogens: Number; Mobile-H groups: Number; Charge(s): Do not match) InChI=1S/C35H35N4O4.Mg/c1-8-22-18(3)26-14-27-20(5)24(10-12-34(40)41)32(38-27)17-33-25(11-13-35(42)43-7)21(6)29(39-33)16-31-23(9-2)19(4)28(37-31)15-30(22)36-26;/h8-9,14-17H,1-2,10-13H2,3-7H3,(H2-,36,37,38,39,40,41);/q-1;+2/p-2/b26-14-,27-14-,28-15-,29-16-,30-15-,31-16-,32-17-,33-17-; [15:30:09] WARNING: Problems/mismatches: Mobile-H( Hydrogens: Number; Mobile-H groups: Number; Charge(s): Do not match) InChI=1S/C4H8OS/c1-2-3-4-6-5/h4H,2-3H2,1H3/q-1 [15:30:10] WARNING: Problems/mismatches: Mobile-H( Hydrogens: Locations or number, Number; Charge(s): Do not match) InChI=1S/CH2O2S/c2-1(3)4/h(H2,2,3,4)/p-1 [15:30:10] WARNING: Problems/mismatches: Mobile-H( Hydrogens: Locations or number; Mobile-H groups: Attachment points, Number) InChI=1S/C7H6OS/c8-9-6-7-4-2-1-3-5-7/h1-6H/q-1 [15:30:10] WARNING: Problems/mismatches: Mobile-H( Hydrogens: Locations or number, Number; Charge(s): Do not match) InChI=1S/ C8H6Cl3NO2S2.2ClH.Cu/c9-8(10,11)16-7(14)5-3-1-2-4(12-5)6(13)15;;;/h1-3,5,16H,(H,13,15);2*1H;/q-2;;;+4/p-3 [15:30:11] WARNING: Problems/mismatches: Mobile-H( Hydrogens: Locations or number, Number; Charge(s): Do not match) InChI=1S/C35H35N4O5.Mg/c1-8-21-17(3)24-12-25-19(5)23(10-11-33(41)42)30(38-25)15-31-35(32(40)16-34(43)44-7)20(6)27(39-31)14-29-22(9-2)18(4)26(37-29)13-28(21)36-24;/h8-9,12-15,32,40H,1-2,10-11,16H2,3-7H3,(H2-,36,37,38,39,41,42);/q-1;+2/p-2/b24-12-,25-12-,26-13-,27-14-,28-13-,29-14-,30-15-,31-15-; [15:30:11] WARNING: Problems/mismatches: Mobile-H( Hydrogens: Number; Mobile-H groups: Number; Charge(s): Do not match) InChI=1S/C55H72N4O6.Mg/c1-12-38-35(8)42-27-43-36(9)40(23-24-48(61)65-26-25-34(7)22-16-21-33(6)20-15-19-32(5)18-14-17-31(3)4)52(58-43)50-51(55(63)64-11)54(62)49-37(10)44(59-53(49)50)28-46-39(13-2)41(30-60)47(57-46)29-45(38)56-42;/h12,25,27-29,31-33,36,40,60H,1,13-24,26,30H2,2-11H3,(H-,56,57,58,59,62);/q-2;+2/p-1/b34-25+;/t32-,33-,36+,40+;/m1./s1 [15:30:11] WARNING: Problems/mismatches: Mobile-H( Hydrogens: Number; Mobile-H groups: Number; Charge(s): Do not match) InChI=1S/C42H48N6O14.Ni/c1-41(17-33(43)49)23(5-9-37(55)56)29-14-27-21(11-39(59)60)19(3-7-35(51)52)25(45-27)13-26-20(4-8-36(53)54)22(12-40(61)62)28(46-26)15-31-42(2,18-34(44)50)24(6-10-38(57)58)30(48-31)16-32(41)47-29;/h13-16,19,21,23-24H,3-12,17-18H2,1-2H3,(H2,43,49)(H2,44,50)(H,51,52)(H,53,54)(H,55,56)(H,57,58)(H,59,60)(H,61,62);/q-1;+1/p-6/b25-13-,29-14-,31-15-;/t19-,21-,23+,24+,41-,42-;/m0./s1 [15:30:12] WARNING: Problems/mismatches: Mobile-H( Hydrogens: Number; Mobile-H groups: One instead of multiple, Attachment points, Number; Charge(s): Do not match; Stereobonds/cumulenes: Missing known) On Sat, Jun 22, 2013 at 7:59 AM, Yingfeng Wang ywang...@gmail.com wrote: Greg, I totally got two cases. The inchi formats of them are InChI=1S/p+1 and InChI=1S/H2/h1H. The former has been reported. The mass of later is 1.007825032. So I think it could also be a bug. Yingfeng On Sat, Jun 22, 2013 at 5:26 AM, Greg Landrum greg.land...@gmail.comwrote: Hi Yingfeng, On Fri, Jun 21, 2013 at 4:40 PM, Yingfeng Wang ywang...@gmail.comwrote: With the following code, from rdkit import Chem from rdkit.Chem import Descriptors from rdkit.Chem import AllChem a = Chem.MolFromSmiles([H+]) Descriptors.ExactMolWt(a) 0.0 snip Is it normal? Nope. It's a bug. Thanks for reporting it! -greg -- This SF.net email is sponsored by Windows: Build for Windows Store. http://p.sf.net/sfu/windows-dev2dev___ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
[Rdkit-discuss] mass of proton
With the following code, from rdkit import Chem from rdkit.Chem import Descriptors from rdkit.Chem import AllChem a = Chem.MolFromSmiles([H+]) Descriptors.ExactMolWt(a) 0.0 I got mass 0.0 If I switch to Inchi format, I get same result. a = Chem.MolFromInchi(InChI=1S/p+1) Descriptors.ExactMolWt(a) 0.0 Is it normal? Thanks. Yingfeng -- This SF.net email is sponsored by Windows: Build for Windows Store. http://p.sf.net/sfu/windows-dev2dev___ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
Re: [Rdkit-discuss] install error
Yes. I tried again. This time, after run download-inchi.sh I mkdir build cd build sudo cmake .. -DRDK_BUILD_INCHI_SUPPORT=ON sudo make sudo make install by far, no error reported. but, when I run sudo ctest I got The following tests FAILED: 1 - testInchi (OTHER_FAULT) 3 - testDataStructs (OTHER_FAULT) 4 - pyBV (Failed) 5 - pyDiscreteValueVect (Failed) 6 - pySparseIntVect (Failed) 8 - testGrid (OTHER_FAULT) 9 - testPyGeometry (Failed) 12 - pyAlignment (Failed) 16 - pyDistGeom (Failed) 20 - graphmolMolOpsTest (SEGFAULT) 22 - graphmoltestChirality (OTHER_FAULT) 23 - graphmoltestPickler (OTHER_FAULT) 25 - testDepictor (OTHER_FAULT) 26 - pyDepictor (Failed) 29 - fileParsersTest1 (OTHER_FAULT) 30 - testMolSupplier (OTHER_FAULT) 31 - testMolWriter (OTHER_FAULT) 32 - testTplParser (OTHER_FAULT) 33 - testMol2ToMol (OTHER_FAULT) 35 - testReaction (OTHER_FAULT) 36 - pyChemReactions (Failed) 37 - testChemTransforms (OTHER_FAULT) 40 - testFragCatalog (OTHER_FAULT) 41 - pyFragCatalog (Failed) 42 - testDescriptors (OTHER_FAULT) 43 - pyMolDescriptors (Failed) 44 - testFingerprints (OTHER_FAULT) 45 - pyPartialCharges (Failed) 46 - testMolTransforms (OTHER_FAULT) 47 - pyMolTransforms (Failed) 48 - testForceFieldHelpers (OTHER_FAULT) 49 - pyForceFieldHelpers (Failed) 50 - testDistGeomHelpers (OTHER_FAULT) 51 - pyDistGeom (Failed) 52 - testMolAlign (OTHER_FAULT) 53 - pyMolAlign (Failed) 54 - testFeatures (OTHER_FAULT) 55 - pyChemicalFeatures (Failed) 56 - testShapeHelpers (OTHER_FAULT) 57 - pyShapeHelpers (Failed) 59 - pyMolCatalog (Failed) 61 - pySLNParse (Failed) 62 - pyGraphMolWrap (Failed) 63 - pyTestConformerWrap (Failed) 66 - pyMatCalc (Failed) 67 - pyCMIM (Failed) 68 - pyRanker (Failed) 70 - pyFeatures (Failed) 71 - pythonTestDbCLI (Failed) 72 - pythonTestDirML (Failed) 77 - pythonTestDirChem (Failed) Errors while running CTest Thanks. On Wed, Jun 5, 2013 at 5:54 AM, JP jeanpaul.ebe...@inhibox.com wrote: , Before running cmake - have you run ./External/INCHI-API/download-inchi.sh ? On 5 June 2013 04:13, Yingfeng Wang ywang...@gmail.com wrote: After getting the latest code by git, I install RDKit on my ubuntu 12.04. In the step of make install, I got CMake Error at External/INCHI-API/cmake_install.cmake:124 (FILE): It seems the file $RDBASE/lib/libRDInchiLib.so.1.2013.06.1pre can't be found. Please note that I have turned on the flag of inchi. Thanks. Yingfeng -- How ServiceNow helps IT people transform IT departments: 1. A cloud service to automate IT design, transition and operations 2. Dashboards that offer high-level views of enterprise services 3. A single system of record for all IT processes http://p.sf.net/sfu/servicenow-d2d-j ___ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss -- How ServiceNow helps IT people transform IT departments: 1. A cloud service to automate IT design, transition and operations 2. Dashboards that offer high-level views of enterprise services 3. A single system of record for all IT processes http://p.sf.net/sfu/servicenow-d2d-j___ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
Re: [Rdkit-discuss] install error
Jan, Thanks. I just found the problem. The environment setting is in .bashrc, which is not for sudo. Now, I install everything in a local directory, and don't need sudo. Then it works now. Sorry about my confusing mistake. Yingfeng On Wed, Jun 5, 2013 at 11:22 AM, Jan Holst Jensen j...@biochemfusion.comwrote: OK, that looks fine. And I assume you build directly in /opt/RDKit_latest/latest/, so 'make install' puts files in /opt/RDKit_latest/latest/lib/. The only other thing that comes to my mind is if your boost libraries are included in LD_LIBRARY_PATH. Cheers -- Jan On 2013-06-05 16:55, Yingfeng Wang wrote: Yes, I did. export RDBASE=/opt/RDKit_latest/latest export LD_LIBRARY_PATH=$RDBASE/lib:$LD_LIBRARY_PATH export PYTHONPATH=$RDBASE:$PYTHONPATH I put them on ~/.bashrc On Wed, Jun 5, 2013 at 10:53 AM, Jan Holst Jensen j...@biochemfusion.comwrote: Hi Yingfeng, Looks like what happened to me, when I had forgotten to set the environment. Did you set LD_LIBRARY_PATH to $RDBASE/lib before running the tests ? Kind regards -- Jan Holst Jensen On 2013-06-05 16:09, Yingfeng Wang wrote: Yes. I tried again. This time, after run download-inchi.sh I mkdir build cd build sudo cmake .. -DRDK_BUILD_INCHI_SUPPORT=ON sudo make sudo make install by far, no error reported. but, when I run sudo ctest I got The following tests FAILED: 1 - testInchi (OTHER_FAULT) 3 - testDataStructs (OTHER_FAULT) 4 - pyBV (Failed) 5 - pyDiscreteValueVect (Failed) 6 - pySparseIntVect (Failed) 8 - testGrid (OTHER_FAULT) 9 - testPyGeometry (Failed) 12 - pyAlignment (Failed) 16 - pyDistGeom (Failed) 20 - graphmolMolOpsTest (SEGFAULT) 22 - graphmoltestChirality (OTHER_FAULT) 23 - graphmoltestPickler (OTHER_FAULT) 25 - testDepictor (OTHER_FAULT) 26 - pyDepictor (Failed) 29 - fileParsersTest1 (OTHER_FAULT) 30 - testMolSupplier (OTHER_FAULT) 31 - testMolWriter (OTHER_FAULT) 32 - testTplParser (OTHER_FAULT) 33 - testMol2ToMol (OTHER_FAULT) 35 - testReaction (OTHER_FAULT) 36 - pyChemReactions (Failed) 37 - testChemTransforms (OTHER_FAULT) 40 - testFragCatalog (OTHER_FAULT) 41 - pyFragCatalog (Failed) 42 - testDescriptors (OTHER_FAULT) 43 - pyMolDescriptors (Failed) 44 - testFingerprints (OTHER_FAULT) 45 - pyPartialCharges (Failed) 46 - testMolTransforms (OTHER_FAULT) 47 - pyMolTransforms (Failed) 48 - testForceFieldHelpers (OTHER_FAULT) 49 - pyForceFieldHelpers (Failed) 50 - testDistGeomHelpers (OTHER_FAULT) 51 - pyDistGeom (Failed) 52 - testMolAlign (OTHER_FAULT) 53 - pyMolAlign (Failed) 54 - testFeatures (OTHER_FAULT) 55 - pyChemicalFeatures (Failed) 56 - testShapeHelpers (OTHER_FAULT) 57 - pyShapeHelpers (Failed) 59 - pyMolCatalog (Failed) 61 - pySLNParse (Failed) 62 - pyGraphMolWrap (Failed) 63 - pyTestConformerWrap (Failed) 66 - pyMatCalc (Failed) 67 - pyCMIM (Failed) 68 - pyRanker (Failed) 70 - pyFeatures (Failed) 71 - pythonTestDbCLI (Failed) 72 - pythonTestDirML (Failed) 77 - pythonTestDirChem (Failed) Errors while running CTest Thanks. On Wed, Jun 5, 2013 at 5:54 AM, JP jeanpaul.ebe...@inhibox.com wrote: , Before running cmake - have you run ./External/INCHI-API/download-inchi.sh ? On 5 June 2013 04:13, Yingfeng Wang ywang...@gmail.com wrote: After getting the latest code by git, I install RDKit on my ubuntu 12.04. In the step of make install, I got CMake Error at External/INCHI-API/cmake_install.cmake:124 (FILE): It seems the file $RDBASE/lib/libRDInchiLib.so.1.2013.06.1pre can't be found. Please note that I have turned on the flag of inchi. Thanks. Yingfeng -- How ServiceNow helps IT people transform IT departments: 1. A cloud service to automate IT design, transition and operations 2. Dashboards that offer high-level views of enterprise services 3. A single system of record for all IT processes http://p.sf.net/sfu/servicenow-d2d-j___ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
Re: [Rdkit-discuss] separate module by breaking bonds
Dear Greg, I update the version of RDKit by git. And it works as you described, like from rdkit import Chem from rdkit.Chem import Descriptors m =Chem.MolFromInchi('InChI=1S/C10H9N3O/c1-7-11-10(14)9(13-12-7)8-5-3-2-4-6-8/h2-6H,1H3,(H,11,12,14)') em = Chem.EditableMol(m) em.RemoveBond(8,7) nm = em.GetMol() frags = Chem.GetMolFrags(nm,asMols=True,sanitizeFrags=False) from rdkit.Chem import AllChem [AllChem.CalcMolFormula(x) for x in frags] ['C4H4N3O', 'C6H5'] [Descriptors.ExactMolWt(x) for x in frags] [110.035436748, 77.03912516] But with inchi format [Chem.MolToInchi(x) for x in frags] ['InChI=1S/C4H5N3O/c1-3-6-4(8)2-5-7-3/h2H,1H3,(H,6,7,8)', 'InChI=1S/C6H6/c1-2-4-6-5-3-1/h1-6H'] it is still C6H6 not C6H5. Actually, I need the 2D structure of fragments of C6H5 (not necessary inchi format data). Is there a way to retrieve this information? Right now, a solution in my mind could be to retrieve the 2D information of the original compound (in my example, it's m) first. Then identify the removing bonds (in my example, it's Bond(8,7)). Finally, I can get 2D information of fragments. Could you please let me know whether there is a better solution to get 2D information of fragments? Thanks. Yingfeng On Sun, Jun 2, 2013 at 8:39 AM, Yingfeng Wang ywang...@gmail.com wrote: Dear Greg, Thank you very much! I think 'C6H5' is good enough to me. Yingfeng On Sun, Jun 2, 2013 at 12:25 AM, Greg Landrum greg.land...@gmail.comwrote: On Sat, Jun 1, 2013 at 6:46 AM, Yingfeng Wang ywang...@gmail.com wrote: Dear Greg, Thanks. As for In [19]: frags = Chem.GetMolFrags(nm,asMols=True) In [20]: [AllChem.CalcMolFormula(x) for x in frags] Out[20]: ['C4H5N3O', 'C6H6'] Is it possible to directly get 'C6H5+' instead of 'C6H6'? You can't get C6H5+, because there's not really any way for the code to know here to assign charges if you just call break bonds, but as of this morning (I just committed it) you can tell the RDKit not to sanitize the fragments: In [10]: frags = Chem.GetMolFrags(nm,asMols=True,sanitizeFrags=False) In [11]: [AllChem.CalcMolFormula(x) for x in frags] Out[11]: ['C4H4N3O', 'C6H5'] In [10]: frags = Chem.GetMolFrags(nm,asMols=True,sanitizeFrags=False) In [11]: [AllChem.CalcMolFormula(x) for x in frags] Out[11]: ['C4H4N3O', 'C6H5'] As for the difference between ExactMolWt() and MolWt(). The confusion is from the following case: [Chem.MolToSmiles(x) for x in frags] ['Cc1nncc(O)n1', 'c1c1'] Descriptors.MolWt(Chem.MolFromSmiles('Cc1nncc(O)n1')) 111.103998 Descriptors.MolWt(Chem.MolFromSmiles('c1c1')) 78.113999 [Descriptors.ExactMolWt(x) for x in frags] [111.04326178, 78.046950192] By far, every thing is perfect. But if I use [Descriptors.MolWt(x) for x in frags] [5.04, 6.048] It looks I can get correct mass by MolWt() if I transfer mol to Smiles format, and transfer Smiles format back to mol. However, if I directly apply MolWt() on the original mol, I got weird results. I can reproduce this and it looks like a bug. I'll get it fixed. -greg -- How ServiceNow helps IT people transform IT departments: 1. A cloud service to automate IT design, transition and operations 2. Dashboards that offer high-level views of enterprise services 3. A single system of record for all IT processes http://p.sf.net/sfu/servicenow-d2d-j___ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
[Rdkit-discuss] install error
After getting the latest code by git, I install RDKit on my ubuntu 12.04. In the step of make install, I got CMake Error at External/INCHI-API/cmake_install.cmake:124 (FILE): It seems the file $RDBASE/lib/libRDInchiLib.so.1.2013.06.1pre can't be found. Please note that I have turned on the flag of inchi. Thanks. Yingfeng -- How ServiceNow helps IT people transform IT departments: 1. A cloud service to automate IT design, transition and operations 2. Dashboards that offer high-level views of enterprise services 3. A single system of record for all IT processes http://p.sf.net/sfu/servicenow-d2d-j___ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
Re: [Rdkit-discuss] separate module by breaking bonds
Dear Greg, Thank you very much! I think 'C6H5' is good enough to me. Yingfeng On Sun, Jun 2, 2013 at 12:25 AM, Greg Landrum greg.land...@gmail.comwrote: On Sat, Jun 1, 2013 at 6:46 AM, Yingfeng Wang ywang...@gmail.com wrote: Dear Greg, Thanks. As for In [19]: frags = Chem.GetMolFrags(nm,asMols=True) In [20]: [AllChem.CalcMolFormula(x) for x in frags] Out[20]: ['C4H5N3O', 'C6H6'] Is it possible to directly get 'C6H5+' instead of 'C6H6'? You can't get C6H5+, because there's not really any way for the code to know here to assign charges if you just call break bonds, but as of this morning (I just committed it) you can tell the RDKit not to sanitize the fragments: In [10]: frags = Chem.GetMolFrags(nm,asMols=True,sanitizeFrags=False) In [11]: [AllChem.CalcMolFormula(x) for x in frags] Out[11]: ['C4H4N3O', 'C6H5'] In [10]: frags = Chem.GetMolFrags(nm,asMols=True,sanitizeFrags=False) In [11]: [AllChem.CalcMolFormula(x) for x in frags] Out[11]: ['C4H4N3O', 'C6H5'] As for the difference between ExactMolWt() and MolWt(). The confusion is from the following case: [Chem.MolToSmiles(x) for x in frags] ['Cc1nncc(O)n1', 'c1c1'] Descriptors.MolWt(Chem.MolFromSmiles('Cc1nncc(O)n1')) 111.103998 Descriptors.MolWt(Chem.MolFromSmiles('c1c1')) 78.113999 [Descriptors.ExactMolWt(x) for x in frags] [111.04326178, 78.046950192] By far, every thing is perfect. But if I use [Descriptors.MolWt(x) for x in frags] [5.04, 6.048] It looks I can get correct mass by MolWt() if I transfer mol to Smiles format, and transfer Smiles format back to mol. However, if I directly apply MolWt() on the original mol, I got weird results. I can reproduce this and it looks like a bug. I'll get it fixed. -greg -- Get 100% visibility into Java/.NET code with AppDynamics Lite It's a free troubleshooting tool designed for production Get down to code-level detail for bottlenecks, with 2% overhead. Download for free and get started troubleshooting in minutes. http://p.sf.net/sfu/appdyn_d2d_ap2___ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
Re: [Rdkit-discuss] separate module by breaking bonds
Greg, Thank you very much. Yingfeng On Fri, May 31, 2013 at 4:14 AM, Greg Landrum greg.land...@gmail.comwrote: On Fri, May 31, 2013 at 7:53 AM, Yingfeng Wang ywang...@gmail.com wrote: I think I need to add masses of all atoms for getting the mass of the whole fragment. Am I right? It's better to just use the built in functionality: In [2]: m = Chem.MolFromSmiles('c1c1') In [3]: from rdkit.Chem import Descriptors In [4]: Descriptors.MolWt(m) Out[4]: 78.113999 -greg -- Get 100% visibility into Java/.NET code with AppDynamics Lite It's a free troubleshooting tool designed for production Get down to code-level detail for bottlenecks, with 2% overhead. Download for free and get started troubleshooting in minutes. http://p.sf.net/sfu/appdyn_d2d_ap2___ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
Re: [Rdkit-discuss] separate module by breaking bonds
Greg, I got a weird case. With the following code, from rdkit import Chem from rdkit.Chem import Descriptors m =Chem.MolFromInchi('InChI=1S/C10H9N3O/c1-7-11-10(14)9(13-12-7)8-5-3-2-4-6-8/h2-6H,1H3,(H,11,12,14)') Descriptors.MolWt(m) 9.072 em = Chem.EditableMol(m) em.RemoveBond(8,7) nm = em.GetMol() frags = Chem.GetMolFrags(nm,asMols=True) [Descriptors.MolWt(x) for x in frags] [5.04, 6.048] It seems the mass of the original molecule is 9.072, while the summation of masses of its fragments is 5.04+6.048 9.072. I don't think it is caused by the precision problem. Could you please let me know how to remove the extra mass? Thanks. Yingfeng On Fri, May 31, 2013 at 8:58 AM, Yingfeng Wang ywang...@gmail.com wrote: Greg, Thank you very much. Yingfeng On Fri, May 31, 2013 at 4:14 AM, Greg Landrum greg.land...@gmail.comwrote: On Fri, May 31, 2013 at 7:53 AM, Yingfeng Wang ywang...@gmail.comwrote: I think I need to add masses of all atoms for getting the mass of the whole fragment. Am I right? It's better to just use the built in functionality: In [2]: m = Chem.MolFromSmiles('c1c1') In [3]: from rdkit.Chem import Descriptors In [4]: Descriptors.MolWt(m) Out[4]: 78.113999 -greg -- Get 100% visibility into Java/.NET code with AppDynamics Lite It's a free troubleshooting tool designed for production Get down to code-level detail for bottlenecks, with 2% overhead. Download for free and get started troubleshooting in minutes. http://p.sf.net/sfu/appdyn_d2d_ap2___ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
[Rdkit-discuss] dissociation energy
How do I retrieve the dissociation energy of a bond in a molecule. Say, I have from rdkit import Chem m =Chem.MolFromInchi('InChI=1S/C10H9N3O/c1-7-11-10(14)9(13- 12-7)8-5-3-2-4-6-8/h2-6H,1H3,(H,11,12,14)') mybond = m.GetBondBetweenAtoms(8,7) Is there a way for me to retrieve the dissociation energy of mybond? Thanks. Yingfeng -- Get 100% visibility into Java/.NET code with AppDynamics Lite It's a free troubleshooting tool designed for production Get down to code-level detail for bottlenecks, with 2% overhead. Download for free and get started troubleshooting in minutes. http://p.sf.net/sfu/appdyn_d2d_ap2___ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
Re: [Rdkit-discuss] separate module by breaking bonds
I change MolWt() into ExactMolWt(), and get Descriptors.ExactMolWt(m) 187.074561908 [Descriptors.ExactMolWt(x) for x in frags] [111.04326178, 78.046950192] According to the document, MolWt() outputs the average molecular weight of the molecule ignoring hydrogens, while ExactMolWt() is for the exact molecular weight of the molecule. What do I observe so big difference of mass? By the way, the mass of m calculated by the ExactMolWt () is still less than summation of its fragments. Thanks. Yingfeng On Fri, May 31, 2013 at 3:58 PM, Yingfeng Wang ywang...@gmail.com wrote: Greg, I got a weird case. With the following code, from rdkit import Chem from rdkit.Chem import Descriptors m =Chem.MolFromInchi('InChI=1S/C10H9N3O/c1-7-11-10(14)9(13-12-7)8-5-3-2-4-6-8/h2-6H,1H3,(H,11,12,14)') Descriptors.MolWt(m) 9.072 em = Chem.EditableMol(m) em.RemoveBond(8,7) nm = em.GetMol() frags = Chem.GetMolFrags(nm,asMols=True) [Descriptors.MolWt(x) for x in frags] [5.04, 6.048] It seems the mass of the original molecule is 9.072, while the summation of masses of its fragments is 5.04+6.048 9.072. I don't think it is caused by the precision problem. Could you please let me know how to remove the extra mass? Thanks. Yingfeng On Fri, May 31, 2013 at 8:58 AM, Yingfeng Wang ywang...@gmail.com wrote: Greg, Thank you very much. Yingfeng On Fri, May 31, 2013 at 4:14 AM, Greg Landrum greg.land...@gmail.comwrote: On Fri, May 31, 2013 at 7:53 AM, Yingfeng Wang ywang...@gmail.comwrote: I think I need to add masses of all atoms for getting the mass of the whole fragment. Am I right? It's better to just use the built in functionality: In [2]: m = Chem.MolFromSmiles('c1c1') In [3]: from rdkit.Chem import Descriptors In [4]: Descriptors.MolWt(m) Out[4]: 78.113999 -greg -- Get 100% visibility into Java/.NET code with AppDynamics Lite It's a free troubleshooting tool designed for production Get down to code-level detail for bottlenecks, with 2% overhead. Download for free and get started troubleshooting in minutes. http://p.sf.net/sfu/appdyn_d2d_ap2___ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss