Hello Everyone, Thanks a lot for your detailed replies and suggestions. Thanks, Andrew, for the code block; that also helped me understand what was happening.
I just realized my replies are not sent to the rdkit-discussion group. So, I am summarizing the origin of the warning and solution below for future readers: The output SDFs from the docking program do not have a second line mentioning 2D or 3D structure, so RDKit SDMolSupplier raised a warning but treated a structure as 3D. I processed these SDFs with obabel to add hydrogens, and then the second line is present, mentioning 3D structure as indicated by Jan Jensen in previous thread. Best, Mandar Kulkarni On Wed, Dec 13, 2023 at 4:28 PM Andrew Dalke <da...@dalkescientific.com> wrote: > > On Dec 13, 2023, at 06:46, Mandar Kulkarni < > mandar.kulkarni.c...@gmail.com> wrote: > > Thanks a lot for the detailed answer. In my case, this line is blank, > probably leading to warnings. > > Here's what RDKit does, from Code/GraphMol/FileParsers/MolFileParser.cpp > > If the dimension code is not 2D and not 3D it assumes 2D: > > if (tempStr.length() >= 22) { > std::string dimLabel = tempStr.substr(20, 2); > // Unless labelled as 3D we assume 2D > if (dimLabel == "3d" || dimLabel == "3D") { > res->setProp(common_properties::_3DConf, 1); > } > } > > > Then, if there are non-zero coordinates and it's not marked as 2D, it > issues the warning: > > bool nonzeroZ = hasNonZeroZCoords(conf); > > if (!nonzeroZ && marked3d == 1) { > .. I'm skipping the code for this case .. > } else if (marked3d == 0 && nonzeroZ) { > BOOST_LOG(rdWarningLog) > << "Warning: molecule is tagged as 2D, but at least one Z > coordinate is not zero. " > "Marking the mol as 3D." > << std::endl; > return true; > } > > Andrew > da...@dalkescientific.com > > >
_______________________________________________ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss