[Rdkit-discuss] problem compiling RDKit_Q22010_1

2010-08-25 Thread Paul Emsley

Hi,

I am trying to compile RDKit for the first time, ubuntu 10.04 x86_64

...
[ 82%] Building CXX object 
Code/GraphMol/SLNParse/CMakeFiles/SLNParse.dir/SLNParse.cpp.o
[ 83%] Building CXX object 
Code/GraphMol/SLNParse/CMakeFiles/SLNParse.dir/SLNAttribs.cpp.o
[ 83%] Building CXX object 
Code/GraphMol/SLNParse/CMakeFiles/SLNParse.dir/sln.tab.cpp.o
[ 84%] Building CXX object 
Code/GraphMol/SLNParse/CMakeFiles/SLNParse.dir/lex.yysln.cpp.o
Linking CXX shared library libSLNParse.so
/usr/bin/ld: 
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libboost_regex-mt.a(instances.o):
 
relocation R_X86_64_32 against 
`boost::object_cacheboost::re_detail::cpp_regex_traits_basechar, 
boost::re_detail::cpp_regex_traits_implementationchar 
 ::do_get(boost::re_detail::cpp_regex_traits_basechar const, 
unsigned long)::s_data' can not be used when making a shared object; 
recompile with -fPIC
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libboost_regex-mt.a: 
could not read symbols: Bad value
collect2: ld returned 1 exit status
make[2]: *** [Code/GraphMol/SLNParse/libSLNParse.so] Error 1
make[1]: *** [Code/GraphMol/SLNParse/CMakeFiles/SLNParse.dir/all] Error 2
make: *** [all] Error 2

Is this something known or should I start digging?

Is this the right thing to compile or should I be using the svn repo 
version?

Cheers,

Paul.


--
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users 
worldwide. Take advantage of special opportunities to increase revenue and 
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] problem compiling RDKit_Q22010_1

2010-08-25 Thread Paul Emsley
On 25/08/10 16:14, Greg Landrum wrote:
 Hi Paul,


 On Wed, Aug 25, 2010 at 7:26 AM, Paul Emsleypaul.ems...@bioch.ox.ac.uk  
 wrote:

 Hi,

 I am trying to compile RDKit for the first time, ubuntu 10.04 x86_64

 ...
 unsigned long)::s_data' can not be used when making a shared object;
 recompile with -fPIC
 /usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libboost_regex-mt.a:
 could not read symbols: Bad value
 collect2: ld returned 1 exit status
 make[2]: *** [Code/GraphMol/SLNParse/libSLNParse.so] Error 1
 make[1]: *** [Code/GraphMol/SLNParse/CMakeFiles/SLNParse.dir/all] Error 2
 make: *** [all] Error 2

 Is this something known or should I start digging?
  
 There's information about this problem (and a solution) towards the bottom 
 here:
 http://code.google.com/p/rdkit/wiki/BuildingWithCmake
 and in this thread:
 http://www.mail-archive.com/rdkit-discuss@lists.sourceforge.net/msg01119.html

 I've also made some changes in svn so that the situation doesn't occur
 if you are willing to use a non-release version of the code.



Hi Greg and Riccardo,

Thanks for your prompt replies.

I re-ran cmake with -DBoost_USE_STATIC_LIBS=OFF, however, it still 
failed at the same place.

I checked out the latest revision and that compiles cleanly.

Thanks,

Paul.





--
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users 
worldwide. Take advantage of special opportunities to increase revenue and 
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


[Rdkit-discuss] Generating 3D coordinates

2010-09-10 Thread Paul Emsley

Hi All,

I've been tinkering a bit more with RDKit and having fun.

I have hit a problem though. I am trying to reproduce Greg's Generating 
3D coordinates in RDKit-overview.pdf in C++:

This is what I have (mostly via cut 'n paste):



int
main(int argc, char **argv) {

std::string smiles_string = C1CCC1;

RDKit::RWMol *mol=new RDKit::RWMol();
mol = RDKit::SmilesToMol(smiles_string);
RDDepict::compute2DCoords(*mol);

double vdwThresh=10.0;
int confId = -1;
bool ignoreInterfragInteractions=true;
int maxIters = 200;

ForceFields::ForceField *ff =
   RDKit::UFF::constructForceField(*mol,
   vdwThresh, confId,
   ignoreInterfragInteractions);
ff-initialize();
int res=ff-minimize(maxIters);
delete ff;

std::cout  RDKit::MolToMolBlock(*mol, true, -1)  std::endl;

return 0;
}


But I get 2D coordinates:


  RDKit  2D

   5  5  0  0  0  0  0  0  0  0999 V2000
 1.28790.0. C   0  0  0  0  0  0  0  0  0  0  0  0
 0.39801.22490. C   0  0  0  0  0  0  0  0  0  0  0  0
-1.04190.75700. C   0  0  0  0  0  0  0  0  0  0  0  0
-1.0419   -0.75700. C   0  0  0  0  0  0  0  0  0  0  0  0
 0.3980   -1.22490. C   0  0  0  0  0  0  0  0  0  0  0  0
   1  2  1  0
   2  3  1  0
   3  4  1  0
   4  5  1  0
   5  1  1  0
M  END


What makes 3D coordinates?  (I'm guessing it's a one-liner somewhere...)

Cheers,

Paul.


--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing
http://p.sf.net/sfu/novell-sfdev2dev
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] Generating 3D coordinates

2010-09-11 Thread Paul Emsley

 It's kind of interesting (and encouraging) that the optimizer doesn't
 completely freak out when you hand it a 2D conformer. :-)



Ah... :)

 What makes 3D coordinates?  (I'm guessing it's a one-liner somewhere...)
  
 It is indeed a one-liner (two lines with a bit of error checking). To
 get a 3D conformer, you need to include
 GraphMol/DistGeomHelpers/Embedder.h  and do the following:

 int cid = DGeomHelpers::EmbedMolecule(*m);
 if(cid0) // embedding failed, do something

 There are a bunch of optional arguments to EmbedMolecule, but the
 defaults normally work reasonably well.



So it seems!

Fantastic, that did it.

It's pretty jaw dropping that so much power can be added with so little 
code (on my part :)

More later.

Cheers,

Paul.




--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing
http://p.sf.net/sfu/novell-sfdev2dev
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


[Rdkit-discuss] compiling with -Wundef

2010-09-12 Thread Paul Emsley

Hi,

If I try to compile using RDKit's Invariant.h using g++ with -Wundef:

/home/paul/rdkit/svn/rdkit/trunk/Code/RDGeneral/Invariant.h:142:7: 
warning: INVARIANT_ASSERT_METHOD is not defined
/home/paul/rdkit/svn/rdkit/trunk/Code/RDGeneral/Invariant.h:151:7: 
warning: INVARIANT_SILENT_METHOD is not defined

What should be done?  For now, I will not use -Wundef.


If I try to compile with -Werror

In file included from /usr/include/c++/4.4/backward/hash_set:60,
  from /usr/include/boost/graph/adjacency_list.hpp:25,
  from 
/home/paul/rdkit/svn/rdkit/trunk/Code/GraphMol/ROMol.h:20,
  from 
/home/paul/rdkit/svn/rdkit/trunk/Code/GraphMol/GraphMol.h:15,
  from 
/home/paul/rdkit/svn/rdkit/trunk/Code/GraphMol/RDKitBase.h:21,
  from ../../lidia-merge/coot/lbg/rdkit-interface.cc:6:
/usr/include/c++/4.4/backward/backward_warning.h:28:2: error: #warning 
This file includes at least one deprecated or antiquated header which 
may be removed without further notice at a future date. Please use a 
non-deprecated interface with equivalent functionality instead. For a 
listing of replacement headers and interfaces, consult the file 
backward_warning.h. To disable this warning use -Wno-deprecated.

OK, so I don't use -Werror, but ideally I'd like a pony^H^H^H^H way of 
not triggering the backwards warnings.  It superficially looks like a 
boost issue though...

Cheers,

Paul.


--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing
http://p.sf.net/sfu/novell-sfdev2dev
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] Updates to the build system

2010-09-15 Thread Paul Emsley
On 15/09/10 05:38, Greg Landrum wrote:
 Dear all,

 Thanks to some really great help from Gianluca Sforna and Riccardo
 Vianello, the RDKit build system has been updated to make installing
 the software in standard locations (like /usr/local on linux machines)
 easier. The changes should also make it possible for the RDKit to be
 packaged for integration with linux distributions, which will make it
 lot easier for people who don't want to have to think about compiling
 things to install the RDKit. This is exciting news.

 There are instructions for the updated build system here:
 http://code.google.com/p/rdkit/wiki/NewLinuxBuild

 Please note that the default behavior should be basically the same as
 the previous system, so the following should still work:
 % mkdir build; cd build
 % cmake ..
 % make install

 The only difference should be that you need to add $RDBASE/lib to
 LD_LIBRARY_PATH instead of $RDBASE/bin

 It would be really, really helpful if people could try out the new
 system and let us know how it works.


Thanks - this is a substantial step forward in convenience.

Works great.  I am using this system now to compile and link with my app.

Cheers,

Paul.


--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] newbie help cleaning up sterochemistry in SMILES string

2010-09-18 Thread Paul Emsley
On 18/09/10 05:19, Greg Landrum wrote:
 On Sat, Sep 18, 2010 at 12:05 AM, Geoffrey Hutchison
 ge...@geoffhutchison.net  wrote:

 So now with the replace function in python I can easily remove
 sterochem information from the molecule.

 smiles_corrected = smiles_broken.replace(@,)

 Once I remove the stereochemistry , libcheck does the right thing and
 gives me the right 3D coordinates.

 This doesn't make chemical sense, though. If libcheck is operating on a 
 SMILES without stereochemistry, there's no way it can always give the right 
 3D coordinates. If you have N stereo centers, the chance of a correct 3D 
 structure will be (0.5)^N.

 I'd suggest using a different tool. For example, the upcoming Open Babel 2.3 
 will handle 3D coordinate generation while ensuring stereochemistry.

 But you don't have to use OB -- I'm just saying that your 3D coordinates 
 won't respect stereo with your approach.
  
 Geoff's point is a good one: if you remove the stereochemistry
 information from the SMILES and then generate 3d coordinates, your
 odds of getting a correct 3d structure are not good. I had assumed
 that you had bad stereochemistry info in the SMILES that you wanted to
 get rid of. If the stereochem is correct, then it might be a good idea
 to try Geoff's idea and use OB 2.3 when it's released or to use the
 RDKit's 3D coordinate generation (also respects stereochemistry),
 write the files as SDF, and then use the current version of OB to
 translate to a PDB if you need things in that format.



The (additional) useful thing libcheck can do is generate esd geometry 
restraints for crystallographic refinement (something like the spring 
constants, e.g. 0.02A for a C-C single bonds, 3 degrees for C-C-C 
angles etc. (atom type dependent, of course) - also planes and 
torsions). I wonder how hard that would be to get 
similar/compatible/corresponding numbers by digging into RDKit's UFF 
(presumably that would be the way to do it).  Any thoughts/advice?

Thanks,

Paul.



--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


[Rdkit-discuss] assignRadicals...

2010-09-19 Thread Paul Emsley

Hi,

It seems to me that the declaration void assignRadicals(RWMol mol) 
needs to be added to MolOps.h

Cheers,

Paul.



--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] svg export from rdkit messed up in Adobe Illustrator , but not in firefox / chrome: fixes?

2010-09-24 Thread Paul Emsley

As a hack, I suppose that you could add

transform=scale(0.2) (or some such) to the attributes of the paths for 
the glyph symbols.

i.e.

replace

path style=stroke:none; d=M 0.5 1.765625 L 0.5 -7.046875 L 5.5 
-7.046875 L 5.5 1.765625 L 0.5 1.765625 Z M 1.0625 1.21875 L 4.9375 
1.21875 L 4.9375 -6.484375 L 1.0625 -6.484375 L 1.0625 1.21875 Z M 
1.0625 1.21875 /

with

path transform=scale(0.2) style=stroke:none; d=M 0.5 1.765625 L 
0.5 -7.046875 L 5.5 -7.046875 L 5.5 1.765625 L 0.5 1.765625 Z M 1.0625 
1.21875 L 4.9375 1.21875 L 4.9375 -6.484375 L 1.0625 -6.484375 L 1.0625 
1.21875 Z M 1.0625 1.21875 /

and do that for each of the glyphs.

Paul.


--
Nokia and ATT present the 2010 Calling All Innovators-North America contest
Create new apps  games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


[Rdkit-discuss] kekulizing carbazole

2010-10-31 Thread Paul Emsley

Hi,

I'm running into problems when I try to kekulize carbazole.

The description I start with is that all the bonds are marked as 
Bond::AROMATIC and I do setIsAromatic(true) on all the atoms (which are 
all non-hydrogens).  The explicitValence() for the N is 3.

MolOps::Kekulize() fails in that case, Can't kekulize mol.

If I add single bonds to hydrogens (including a hydrogens on the N) then 
MolOps::Kekulize() works.

So my question is, how should I adjust the molecule description in the 
first case so that MolOps::Kekulize() works without hydrogens too?

Thanks,

Paul.


--
Nokia and ATT present the 2010 Calling All Innovators-North America contest
Create new apps  games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] kekulizing carbazole

2010-11-01 Thread Paul Emsley
On 31/10/10 14:18, Greg Landrum wrote:
 Hi Paul,

 On Sun, Oct 31, 2010 at 12:09 PM, Paul Emsley
 paul.ems...@bioch.ox.ac.uk  wrote:


 I'm running into problems when I try to kekulize carbazole.

 The description I start with is that all the bonds are marked as
 Bond::AROMATIC and I do setIsAromatic(true) on all the atoms (which are
 all non-hydrogens).  The explicitValence() for the N is 3.

 MolOps::Kekulize() fails in that case, Can't kekulize mol.

 If I add single bonds to hydrogens (including a hydrogens on the N) then
 MolOps::Kekulize() works.

 So my question is, how should I adjust the molecule description in the
 first case so that MolOps::Kekulize() works without hydrogens too?
  
 The problem is probably the lack of an explicit H on the nitrogen
 atom. It's easily demonstrated with pyrrole:

 [2]  m=Chem.MolFromSmiles('c1cccn1')
 [15:10:05] Can't kekulize mol

 You can fix this by letting the RDKit know that there's an H on the N atom:
 [3]  m=Chem.MolFromSmiles('c1ccc[nH]1')
 [4]

 Carbazole is the same story:
 [4]  m=Chem.MolFromSmiles('c1ccc2c(c1)[nH]c1c21')
 [5]

 Note that in either case if you provide the structure in its Kekule
 form this doesn't happen, here's the illustration for pyrrole:
 [5]  m=Chem.MolFromSmiles('C1=CC=CN1')
 [6]  Chem.MolToSmiles(m)
 Out[6] 'c1cc[nH]c1'

 There's an argument to be made that the Kekulization code could be
 made more robust with respect to this particular edge case, but to
 this point the effort involved has not seem justified by the payoff:
 most of the time the H is present in the SMILES, so this problem
 doesn't occur.



Hi Greg,

Thanks for your informative and speedy reply.

For the record, I would like to describe how I proceeded in the light of 
your reply.

My starting point to construct an RWMol is an mmCIF restraints file.  As 
well as containing description of the bonds and angles (etc.) this file 
describes the atoms, part of the description of which is the 
type_energy.  Pyrrole and carbazole Ns (for example) have the type 
NR15(energy types are listed in energy_lib.cif [1]) so now when I see 
an atom of that type [2], I add an extra H bonded to the N and 
everything is then peachy.

Thanks again,

Paul.

[1] 
http://www.ccp4.ac.uk/ccp4bin/viewcvs/ccp4/lib/data/monomers/ener_lib.cif
[2] there are other cases that I need to handle






--
Nokia and ATT present the 2010 Calling All Innovators-North America contest
Create new apps  games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


[Rdkit-discuss] C++ documentation?

2011-10-20 Thread Paul Emsley

Hi,

Is there a web presence for the C++ documentation that I am missing?

The easy-to-find link:
http://rdkit.org/C++_Docs
seems empty.

Thanks,

Paul.



--
The demand for IT networking professionals continues to grow, and the
demand for specialized networking skills is growing even more rapidly.
Take a complimentary Learning@Ciosco Self-Assessment and learn 
about Cisco certifications, training, and career opportunities. 
http://p.sf.net/sfu/cisco-dev2dev
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


[Rdkit-discuss] MolFileAtomLine() massDiff

2012-02-04 Thread Paul Emsley
Greg,

Just a small FYI:

According to ctfile.pdf, the mass difference on the atom line in the 
atom block should be clamped between -3 to 4 (inclusive).

I discovered this because MolToMolFile() had written out a mol file with 
mass diffs of -11, -13, -15 :)
(I had presumed that when I used atom-setAtomicNum() that would set the 
mass as needed. Now I see that it does not)

Cheers,

Paul.



--
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


[Rdkit-discuss] MolChemicalFeature.h installed?

2012-02-06 Thread Paul Emsley

Hi Greg,

Maybe I'm missing something...

Is it possible for you to add an rdkit_headers for MolChemicalFeature.h 
and friends in Code/GraphMol/MolChemicalFeatures/CMakeLists.txt?

Thanks,

Paul.


--
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] generate atom names?

2012-04-11 Thread Paul Emsley
On 10/04/12 12:01, Greg Landrum wrote:
 On Tue, Apr 10, 2012 at 11:07 AM, Paul Emsley
 paul.ems...@bioch.ox.ac.uk  wrote:
 (Just making sure I have not missed anything...)

 Is there a function that generates unique atom names (using
 at-setProp(name, name) presumably) for a given molecule? (I don't see
 such a thing).
 There is not. The corresponding python is pretty easy,

OK, thanks.  I start to dip my toe in pythonic-rdkit waters...

 but there's not
 anything that's currently part of the RDKit.

 What are you interested in doing with the names?



making pdbx restraints for macromolecular refinement and model-building.

Cheers,

Paul.



--
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second 
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


[Rdkit-discuss] un-oneandahalfs

2012-04-12 Thread Paul Emsley

Hi all,

(Sorry for another noob question)

When creating a 2d depiction, or otherwise, is there a way to turn a 
carboxylate (with ONEANDAHALF bonds between the carbon and oxygens) into 
something with a carbonyl oxygen (DOUBLE) and a hydroxyl oxygen (SINGLE)?

Cheers,

Paul.


--
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] un-oneandahalfs

2012-04-15 Thread Paul Emsley
On 15/04/12 16:36, Paul Emsley wrote:
 On 14/04/12 06:14, Greg Landrum wrote:
 On Thu, Apr 12, 2012 at 1:05 PM, Paul 
 Emsleypaul.ems...@bioch.ox.ac.uk  wrote:

 When creating a 2d depiction, or otherwise, is there a way to turn a
 carboxylate (with ONEANDAHALF bonds between the carbon and oxygens) 
 into
 something with a carbonyl oxygen (DOUBLE) and a hydroxyl oxygen 
 (SINGLE)?

 There's good news and bad news.
 The good news: You can easily do this with either a reaction or
 replaceSubstructs().
 The bad news: In either case you will need to construct the query
 molecules in your code manually since there's not currently a way to
 construct an RDKit molecule containing a ONEANDAHALF bond from a
 file/string.

 Here's some (untested) code showing how you might build a reaction
 that does what you want; I guess C++ is more useful to you than
 python, right?:
// the reactant:
RWMol *r1;
Atom *at;
at = new Atom(6);
at-setProp(molAtomMapNumber,1);
r1-addAtom(at);
at = new Atom(8);
at-setProp(molAtomMapNumber,2);
r1-addAtom(at);
at = new Atom(8);
at-setProp(molAtomMapNumber,3);
at-setFormalCharge(-1);
r1-addAtom(at);
r1-addBond(0,1,Bond::ONEANDAHALF);
r1-addBond(0,2,Bond::ONEANDAHALF);

// the product:
RWMol *p1;
at = new Atom(6);
at-setProp(molAtomMapNumber,1);
p1-addAtom(at);
at = new Atom(8);
at-setProp(molAtomMapNumber,2);
p1-addAtom(at);
at = new Atom(8);
at-setProp(molAtomMapNumber,3);
at-setFormalCharge(-1);
p1-addAtom(at);
p1-addBond(0,1,Bond::DOUBLE);
p1-addBond(0,2,Bond::SINGLE);

ChemicalReaction rxn2;
ROMOL_SPTR rsptr(static_castROMol *(r1));
rxn2.addReactantTemplate(rsptr);
ROMOL_SPTR psptr(static_castROMol *(p1));
rxn2.addProductTemplate(psptr);
rxn2.initReactantMatchers();

 Some notes:
 1) the above snippet can only work as-is with the most recent version
 of the RDKit or svn versions starting last month (dating back to when
 I made the changes to the way atom-atom matches are handled)
 2) this will only replace one group at a time. You'll need to call it
 multiple times, taking the first product each time, until
 isMoleculeReactantOfReaction(rxn2,mol,0) returns false.

 An easier approach, but one that will not respect isotopic labels in
 your input molecule (i.e. they will be lost when you do the
 transformation) uses replaceSubstructs(). Here's a (also untested)
 snippet for that:

RWMol *r1;
Atom *at;
at = new Atom(6);
r1-addAtom(at);
at = new Atom(8);
r1-addAtom(at);
at = new Atom(8);
at-setFormalCharge(-1);
r1-addAtom(at);
r1-addBond(0,1,Bond::ONEANDAHALF);
r1-addBond(0,2,Bond::ONEANDAHALF);

// the product:
RWMol *p1;
at = new Atom(6);
p1-addAtom(at);
at = new Atom(8);
p1-addAtom(at);
at = new Atom(8);
at-setFormalCharge(-1);
p1-addAtom(at);
p1-addBond(0,1,Bond::DOUBLE);
p1-addBond(0,2,Bond::SINGLE);

std::vectorROMOL_SPTR  nms;
nms = replaceSubstructs(*mol1,*r1,*p1,true);


 Does this help at all?


 Hi Greg,

 Thanks for that.

 C++ or python:  Yes, C++ - for the moment at least :)

 Seeing as I am trying to make a picture, I think the 
 replaceSubstructs() is the path of choice.

 Cheers,

 Paul.




--
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] [Rdkit-devel] 2012.03 (Q1 2012) RDKit release

2012-04-16 Thread Paul Emsley
On 13/04/12 05:37, Greg Landrum wrote:
 I'm very happy to announce that the next version of the RDKit --
 2012.03 (a.k.a Q1 2012) -- is released.

Cool - thanks.  Compiling now.

In the pages:

http://sourceforge.net/projects/rdkit/files/rdkit/Q1_2012/
http://sourceforge.net/projects/rdkit/files/

I found the  Looking for the latest version? navigation somewhat 
confusing.

Paul.


--
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


[Rdkit-discuss] PyObject * - RDKit::ROMol *

2012-04-29 Thread Paul Emsley

Hi all,

I am trying to write a C++ function to examine an RDKit::ROMol... but 
running it from a python script:

m = Chem.MolFromSmilesString('Oc1c1')
do_cool_stuff(m)

my C++ (which gets swigged) is:

PyObject *do_cool_stuff(PyObject *pyo) {

RDKit::ROMol *mol = magic(pyo);
inner_cool_stuff(mol);
...
}

What is magic() ? I've a feeling that it should be straightforward (to 
use, at least) - with exception handling, I imagine. I've had a look at 
various Wrap code, but I can't decode it. pyo is not a tuple, I know 
that much. Sorry to say that my wrapping skills leave something to be 
desired.

Cheers,

Paul.



--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] PyObject * - RDKit::ROMol *

2012-04-30 Thread Paul Emsley
On 30/04/12 08:39, Uwe Hoffmann wrote:
 Hi,
 Am 29.04.2012 16:19, schrieb Paul Emsley:

 I am trying to write a C++ function to examine an RDKit::ROMol... but
 running it from a python script:

 m = Chem.MolFromSmilesString('Oc1c1')
 do_cool_stuff(m)

 my C++ (which gets swigged) is:

 PyObject *do_cool_stuff(PyObject *pyo) {

   RDKit::ROMol *mol = magic(pyo);
 using a reference instead of pointer access:

 RDKit::ROMolmol = boost::python::extractRDKit::ROMol(m);



Ah!  Magic!  Just what I wanted.

(actually, I forgot that Greg was away, or I would have held back on 
sending this :-)

Cheers,

Paul.



--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] PIL - molecule depiction

2012-05-07 Thread Paul Emsley
On 07/05/12 12:49, paul.czodrow...@merckgroup.com wrote:
 Dear RDKitters,

 when typing in
 from rdkit.sping import PIL
 I end up in this error message
 
 Traceback (most recent call last):
File stdin, line 1, inmodule
File
 /SW/python/x86_64/2.6/lib/python2.6/site-packages/rdkit/sping/PIL/__init__.py,
   line 2, inmodule
  from pidPIL import *
File
 /SW/python/x86_64/2.6/lib/python2.6/site-packages/rdkit/sping/PIL/pidPIL.py,
   line 33, inmodule
  import Image, ImageFont, ImageDraw
 ImportError: No module named Image
 

 My first guess would be that some path (PYTHONPATH) setting is wrong, but
 I'm not sure about it...


Of the top of my head,

either

(yes) PYTHONPATH is not set so that it can find Image.py

or LD_LIBRARY_PATH is not set so that it can find libImage.so

HTH,

Paul.




--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] speed of Tanimoto similarity calculations

2012-05-07 Thread Paul Emsley
On 07/05/12 15:13, Uwe Hoffmann wrote:
 hi,
 Am 07.05.2012 14:40, schrieb Gonzalo Colmenarejo-Sanchez:
 Hi,

 I'm using these compilation options:
 g++ -o tanird tanird.cpp -I$RDBASE/Code -I$RDBASE/Extern -L$RDBASE/lib 
 -lChemReactions -lFileParsers -lSmilesParse -lDepictor -lSubstructMatch 
 -lGraphMol -lDataStructs -lRDGeometryLib -lRDGeneral -lFingerprints 
 -I/GWD/schem/apps/rdkit/build-env/include

 Does anyone have a clue on what's going on?

 maybe libFingerprints is not the improved non-release version

I think that's it.  For me,

$ nm $RDBASE/lib/libFingerprints.so | grep 'RDKFingerprint.*Mol.*vector'
returns
c5d0 T 
_ZN5RDKit17RDKFingerprintMolERKNS_5ROMolEbdjbbPSt6vectorIjSaIjEE

If you get a blank then libFingerprints.so is not up to date/consistent 
with the header.


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] Molecule with no atoms, so is it valid?

2012-05-25 Thread Paul Emsley
On 23/05/12 13:24, JP wrote:

 The generator is going to give me an empty (third) molecule?  So I 
 have to always dirty my code with m.GetNumAtoms()  0 in that loop. 
  What is the empty molecule is at the end of the file (ouch)?


I'm curious about this point in particular. I don't know the details of 
your code of course, but it seems to me that it is more pythonic to ask 
forgiveness than permission.  So replace GetNumAtoms() with try/except 
and catch the exception of bad-stuff-happened - presumably when you do a 
clean_mol[i] or some such...

Paul.




--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


[Rdkit-discuss] python/c++ interface again...

2012-06-01 Thread Paul Emsley

Hi,

I've been trying to read boost python docs and I am lost...

I'd like to return a PyObject *.  I have a RDKit::RWMol, say - or a 
pointer to a new one if need be...

// return a regularized molecule (copy of input with coordinates replaced)
PyObject *
coot::regularize(PyObject *mol_in_py) {

RDKit::ROMol mol = 
boost::python::extractRDKit::ROMol(mol_in_py); // thanks Uwe H
.. do stuff ..
// construct return value
RDKit::RWMol *regularized_mol = new RDKit::RWMol(mol);  // needs 
boostifying?
update_coords(regularized_mol);  // replace with refined positions

return somehow_wrap(regularized_mol);

}

What is somehow_wrap()?  What should I have read to find this out for 
myself?

Cheers,

Paul.


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] python/c++ interface again...

2012-06-02 Thread Paul Emsley
On 02/06/12 04:44, Greg Landrum wrote:

 On Fri, Jun 1, 2012 at 1:41 PM, Paul Emsleypaul.ems...@bioch.ox.ac.uk  
 wrote:
 I'd like to return a PyObject *.  I have a RDKit::RWMol, say - or a
 pointer to a new one if need be...
 If you are using a boost.python interface, and your function is
 exposed using boost::python::def, then the right thing happens
 more-or-less automatically if you have a function that returns an
 RDKit::RWMol * ... [snip]


Thanks.   I will mail to devel list later.

Paul.


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


[Rdkit-discuss] Fwd: Re: RDKit-based implementation of QED (quantitative estimation of drug-likeness)

2012-06-11 Thread Paul Emsley


seems to have got stuck - trying again...


 Original Message 
Subject: 	Re: [Rdkit-discuss] RDKit-based implementation of QED 
(quantitative estimation of drug-likeness)

Date:   Mon, 11 Jun 2012 06:57:28 +0100
From:   Paul Emsley paul.ems...@bioch.ox.ac.uk
To: 	rdkit-discuss@lists.sourceforge.net 
rdkit-discuss@lists.sourceforge.net




On 30/03/12 15:27, Hans De Winter wrote:

Hi -

A RDKit-based implementation of the QED measure as described by 
Richard Bickerton (Nature Chemistry, 2012, 4, 90-98) has been 
implemented and made available  for download from our website ( 
www.silicos-it.com http://www.silicos-it.com  Biscu-it).





Hi Hans,

Can I encourage you (as Greg does) to add a copyright notice and a 
reference to the licence at the top of the files?


Where do the alert SMARTS come from?

Cheers,

Paul.

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] Building on CentOS 5.8: Python-related tests fail

2012-06-23 Thread Paul Emsley
On 23/06/12 14:05, Paul Emsley wrote:
   if you do encounter such, your solution may be somewhat simpler.


Ooops, I meant:

if you do *not* encounter such ...




--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] Announcement: 1st RDKit User Group Meeting scheduled

2012-07-06 Thread Paul Emsley
  On 06/07/12 10:06, JP wrote:
 I just noticed that this is a user meeting and not a dev one - so 
 perhaps such a topic is out of scope...

What's the difference?

A user uses python and a dev uses python, boost.python and c++?

Anyway, I too (AFAICS ATM) would be interested in your suggestion (FWIW).

Paul.


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] Detecting rings and bond types from PDB HETATM record

2012-07-06 Thread Paul Emsley
On 06/07/12 10:27, JP wrote:
 Steifl -- that is a really crafty and less painful way how to go about 
 it.

 The SMILES is in fact, a wget call away - since I am processing PDB 
 deposited structures.
 http://www.rcsb.org/pdb/rest/describeHet?chemicalID=NAG

It is not clear to me how the SMILES helps you.  You still have to map 
between rdkit atoms and PDB atom names, do you not? How about using the 
monomer library?

http://www2.mrc-lmb.cam.ac.uk/groups/murshudov/content/refmac/Dictionary/dictionary.html


 Of course, this approach is not generally applicable (and for this 
 you'd need the perception code Greg mentioned).

Hmm... I am unconvinced that you want to be doing chemistry perception.



 For the protein I can somehow guess the bonds.

What do you mean by guess here?  Are you worried about histidine 
protonation?




--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] RDKIT installation issue on Centos 5.6

2012-07-19 Thread Paul Emsley
  On 19/07/12 13:28, Fabian Dey wrote:
 Dear all,

 I am having difficulties installing RDKIT on a Centos 5.6 (with python 
 bindings).
 I compiled and installed  the latest numpy, boost and cmake version 
 from their sources (I had also tried using
 the versions available through yum - which are quite old compared to 
 the most up-to-date version). I updated
 LD_LIBRARY_PATH to include the boost libraries and compiled RDKIT as 
 mentioned in the installation instruction,
 which finishes without a single error. However, when I run make test 
 I get a lot of seg-faults (only with python
 tests):


Related?

http://stackoverflow.com/questions/4959872/py-initmodule4-with-djapian-xapian

FYI, this is how I run cmake:

$ cmake -DRDK_INSTALL_INTREE=0  -DBOOST_ROOT=/usr/local \
-DBoost_USE_STATIC_LIBS=OFF -DCMAKE_INSTALL_PREFIX=/usr/local ..


$ cat /etc/redhat-release
CentOS release 5.7 (Final)
$ uname -m
x86_64




--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] problems with RDKit and Mountain Lion

2012-10-09 Thread Paul Emsley


homebrew is using the old svn repo?


On 09/10/12 22:33, James Swetnam wrote:

George-

My templating fix was submitted as 2155, and HEAD in SVN is at 2234. 
 I'm not terribly familiar with homebrew, or why it thinks 2148 is HEAD


James

On Tue, Oct 9, 2012 at 2:27 PM, George Papadatos gpapada...@gmail.com 
mailto:gpapada...@gmail.com wrote:


Hi James,

Many thanks for the quick answer. I'm afraid I'm already using the
trunk:
brew install -v --HEAD rdkit --with-inchi
(revision 2148)

Regards,

George


On 9 October 2012 21:30, James Swetnam jswet...@gmail.com
mailto:jswet...@gmail.com wrote:

George-

I believe you're running into an issue that was raised on the
developer list.  I submitted a patch for this issue, which has
been applied in the SVN trunk.  If you install from trunk you
should be fine.

Best
James

On Tue, Oct 9, 2012 at 12:52 PM, George Papadatos
gpapada...@gmail.com mailto:gpapada...@gmail.com wrote:

HI RDKitters,

I get compilation errors when I try to build RDKit on a
new Mountain Lion Mac OS machine.
I've tried both Eddie's brew formula and manual
installation with cmake. I also tried both the beta
2012_09 versions and the 2012_06 one.
Apart from the system python, I use the python.org
http://python.org version (2.7.3)
I also used brew to build boost from source. I copied the
error I get at the bottom of this message.

Has anyone had a similar problem? Any ideas for
troubleshooting?

Many thanks,

George


Linking CXX shared library ../../lib/libGraphMol.dylib
cd /tmp/rdkit-urlC/Code/GraphMol 
/usr/local/Cellar/cmake/2.8.9/bin/cmake -E
cmake_link_script CMakeFiles/GraphMol.dir/link.txt --verbose=1
/usr/local/Library/ENV/4.3/c++ -shared  
-compatibility_version 1.0.0 -current_version 2012.9.1 -o

../../lib/libGraphMol.2012.09.1pre.dylib -install_name
/tmp/rdkit-urlC/lib/libGraphMol.1.dylib
CMakeFiles/GraphMol.dir/Atom.cpp.o
CMakeFiles/GraphMol.dir/QueryAtom.cpp.o
CMakeFiles/GraphMol.dir/QueryBond.cpp.o
CMakeFiles/GraphMol.dir/Bond.cpp.o
CMakeFiles/GraphMol.dir/MolOps.cpp.o
CMakeFiles/GraphMol.dir/FindRings.cpp.o
CMakeFiles/GraphMol.dir/ROMol.cpp.o
CMakeFiles/GraphMol.dir/RWMol.cpp.o
CMakeFiles/GraphMol.dir/PeriodicTable.cpp.o
CMakeFiles/GraphMol.dir/atomic_data.cpp.o
CMakeFiles/GraphMol.dir/QueryOps.cpp.o
CMakeFiles/GraphMol.dir/MolPickler.cpp.o
CMakeFiles/GraphMol.dir/Canon.cpp.o
CMakeFiles/GraphMol.dir/AtomIterators.cpp.o
CMakeFiles/GraphMol.dir/BondIterators.cpp.o
CMakeFiles/GraphMol.dir/Aromaticity.cpp.o
CMakeFiles/GraphMol.dir/Kekulize.cpp.o
CMakeFiles/GraphMol.dir/MolDiscriminators.cpp.o
CMakeFiles/GraphMol.dir/ConjugHybrid.cpp.o
CMakeFiles/GraphMol.dir/AddHs.cpp.o
CMakeFiles/GraphMol.dir/RankAtoms.cpp.o
CMakeFiles/GraphMol.dir/Matrices.cpp.o
CMakeFiles/GraphMol.dir/Chirality.cpp.o
CMakeFiles/GraphMol.dir/RingInfo.cpp.o
CMakeFiles/GraphMol.dir/Conformer.cpp.o
-L/System/Library/Frameworks/Python.framework/Versions/2.7/Python
../../lib/libRDGeometryLib.2012.09.1pre.dylib
../../lib/libRDGeneral.2012.09.1pre.dylib
../../lib/libDataStructs.2012.09.1pre.dylib
../../lib/libRDGeneral.2012.09.1pre.dylib
Undefined symbols for architecture x86_64:
  boost::any
RDKit::Dict::toanyboost::shared_arraydouble
(boost::shared_arraydouble) const, referenced from:
  void RDKit::Dict::setValboost::shared_arraydouble
(std::string const, boost::shared_arraydouble) in
Matrices.cpp.o
  boost::any RDKit::Dict::toanyboost::shared_arrayint
(boost::shared_arrayint) const, referenced from:
  void RDKit::Dict::setValboost::shared_arrayint
(std::string const, boost::shared_arrayint) in
Matrices.cpp.o
  boost::any RDKit::Dict::toanystd::string(std::string)
const, referenced from:
  void RDKit::Dict::setValstd::string(std::string
const, std::string) in Chirality.cpp.o
  boost::any RDKit::Dict::toanystd::listint,
std::allocatorint  (std::listint, std::allocatorint
) const, referenced from:
  void RDKit::Dict::setValstd::listint,
std::allocatorint  (std::string const, std::listint,
std::allocatorint ) in Canon.cpp.o

Re: [Rdkit-discuss] non-smallest rings

2013-01-22 Thread Paul Emsley
On 22/01/13 05:40, Greg Landrum wrote:
 Hi Paul,

 On Mon, Jan 21, 2013 at 4:13 PM, Paul Emsley pems...@mrc-lmb.cam.ac.uk 
 wrote:
 I am making heavy weather of the following problem - and am wondering if I
 am missing something (such as a useful RDKit function).

 I am working on this beasty (as an example):

 http://www.rcsb.org/pdb/ligand/ligandsummary.do?hetId=0CP

 COc1ccc(cc1O[C@H]1C[C@@H]2CC[C@H]1C2)C1CNC(=O)NC1

 which has a norbornane substituent. I am trying to prepare input for a
 downstream program that needs to know if the norbornane atoms are in a
 6-membered ring [1].  RingInfo gives me the 2 5-membered rings.  I am
 strugging to make use of that information to find 6-membered rings.  I have
 been using makeRingNeighborMap() and pickFusedRings().  Am I missing an
 RDKit function that finds all rings?
 There's not currently any RDKit functionality which finds all rings.
 It wouldn't be terribly difficult to add, but it could return a huge
 number of rings (imagine the results for C60). Another option would be
 to add a function
 bool atomIsInAnyRingOfSize(const Atom *at,unsigned int size)
 that does the check on demand.

Not terribly difficult, as you say, but easier for you than me, I 
imagine.  I had a bash with the trace_path() and 
handle_bigger_rings_from_fused_rings() methods, for the record, here:

http://code.google.com/p/coot/source/browse/trunk/lidia-core/cod-types.cc

I'll try and get it released under the same licence as the RDKit, fwtw. 
The thing that was non-trivial (for me) was the shall we recur deeper? 
rule.

Cheers,

Paul.



--
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnnow-d2d
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] Building rdkit on Ubuntu 12.10

2013-04-25 Thread Paul Emsley
On 25/04/13 23:43, hari jayaram wrote:
 Hi
 I did a
 export RDBASE=/home/hari/RDKit_2012_09_1
 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$RDBASE/lib

 Then cd into the build directory
 Run cmake ..
 Then run make

 At around 24% I get the following error ( see below)

 I installed the Ubuntu blessed libboost-python1.49-dev

 Any ideas how to get around this. On a related noted the Ubuntu 
 synaptic package repository did have a rdkit library but it does not 
 work and complains

  from rdkit import Chem
 Traceback (most recent call last):
 File stdin, line 1, in module
 File /usr/local/lib/python2.7/dist-packages/rdkit/Chem/__init__.py, 
 line 18, in module
 from rdkit import rdBase
 ImportError: cannot import name rdBase

Hmm... AFAIR, synaptic packages should not use files in /usr/local. Do 
you still get the same problem if you have not defined PYTHONPATH, 
PYTHONHOME or LD_LIBRARY_PATH?




 Linking CXX static library libCatalogs_static.a
 [ 24%] Built target Catalogs_static
 Scanning dependencies of target GraphMol
 [ 25%] Building CXX object 
 Code/GraphMol/CMakeFiles/GraphMol.dir/Atom.cpp.o
 [ 25%] Building CXX object 
 Code/GraphMol/CMakeFiles/GraphMol.dir/QueryAtom.cpp.o
 In file included from 
 /usr/local/include/boost/thread/detail/platform.hpp:17:0,
 from /usr/local/include/boost/thread/mutex.hpp:12,
 from /home/hari/RDKit_2012_09_1/Code/GraphMol/QueryOps.h:20,
 from /home/hari/RDKit_2012_09_1/Code/GraphMol/QueryAtom.h:15,
 from /home/hari/RDKit_2012_09_1/Code/GraphMol/QueryAtom.cpp:11:
 /usr/local/include/boost/config/requires_threads.hpp:29:4: error: 
 #error Threading support unavaliable: it has been explicitly disabled 
 with BOOST_DISABLE_THREADS
 In file included from /usr/local/include/boost/thread/mutex.hpp:12:0,
 from /home/hari/RDKit_2012_09_1/Code/GraphMol/QueryOps.h:20,
 from /home/hari/RDKit_2012_09_1/Code/GraphMol/QueryAtom.h:15,
 from /home/hari/RDKit_2012_09_1/Code/GraphMol/QueryAtom.cpp:11:
 /usr/local/include/boost/thread/detail/platform.hpp:67:9: error: 
 #error Sorry, no boost threads are available for this platform.
 In file included from 
 /home/hari/RDKit_2012_09_1/Code/GraphMol/QueryOps.h:20:0,
 from /home/hari/RDKit_2012_09_1/Code/GraphMol/QueryAtom.h:15,
 from /home/hari/RDKit_2012_09_1/Code/GraphMol/QueryAtom.cpp:11:
 /usr/local/include/boost/thread/mutex.hpp:18:2: error: #error Boost 
 threads unavailable on this platform
 In file included from 
 /home/hari/RDKit_2012_09_1/Code/GraphMol/QueryAtom.h:15:0,
 from /home/hari/RDKit_2012_09_1/Code/GraphMol/QueryAtom.cpp:11:
 /home/hari/RDKit_2012_09_1/Code/GraphMol/QueryOps.h:313:5: error: 
 ‘mutex’ in namespace ‘boost’ does not name a type
 make[2]: *** [Code/GraphMol/CMakeFiles/GraphMol.dir/QueryAtom.cpp.o] 
 Error 1
 make[1]: *** [Code/GraphMol/CMakeFiles/GraphMol.dir/all] Error 2
 make: *** [all] Error 2




There are 2 issues here:

1) Threading support unavaliable: it has been explicitly disabled with 
BOOST_DISABLE_THREADS (Someone at Boost Central can't spell :-) I doubt 
that compiling Boost without threads was a good idea.

2) and as this the above is unusual, this error: 
/home/hari/RDKit_2012_09_1/Code/GraphMol/QueryOps.h:313:5: error: 
‘mutex’ in namespace ‘boost’ does not name a type was not trapped 
before. Ideally QueryOps (or anything else) should not use boost mutex 
if threads have been disabled (this might be a pain to code up).


HTH,

Paul.




--
Try New Relic Now  We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app,  servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] ROMol getConformer returning the copy of a conformer

2013-09-03 Thread Paul Emsley
On 03/09/13 20:21, Jan Domanski wrote:
 Hi,

 I'm trying to trivially modify the coordinates of the 0th atom of the
 0th conformer in a (3D) ROMol called m. To do that I need to get the
 conformer:

 RDKit::ROMol m = ...;
 RDKit::Conformer conf = m.getConformer(-1);


guessing somewhat, that should be:

RDKit::Conformer conf = m.getConformer(-1);


P.


--
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911iu=/4140/ostg.clktrk
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


[Rdkit-discuss] RDKit UGM 2013 - a few pictures

2013-10-14 Thread Paul Emsley

https://www.dropbox.com/sh/a3s55kmxa37yx7e/vLC5uea1xP

Paul.



--
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register 
http://pubads.g.doubleclick.net/gampad/clk?id=60134071iu=/4140/ostg.clktrk
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] Beta of Q3 2013 release available

2013-10-25 Thread Paul Emsley
On 25/10/13 08:09, James Davidson wrote:
 Hi Roger,

 Thanks for the response

 The use of an integer file format flavor argument allows the caller to
 customize the behavior of the readers and writers.  The semantics is that a
 reasonable default is zero (for all bits), but that new features may be added
 without changing the API/ABI.
 Most of the bits above (for the writer) control strict compliance with the 
 PDB
 format specification.  For example, a flavor of 12 will write bond orders the
 way the RCSB expects them both throwing away bond orders and increasing
 the size of the PDB file.
 As a test, I am using 2VCI, and am retrieving the PDB data from the RCSB 
 using the following

 import requests
 url = 
 http://www.rcsb.org/pdb/download/downloadFile.do?fileFormat=pdbcompression=NOstructureId=2VCI;
 response = requests.get(url)
 pdb_block = response.content
 response.close()


 pdb_block shows CONECT records only for the HETATM records.
 If I now read into RDKit, using the defaults, and write back out using the 
 defaults, I see CONECT records for every atom (ie protein as well).  And I 
 can't see any double-bonds rendered in PyMOL:

 from rdkit import Chem
 from rdkit.Chem import AllChem
 pdb = Chem.MolFromPDBBlock(pdb_block)
 pdb_block_out = Chem.MolToPDBBlock(pdb)

 First 10 CONECT records of output:
 CONECT12
 CONECT235
 CONECT344   10
 CONECT56
 CONECT67
 CONECT7889
 CONECT   10   11
 CONECT   11   12   14
 CONECT   12   13   13   17
 CONECT   14   15   16


 If I use Chem.MolToPDBBlock(pdb, flavor=12) I do, indeed see the ligand 
 CONECT records in what looks like the original format (albeit now numbered 
 differently), and I still see CONECT records for the protein - but this PDB 
 *will* render double bonds in PyMOL.

 First 10 CONECT records of output:
 CONECT344
 CONECT788
 CONECT   12   13   13
 CONECT   19   20   20
 CONECT   23   24   24
 CONECT   28   29   29
 CONECT   35   36   36
 CONECT   38   39   39
 CONECT   40   42   42
 CONECT   41   43   43


If I may be so bold, I believe an important part of the puzzle is 
missing.  The residue-name/3-letter-code/comp-id in the PDB file is a 
pointer to an entry in the mmCIF-formatted chemical component dictionary 
that describes the compound, for all compounds for all entries released 
by the PDB.

http://deposit.pdb.org/cc_dict_tut.html

If this is an internal PDB file there will, very likely be a similar 
mmCIF file used for crystallographic refinement.

Only when these options fail would I consider turning to bond-order 
perception and CONECT records.

Paul.


--
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register 
http://pubads.g.doubleclick.net/gampad/clk?id=60135991iu=/4140/ostg.clktrk
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] PDB reader and bond perception

2014-01-13 Thread Paul Emsley
On 13/01/14 17:54, JP wrote:
 RDKitters!

 Finally back on the mailing list!

 I am sure we've been through this at the UGM (my mind must have 
 wandered off!), but a quick question about the PDB reader and bond 
 perception.  Is this supported with the current PDB reader?  I 
 remember that someone (PaulE, perhaps?) was saying bond perception was 
 painful, but there was some dictionary for PDB ligands which helps 
 (any idea the name of this dictionary?).

 To the technical details.

 I am reading in the following PDB file with a simple MolFromPDBFile() 
 call:

 HETATM1  O1P 84T A1862 -27.016   9.387 -72.564  1.00 20.81 
   O
 HETATM2  P   84T A1862 -27.282   9.818 -73.968  1.00 19.65 
   P
 HETATM3  O2P 84T A1862 -27.881  11.176 -74.182  1.00 21.49 
   O
 HETATM4  N   84T A1862 -25.869   9.583 -74.813  1.00 19.78 
   N
 HETATM5  C   84T A1862 -25.759  10.010 -76.075  1.00 19.97 
   C
 HETATM6  CA  84T A1862 -24.493   9.748 -76.807  1.00 19.75 
   C
 HETATM7  CB  84T A1862 -24.794   8.678 -77.847  1.00 19.73 
   C
 HETATM8  CG  84T A1862 -23.571   8.324 -78.681  1.00 19.70 
   C
 HETATM9  CD2 84T A1862 -23.309   9.519 -79.611  1.00 18.49 
   C
 HETATM   10  CD1 84T A1862 -23.863   6.932 -79.305  1.00 18.60 
   C
 HETATM   11  OHB 84T A1862 -25.210   7.467 -77.223  1.00 19.17 
   O
 HETATM   12  OH  84T A1862 -23.549   9.127 -75.984  1.00 20.33 
   O
 HETATM   13  O   84T A1862 -26.672  10.517 -76.692  1.00 20.26 
   O
 HETATM   14  O5' 84T A1862 -28.377   8.861 -74.619  1.00 19.39 
   O
 HETATM   15  C5' 84T A1862 -28.002   7.536 -74.954  1.00 18.47 
   C
 HETATM   16  C4' 84T A1862 -28.909   7.000 -76.012  1.00 18.24 
   C
 HETATM   17  C3' 84T A1862 -28.901   7.826 -77.298  1.00 18.28 
   C
 HETATM   18  C2' 84T A1862 -30.318   7.610 -77.768  1.00 18.69 
   C
 HETATM   19  O2' 84T A1862 -30.789   8.641 -78.581  1.00 19.64 
   O
 HETATM   20  O4' 84T A1862 -30.262   6.951 -75.529  1.00 18.80 
   O
 HETATM   21  C1' 84T A1862 -31.152   7.470 -76.521  1.00 19.01 
   C
 HETATM   22  N9  84T A1862 -31.753   8.732 -76.009  1.00 20.08 
   N
 HETATM   23  C4  84T A1862 -33.033   9.013 -76.158  1.00 21.10 
   C
 HETATM   24  N3  84T A1862 -34.018   8.339 -76.786  1.00 21.58 
   N
 HETATM   25  C2  84T A1862 -35.263   8.846 -76.830  1.00 21.95 
   C
 HETATM   26  C8  84T A1862 -31.223   9.701 -75.291  1.00 20.27 
   C
 HETATM   27  N7  84T A1862 -32.173  10.618 -75.019  1.00 21.28 
   N
 HETATM   28  C5  84T A1862 -33.315  10.213 -75.563  1.00 21.81 
   C
 HETATM   29  C6  84T A1862 -34.624  10.702 -75.627  1.00 22.85 
   C
 HETATM   30  N1  84T A1862 -35.550  10.010 -76.285  1.00 22.44 
   N
 HETATM   31  N6  84T A1862 -35.008  11.862 -75.052  1.00 23.86 
   N
 TER
 END

 But I am losing all the double bond (and aromatic) information:

 m = Chem.MolFromPDBFile(sys.argv[1])
 print Chem.MolToSmiles(m)

 Gives me:

 CC(C)C(O)C(O)C(O)NP(O)(O)OCC1CC(O)C(N2CNC3C2NCNC3N)O1

 As usual, many thanks for your time,


84T is a reference to chemical description:

http://www.ebi.ac.uk/pdbe-srv/pdbechem/chemicalCompound/show/84T

This (mmcif) is what I parse, either from the local dictionary or 
downloading the file on the fly:

ftp://ftp.ebi.ac.uk/pub/databases/msd/pdbechem/files/mmcif/84T.cif

Does that help?

Paul.




--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments  Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431iu=/4140/ostg.clktrk
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] An ultimate way to compute 3D coordinates?

2014-04-05 Thread Paul Emsley
On 05/04/14 19:04, Michal Krompiec wrote:


 For example, it does not work well
 for long conjugated oligomers - sometimes it produces molecular knots
 instead of straight strands, and is quite slow for large systems.

Can you expand on that? What sort of long conjugated oligomers were you 
looking at? What was the nature of the input from which you were making 
rdkit molecules?


Paul.


--
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


[Rdkit-discuss] chirality doxygen tweak

2014-07-01 Thread Paul Emsley

Hi Greg,

I don't know if you care about this sort of thing, but if you do, then 
you should escape - i.e. \@ - (at least) one of the @s here (in Atom.h)

//! tetrahedral: clockwise rotation (SMILES @@)

So that the output html makes more sense. Currently see

http://rdkit.org/C++_Docs/classRDKit_1_1Atom.html#a8a82ae947ebbbc48f5ec5128f5c3e724

Paul.


--
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


[Rdkit-discuss] A case of the jaggies

2014-07-21 Thread Paul Emsley


Hi,

Why are the structure images in the RDKit documentation nice and smooth 
but mine have the jaggies?


What do I have to do to my PIL (or something?) for such smoothness?

Thanks,

Paul.

--
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] A case of the jaggies

2014-07-21 Thread Paul Emsley
On 21/07/14 17:22, Greg Landrum wrote:
 Hi Paul,



 On Mon, Jul 21, 2014 at 3:36 PM, Paul Emsley 
 pems...@mrc-lmb.cam.ac.uk mailto:pems...@mrc-lmb.cam.ac.uk wrote:



 Why are the structure images in the RDKit documentation nice and
 smooth but mine have the jaggies?


 The jagged lines are because the RDKit is using its fall-back 
 mechanism for generating PNGs. To get the higher quality drawings, you 
 need either the python cairo bindings (py2cairo) or the python aggdraw 
 bindings installed. If you can, I'd suggest the cairo bindings; the 
 aggdraw wrapper is no longer supported by its author.


py2cairo was just the ticket! (my sketcher uses cairo from C++)

Thanks,

Paul.


--
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] Write mol/sdf files

2014-08-26 Thread Paul Emsley
On 26/08/14 10:42, acanada wrote:

 What is the best approach to write mol/sdf files for a compound which I 
 already have chebi, inChi?



m=Chem.MolFromInchi('InChI=1S/C8H10N4O2/c1-10-4-9-6-5(10)7(13)12(3)8(14)11(6)2/h4H,1-3H3')
print file('foo.mol','w+'),Chem.MolToMolBlock(m)



--
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] PandasTools on Windows iPython notebook

2014-09-25 Thread Paul Emsley

On 25/09/14 18:06, paul.czodrow...@merckgroup.com wrote:

Dear RDKitter,

on my new Windows laptop, I run into this issue:

import pandas as pd
import rdkit.Chem as Chem
from rdkit.Chem import PandasTools

=

ValueError Traceback (most recent call last)
ipython-input-6-52de9e808c94in module()
 1importpandas aspd
 2importrdkit.Chem asChem
 3fromrdkit.Chem importPandasTools
 4#import os
 5#from rdkit import RDConfig

C:\RDKit_2013_06_1\rdkit\Chem\PandasTools.pyin module()
87importpandas aspd
88if'display.width'in pd.core.config._registered_options:
--- 89pd.set_option('display.width',1000)
90if'display.height'in pd.core.config._registered_options:
91pd.set_option('display.height',1000)

C:\Users\m163729\AppData\Local\Continuum\Anaconda\lib\site-packages\pandas\core\config.pyin 
__call__(self, *args, **kwds)

   215
   216def__call__(self,*args,**kwds):
-- 217returnself.__func__(*args,**kwds)
   218
   219@property

C:\Users\m163729\AppData\Local\Continuum\Anaconda\lib\site-packages\pandas\core\config.pyin 
_set_option(*args, **kwargs)

   116o =_get_registered_option(key)
   117ifo ando.validator:
-- 118o.validator(v)
   119
   120# walk the nested dict

C:\Users\m163729\AppData\Local\Continuum\Anaconda\lib\site-packages\pandas\core\config.pyin 
inner(x)

   780definner(x):
   781ifnotisinstance(x,_type):
-- 782raiseValueError(Value must be an instance of %s%type_repr)
   783
   784returninner

ValueError: Value must be an instance of type 'NoneType'|type 'int'


Is this familiar to anyone?


Here's a guess:

Try changing 1000 to 20 (2 billion) in PandaTools.py

Paul.





--
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311iu=/4140/ostg.clktrk___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


[Rdkit-discuss] MMFF bond parameters

2014-09-29 Thread Paul Emsley

Dear Paolo (I presume :-),

I'd like to get the ro values for the bonds in an MMFF.  I have the 
following so far:

void mmff_bonds(RDKit::ROMol mol_in) {

RDKit::MMFF::MMFFMolProperties *mmffMolProperties = new 
RDKit::MMFF::MMFFMolProperties(mol_in);
ForceFields::ForceField *field = new ForceFields::ForceField();
RDKit::MMFF::Tools::addBonds( mol_in, mmffMolProperties, field);

ForceFields::ContribPtrVect::const_iterator contrib;
for(contrib=field-contribs().begin();
contrib!=field-contribs().end();
contrib++)  {

   ForceFields::MMFF::MMFFBond *mmffBondParams;
   // something xxx!!!
   double d = something(contrib???)-calcBondRestLength(mmffBondParams);
}
}


As you can see, I got lost between contrib and bond parameters. Please 
can you tell me what I am missing?  I hope it's only a few lines - but I 
can't determine which ones :)

Thanks,

Paul.


--
Slashdot TV.  Videos for Nerds.  Stuff that Matters.
http://pubads.g.doubleclick.net/gampad/clk?id=160591471iu=/4140/ostg.clktrk
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] MMFF bond parameters

2014-09-29 Thread Paul Emsley
On 30/09/14 00:15, Paolo Tosco wrote:

 I'm afraid currently there is no public method to get r0 and kb from 
 ForceField contribs. I have attached a C++ sample program which shows 
 how to get the information you need from a ROMol.

Ah! -  His eyes opened!

Thanks very much.

P.


--
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311iu=/4140/ostg.clktrk
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


[Rdkit-discuss] Python argument types did not match C++ signature

2014-10-14 Thread Paul Emsley
Hi RDKitters,

I'm a bit lost with boost::python/RDKit/MacOSX.

I have a boost::python function:

RDKit::ROMol *hydrogen_transformations(const RDKit::ROMol r);


which is exposed like this:

BOOST_PYTHON_MODULE(pyrogen) {

def(hydrogen_transformations, hydrogen_transformations, 
return_value_policymanage_new_object());

}

When I run this on my computers (RHEL6, Ubuntu, Fedora), it compiles and runs 
fine fine.  When Bill Scott tries on his Mac, at run-time he gets:

   File /sw/lib/python2.7/site-packages/coot/pyrogen.py, line 607, in 
make_restraints
 sane_H_mol = pyrogen_boost.hydrogen_transformations(m_H)
Boost.Python.ArgumentError: Python argument types in
 pyrogen_boost.hydrogen_transformations(Mol)
did not match C++ signature:
 hydrogen_transformations(RDKit::ROMol)
  

Where m_H is created like this:

m_H = AllChem.AddHs(m)

and has type:

class 'rdkit.Chem.rdchem.Mol'

I'm not following why a Mol is not an RDKit::ROMol.

I'd appreciate any insight.

We are using slightly different versions of Boost (1.54 vs boost1.53.python27) 
and RDKit_2014_03_1.

Thanks,

Paul.


--
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] https://sourceforge.net

2015-03-23 Thread Paul Emsley
On 21/03/15 04:48, Greg Landrum wrote:


 Does anyone see a problem with me doing a commit there that removes 
 all the code and just leaves a look in github readme?



I would have found this useful :-)

Paul.



--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


[Rdkit-discuss] Atom Symbol Case in MolFile?

2016-01-18 Thread Paul Emsley

Dear RDKitters,

Is is clear what the case of the second character of an atom symbol in 
the atom block of a MolFile should be? i.e. "CL", "Cl" or either?

Thanks,

Paul.


--
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311=/4140
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] Compiling git RDKit on Mac OS X

2016-02-24 Thread Paul Emsley

Moving on...

Now I get the message (see below).  What's the difference?

In the Release-based link.txt we have:

-install_name
/Users/pemsley/autobuild/b-e-l/rdkit-Release_2015_03_1/build/lib/libSLNParse.1.dylib

In the git-based link.txt we have:

-install_name
@rpath/libSLNParse.1.dylib

Is that relevant?

libboost_regexp has the necessary functions:

$ nm 
~/autobuild/build-coot+rdkit-pre-release-gtk2-python/lib/libboost_regex.dylib 
| grep mem_block
00053910 T __ZN5boost9re_detail13get_mem_blockEv
00053990 T __ZN5boost9re_detail13put_mem_blockEPv
00053ae0 t __ZN5boost9re_detail15mem_block_cacheD1Ev

I am not explicitly using -stdlib anywhere.

Paul.

---

$ make VERBOSE=1
[snip]
[ 84%] Linking CXX shared library ../../../lib/libSLNParse.dylib
cd 
/Users/pemsley/autobuild/b-e-l/rdkit-github/build/Code/GraphMol/SLNParse 
&& /sw/bin/cmake -E cmake_link_script CMakeFiles/SLNParse.dir/link.txt 
--verbose=1
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
 
-mpopcnt -Wno-deprecated -Wno-unused-function -fno-strict-aliasing -fPIC 
-Wall -Wextra -O3 -DNDEBUG -dynamiclib -Wl,-headerpad_max_install_names 
-compatibility_version 1.0.0 -current_version 2016.3.1 -o 
../../../lib/libSLNParse.2016.03.1.dev1.dylib -install_name 
@rpath/libSLNParse.1.dylib CMakeFiles/SLNParse.dir/SLNParse.cpp.o 
CMakeFiles/SLNParse.dir/SLNAttribs.cpp.o 
CMakeFiles/SLNParse.dir/sln.tab.cpp.o 
CMakeFiles/SLNParse.dir/lex.yysln.cpp.o  -L$install_prefix/lib 
../../../lib/libGraphMol.2016.03.1.dev1.dylib 
$install_prefix/lib/libboost_regex.dylib 
../../../lib/libRDGeometryLib.2016.03.1.dev1.dylib 
../../../lib/libDataStructs.2016.03.1.dev1.dylib 
../../../lib/libRDGeneral.2016.03.1.dev1.dylib 
-Wl,-rpath,/Users/pemsley/autobuild/b-e-l/rdkit-github/build/lib 
-Wl,-rpath,$install_prefix/lib
Undefined symbols for architecture x86_64:
   "boost::re_detail_106000::get_mem_block()", referenced from:
boost::re_detail_106000::perl_matcher >, boost::regex_traits 
 >::find_imp() in SLNParse.cpp.o
boost::re_detail_106000::perl_matcher >, boost::regex_traits 
 >::unwind_commit(bool) in SLNParse.cpp.o
boost::re_detail_106000::perl_matcher >, boost::regex_traits 
 >::match_all_states() in SLNParse.cpp.o
boost::re_detail_106000::perl_matcher >, boost::regex_traits 
 >::match_startmark() in SLNParse.cpp.o
boost::re_detail_106000::perl_matcher >, boost::regex_traits 
 >::match_alt() in SLNParse.cpp.o
boost::re_detail_106000::perl_matcher >, boost::regex_traits 
 >::match_rep() in SLNParse.cpp.o
boost::re_detail_106000::perl_matcher >, boost::regex_traits 
 >::match_char_repeat() in SLNParse.cpp.o
   ...
   "boost::re_detail_106000::put_mem_block(void*)", referenced from:
boost::re_detail_106000::perl_matcher >, boost::regex_traits 
 >::find_imp() in SLNParse.cpp.o
boost::re_detail_106000::perl_matcher >, boost::regex_traits 
 >::unwind_extra_block(bool) in SLNParse.cpp.o
   "boost::re_detail_106000::verify_options(unsigned int, 
boost::regex_constants::_match_flags)", referenced from:
boost::re_detail_106000::perl_matcher >, boost::regex_traits 
 >::find_imp() in SLNParse.cpp.o
   "boost::re_detail_106000::raise_runtime_error(std::runtime_error 
const&)", referenced from:
   void 
boost::re_detail_106000::raise_error > 
 >(boost::regex_traits_wrapper > const&, 
boost::regex_constants::error_type) in SLNParse.cpp.o
"boost::re_detail_106000::get_default_error_string(boost::regex_constants::error_type)",
 
referenced from:
boost::re_detail_106000::cpp_regex_traits_implementation::error_string(boost::regex_constants::error_type)
 
const in SLNParse.cpp.o

Re: [Rdkit-discuss] Compiling git RDKit on Mac OS X (was: Atoms with strange positions/bonds when drawer makes PNG)

2016-02-23 Thread Paul Emsley



On 23/02/2016 15:52, Greg Landrum wrote:



On Tue, Feb 23, 2016 at 3:50 PM, Paul Emsley 
<pems...@mrc-lmb.cam.ac.uk <mailto:pems...@mrc-lmb.cam.ac.uk>> wrote:



This seems to be the relevant difference in the cmake output:





[  3%] Linking CXX shared library ../../lib/libRDBoost.dylib
Undefined symbols for architecture x86_64:
  "boost::python::throw_error_already_set()", referenced from:
  throw_index_error(int) in Wrap.cpp.o
  throw_value_error(std::__1::basic_string<char,
std::__1::char_traits, std::__1::allocator >) in
Wrap.cpp.o
  translate_index_error(IndexErrorException const&) in Wrap.cpp.o
  translate_value_error(ValueErrorException const&) in Wrap.cpp.o
throw_runtime_error(std::__1::basic_string<char,
std::__1::char_traits, std::__1::allocator >) in
Wrap.cpp.o
  translate_invariant_error(Invar::Invariant const&) in Wrap.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to
see invocation)
make[2]: *** [lib/libRDBoost.2016.03.1.dev1.dylib] Error 1
make[1]: *** [Code/RDBoost/CMakeFiles/RDBoost.dir/all] Error 2
make: *** [all] Error 2

These functions are in libboost_python.dylib, but I don't know how
to tell cmake how to find them there when linking RDBoost.dylib.


Ah, very good. I think I know this one. The problem tends to be due to 
a mixture of libraries that were built against the new C++ libraries 
(the default with newer versions of clang) and those built using the 
older C++ mode. You control this with the -stdlib flag to the C++ 
compiler. The two options are "-stdlib=libc++" (this is the newer 
library and is now the default) or "-stdlib=libstdc++" (this is the 
older one). The way you diagnose this is by looking at the output of 
otool -L.


Here's a library built using the new one (the default now with homebrew):

~/rdk/RDKit_git/build_java % otool -L /usr/local/lib/libboost_regex.dylib
/usr/local/lib/libboost_regex.dylib:
/usr/local/opt/boost/lib/libboost_regex.dylib (compatibility version 
0.0.0, current version 0.0.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 
120.1.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current 
version 1226.10.1)


And here's one built using the older version:

~/rdk/RDKit_git/build_java % otool -L 
/usr/local/opt/boost_1_48/lib/libboost_regex.dylib

/usr/local/opt/boost_1_48/lib/libboost_regex.dylib:
libboost_regex.dylib (compatibility version 0.0.0, current version 0.0.0)
/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current 
version 104.1.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current 
version 1226.10.1)





Thanks.

Hmm...  I notice that in the above, the libc++ version has the full path 
name to itself but the libstdc++ one does not (is that the "shared 
library ID"? (from otool man page)).  My boost libraries are between 
these examples (no path but using libc++):


[I substitute $install_prefix for the actual directory to make it more 
generic]


$ otool -L $install_prefix/lib/libboost_python.dylib
$install_prefix/lib/libboost_python.dylib:
libboost_python.dylib (compatibility version 0.0.0, current version 
0.0.0)
$install_prefix/lib/libpython2.7.dylib (compatibility version 
2.7.0, current version 2.7.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current 
version 120.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current 
version 1213.0.0)


But the bottom line is:

I installed Boost-1.60 and the boost python problem went away.


Paul.

--
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151=/4140___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


[Rdkit-discuss] Compiling git rdkit

2016-02-23 Thread Paul Emsley

Using:
Apple LLVM version 6.1.0 (clang-602.0.49) (based on LLVM 3.6.0svn)
Target: x86_64-apple-darwin14.5.0

and boost_1_54_0:

Scanning dependencies of target testMatCalc
[ 29%] Building CXX object 
Code/DataManip/MetricMatrixCalc/CMakeFiles/testMatCalc.dir/testMatCalc.cpp.o
[ 30%] Building CXX object Code/Query/CMakeFiles/testQuery.dir/test.cpp.o
In file included from 
/Users/pemsley/autobuild/b-e-l/rdkit-github/rdkit/Code/GraphMol/MolHash/HashToString.cpp:13:
/Users/pemsley/autobuild/build-coot+rdkit-pre-release-gtk2-python/include/boost/archive/iterators/transform_width.hpp:151:31:
 
error: no member
   named 'min' in namespace 'std'
 unsigned int i = std::min(missing_bits, m_remaining_bits);
  ~^

transform_width.hpp needs to include  ?  (because I am using 
an older boost?)

Paul.


--
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151=/4140
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] Compiling git rdkit

2016-02-23 Thread Paul Emsley

Yes, but not for boost.

On 23/02/2016 13:19, Giuseppe Marco Randazzo wrote:
> Are you using homebrew?
>
>> On 23 Feb 2016, at 14:17, Paul Emsley <pems...@mrc-lmb.cam.ac.uk> wrote:
>>
>>
>> Using:
>> Apple LLVM version 6.1.0 (clang-602.0.49) (based on LLVM 3.6.0svn)
>> Target: x86_64-apple-darwin14.5.0
>>
>> and boost_1_54_0:
>>
>> Scanning dependencies of target testMatCalc
>> [ 29%] Building CXX object
>> Code/DataManip/MetricMatrixCalc/CMakeFiles/testMatCalc.dir/testMatCalc.cpp.o
>> [ 30%] Building CXX object Code/Query/CMakeFiles/testQuery.dir/test.cpp.o
>> In file included from
>> /Users/pemsley/autobuild/b-e-l/rdkit-github/rdkit/Code/GraphMol/MolHash/HashToString.cpp:13:
>> /Users/pemsley/autobuild/build-coot+rdkit-pre-release-gtk2-python/include/boost/archive/iterators/transform_width.hpp:151:31:
>> error: no member
>>named 'min' in namespace 'std'
>>  unsigned int i = std::min(missing_bits, m_remaining_bits);
>>   ~^
>>
>> transform_width.hpp needs to include  ?  (because I am using
>> an older boost?)
>>
>> Paul.
>>
>>
>> --
>> Site24x7 APM Insight: Get Deep Visibility into Application Performance
>> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
>> Monitor end-to-end web transactions and take corrective actions now
>> Troubleshoot faster and improve end-user experience. Signup Now!
>> http://pubads.g.doubleclick.net/gampad/clk?id=272487151=/4140
>> ___
>> Rdkit-discuss mailing list
>> Rdkit-discuss@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


--
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151=/4140
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] Atom Symbol Case in MolFile?

2016-01-19 Thread Paul Emsley

Hi Greg,

Thanks for that.

Why do I ask?  Because the sdf files [1] distributed by the wwPDB, such 
as this one:


http://www.rcsb.org/pdb/files/ligand/CQ8_ideal.sdf

from this page:

http://www.rcsb.org/pdb/ligand/ligandsummary.do?hetId=CQ8

are upper-cased.  I didn't know whether that was right or not (and, as 
you imply, RDKit will not parse it).  I'll get in touch with them and 
see if they can get it changed.


Paul.

[1] I thought that they were molfiles when I wrote the mail - and I 
suppose the same thinking applies.


On 18/01/2016 20:59, Greg Landrum wrote:

Hi Paul,

ctfile.pdf says: "entry in periodic table"
I interpret this to mean "Cl", since that's what one finds in the 
typical periodic table.


The RDKit, curiously, agrees with me. ;-)


:-)



-greg


On Mon, Jan 18, 2016 at 8:45 AM, Paul Emsley 
<pems...@mrc-lmb.cam.ac.uk <mailto:pems...@mrc-lmb.cam.ac.uk>> wrote:



Dear RDKitters,

Is is clear what the case of the second character of an atom symbol in
the atom block of a MolFile should be? i.e. "CL", "Cl" or either?

Thanks,

Paul.



--
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311=/4140
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
<mailto:Rdkit-discuss@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss




--
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311=/4140___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


[Rdkit-discuss] Atoms with strange positions/bonds when drawer makes PNG

2016-02-16 Thread Paul Emsley


Dear RDKitters,

I have the following test code:

   std::string smiles="Clc1c1";
   RDKit::ROMol *m_local = RDKit::SmilesToMol(smiles);
   RDDepict::compute2DCoords(*m_local);
   RDKit::Conformer conf = m_local->getConformer();
   WedgeMolBonds(*m_local, );
   bool includeStereo = true;
   bool kekulize = false;
   std::string mol_file_name = "testmol.mol";
   RDKit::MolToMolFile(*m_local, mol_file_name, includeStereo, confId, 
kekulize);

   std::string png_file_name = "image-test.png";
   {
  RDKit::MolDraw2DCairo drawer(200, 200);
  drawer.drawMolecule(*m_local);
  drawer.finishDrawing();
  drawer.writeDrawingText(png_file_name.c_str());
   }

The mol file seems sane (attached) but the png has strangely positioned 
atoms (the Cl in this case) (attached).


What am I doing wrong?

(Using RDKit-2015-03-01)

Thanks,

Paul.


 RDKit  2D

  7  7  0  0  0  0  0  0  0  0999 V2000
3.0.0. Cl  0  0  0  0  0  0  0  0  0  0  0  0
1.50000.0. C   0  0  0  0  0  0  0  0  0  0  0  0
0.7500   -1.29900. C   0  0  0  0  0  0  0  0  0  0  0  0
   -0.7500   -1.29900. C   0  0  0  0  0  0  0  0  0  0  0  0
   -1.50000.0. C   0  0  0  0  0  0  0  0  0  0  0  0
   -0.75001.29900. C   0  0  0  0  0  0  0  0  0  0  0  0
0.75001.29900. C   0  0  0  0  0  0  0  0  0  0  0  0
  1  2  1  0
  2  3  4  0
  3  4  4  0
  4  5  4  0
  5  6  4  0
  6  7  4  0
  7  2  4  0
M  END
--
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151=/4140___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] Atoms with strange positions/bonds when drawer makes PNG

2016-02-18 Thread Paul Emsley
Hi Greg,

I tried to investigate this further with github rdkit but I am as yet 
unable to configure/cmake it yet on this Mac (something related to boost 
python has changed) :-/ :-) - will keep poking at it and/or abstracting 
it...

Thanks,

Paul.

On 19/02/2016 09:19, Greg Landrum wrote:
>
>
> That is indeed very strange behavior and I can't think of what would 
> cause it. I'm not able to reproduce it with either the current github 
> master, the 2015_09_2, or the 2015_03_1 release. Can you please send 
> me a small test program that reproduces the problem?
>
>


--
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151=/4140
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] Problems with building RDKit on Linux

2016-03-19 Thread Paul Emsley
On 18/03/2016 19:23, Mendez Giraldez, Raul wrote:
> Yes, I think so Paul. my $LD_LIBRARY_PATH points towards the installed boost 
> (by conda) is :
>
> /nas02/home/r/m/rmendez/Work/Software/miniconda/envs/my-rdkit-env/include/boost:/nas02/home/r/m/rmendez/Work/Software/miniconda/envs/my-rdkit-env/lib
>
> BTW, one of the system administrators of our cluster is trying to build rdkit 
> from source and he didn't succeed either, he got the following problems:
>
> [  2%] Building CXX object 
> Code/RDBoost/Wrap/CMakeFiles/rdBase.dir/RDBase.cpp.o
> /netscr/deep/installs/RDKit/rdkit-Release_2015_03_1/Code/RDBoost/python_streambuf.h:
>  In member function 'virtual int 
> boost_adaptbx::python::streambuf::underflow()':
> /netscr/deep/installs/RDKit/rdkit-Release_2015_03_1/Code/RDBoost/python_streambuf.h:223:
>  error: 'PyBytes_AsStringAndSize' was not declared in this scope
> make[2]: *** [Code/RDBoost/Wrap/CMakeFiles/rdBase.dir/RDBase.cpp.o] Error 1
> make[1]: *** [Code/RDBoost/Wrap/CMakeFiles/rdBase.dir/all] Error 2
> make: *** [all] Error 2
>

PyBytes_AsStringAndSize should be part of basic Python.  I am using 
Python-2.7.11 and it's defined/redefine in Include/bytesobject.h

Paul.



--
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] Problems with building RDKit on Linux

2016-03-19 Thread Paul Emsley
On 17/03/2016 18:00, Mendez Giraldez, Raul wrote:
> Hi everybody,
>
> I'm trying to build RDKit on Red Hat Enterprise Linux Server release
> 5.11 and I get the following problem after trying to import rdkit libraries:
>
>
> [GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> Anaconda is brought to you by Continuum Analytics.
> Please check out: http://continuum.io/thanks and https://anaconda.org
>  >>> from rdkit import Chem
> Traceback (most recent call last):
>File "", line 1, in 
>File
> "/nas02/home/r/m/rmendez/Work/Software/miniconda/envs/my-rdkit-env/lib/python2.7/site-packages/rdkit/Chem/__init__.py",
> line 18, in 
>  from rdkit import rdBase
> ImportError:
> /nas02/home/r/m/rmendez/Work/Software/miniconda/envs/my-rdkit-env/lib/python2.7/site-packages/rdkit/../../../libboost_thread.so.1.56.0:
> undefined symbol:
> _ZGVZN5boost16exception_detail27get_static_exception_objectINS0_14bad_exception_EEENS_13exception_ptrEvE2ep
>  >>>
>
>
>
> There seems to be a problem with the boost libraries. Any suggestion ?

Yes, it seems to me that the libraries that you are finding at runtime 
are not those against which rdkit was linked at compile time.

Are you using LD_LIBRARY_PATH?




--
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


[Rdkit-discuss] library name change?

2016-08-19 Thread Paul Emsley

Greg,

RDKit is becoming increasingly popular and is getting picked up by third 
parties, including 
the Linux distros.  It seems to me that several RDKit library names are too 
generic (and 
hence confusing) for such an environment: I have in mind libs such as 
Alignment, Catalog, 
FileParsers (and others).  I suggest that all RDKit libraries are prefixed with 
RD (like 
RDGeneral and RDInchi). I think that this should be done by at RDKit-Central 
rather than by 
patches applied by package maintainers at the distros.

Yes, this will involve some fiddling for us C++ RDKit users, but worth it, I 
think.

Paul.

--
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] library name change?

2016-08-19 Thread Paul Emsley
On 19/08/2016 12:52, Greg Landrum wrote:
>
> It seems logical to me, though I would probably go with RDKit instead of RD
> as the prefix.

OK, that's clearer yet.



--
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] library name change?

2016-08-19 Thread Paul Emsley

I'd like to pick apart this comment:

On 19/08/2016 15:45, Igor Filippov wrote:

> It is sometimes a bit of a pain to collect the list of the dependencies.

Do you mean that (for example) if you wanted to link with 
libMolChemicalFeatures, you also 
have to add libSubstructureMatch and libSmilesParse - and it isn't readily 
apparent to you 
which additional libraries you need to add when linking?

> Alternatively some easier way to discover what belongs to what library would 
> be appreciated...

Do you mean which libraries depend on which libraries (as above) - or which 
functions are in 
which libraries?



--
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] Error when building RdKit 2013_09_1

2016-09-05 Thread Paul Emsley

On 05/09/16 17:27, ??? wrote:

Hi, Menaka,
An easy way I suggest is to install boost via package manager, for 
example:
$ sudo apt-get install 
libboost-devlibboost-system-devlibboost-thread-devlibboost-serialization-devlibboost-python-devlibboost-regex-dev




and if you're on fedora you can now do:

$ sudo dnf install rdkit

and that's easier than working out where boost::python has been installed.

--
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


[Rdkit-discuss] off-topic: atom names in sdf files?

2016-09-10 Thread Paul Emsley

Hi RDKiters,

Is it possible to store (PDB) atom names in sdf files?  If so, how is this 
done? (It was not 
clear to me after reading CTFile.pdf.)

(I hope that this question is allowed.)

Thanks,

Paul.

--
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] Ring membership

2016-09-29 Thread Paul Emsley
On 29/09/16 15:12, Marco Stenta wrote:
> Dear Colleagues,
> I am working on intramolecular hydrogen bonds, formed between 
> donor-acceptors separated by 2,3,4 atoms, as described in the Roche paper:
> Kuhn, B.; Mohr, P.; Stahl, M. J. Med. Chem. 2010, 53, 2601.
>
> I will use SMARTS and RDKIT to identify and classify IMHB.
>
> I see from documentation how to identify atoms that are members of a 
> ring, how can I identify if two atoms are member of the same ring?

I don't use Python, but you might like to check out
rings = GetRingInfo(mol)

http://www.rdkit.org/Python_Docs/rdkit.Chem.rdchem.Mol-class.html

The documentation says:

 Returns the number of molecule's RingInfo object.


This may be true, but I doubt it.  The C++ function returns a vector of 
vector of atom indices and I suspect that the python version does too 
(or the python equivalent).

Paul.


--
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] error while calculating rms and shape tanimoto

2016-09-22 Thread Paul Emsley
Files 1.pdb and 2.pdb do not contain CONECT records (so missing bond 
orders?).


File 1.pdb contains an atom with name BR43. Maybe the PDB parser can't 
parse that (seems valid to me, FWTW).


Paul


On 22/09/16 11:15, Amit singh wrote:

Hi

Files a.pdb and b.pdb are from RDKit test data (working fine)

Files 1.pdb and 2.pdb (other than test data, which are giving error)

On Thu, Sep 22, 2016 at 3:03 PM, Greg Landrum > wrote:


HI Amit,


On Thu, Sep 22, 2016 at 9:23 AM, Amit singh > wrote:


I am a new entry in this discussion forum and also for RDKit


Welcome!

I am trying to calculate shape tanimoto and rms between two
molecules (PDB files) from 3D functionality of RDKit.
Code is working fine for the pdb files given in test data.
But gives error whenever I uses other pdb files


>>> rms = rdMolAlign.AlignMol(mol1, mol2)
Traceback (most recent call last):
  File "", line 1, in 
RuntimeError: std::exception
---
It looks like there is a problem in input files, but help required


In order to be able to answer the question, we need a bit more
information. Can you please share what files you loaded mol1 and
mol2 from so that we can reproduce the problem?

-greg




--

Dr. Amit Kumar
Scientist B
National Institute of Cancer Prevention and Research
(Formly Institute of Cytology and Preventive Oncology)
 I-7, Sector - 39, Noida - 201301 Uttar Pradesh



--


___
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] Find out if a molecuole object was generated from smiles or smarts

2016-11-07 Thread Paul Emsley
On 07/11/2016 12:37, Axel Pahl wrote:
>
> amongst other options, I can generate an RDKit mol object by one of
> these two ways:
>
> mol1 = Chem.MolFromSmiles()
> mol2 = Chem.MolFromSmarts()
>
> Is there a possibility to detect for a given mol object whether it was
> generated from Smiles or Smarts?

Not obviously to me.

Perhaps you can do something like this at creation time:

mol2.SetProp('origin', 'SMARTS')

then use mol.GetProp('origin') when you need to do the test (inside a 
try/except KeyError).

Paul.


--
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/xeonphi
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] Coot heading to Fedora

2016-11-18 Thread Paul Emsley
On 18/11/2016 18:35, Gianluca Sforna wrote:
> I just wanted to mention that coot (crystallographic macromolecular
> building toolkit)[1] is the first package (at least, that I know of)
> requiring rdkit as a dependency under review [2] to enter Fedora
> repositories.

I've been cheering you on since 2013 :-)

FWIW, I've been tinkering with a cairo-based rendering of the RDKit's layout 
and hence found 
the slides of John Mayfield's presentation, which Greg mentioned recently, 
fascinating. If 
only it weren't so difficult to meet in person we'd have a lot to discuss.

Paul.


--
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] Coot heading to Fedora

2016-11-18 Thread Paul Emsley
On 18/11/2016 23:47, Greg Landrum wrote:
> Hopefully you know that there is already a Cairo-based renderer in C++ and are
> modifying/improving that?

Oh. Either I didn't know about that or I'd forgotten about it.  My code was 
well under-way 
before I heard about David's contribution and I haven't kept an eye on it - I 
preferred to 
edit/write my own code than read/understand/edit/improve someone else's ;-/.

> Or does what is there "have so much room for improvement" that it's better to 
> start over?

Only in ignorance.  However, this does encourage me to checkout the latest 
rdkit and do some 
side-by-sides.

The implicit point of my post was to say that if you wanted to install coot on 
your fedora 
box, then the part that most intertwined RDKit was the ligand builder gui.

Paul.


--
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] How to find the idx of hydrogens bonded to a specific atom

2016-10-13 Thread Paul Emsley
On 13/10/2016 05:04, Bin Song wrote:
> Hello everyone,
>
> A new user of Rdkit and new subscriber of the mailing list reporting here.
>
> I have a question to ask, as stated in the subject. I have googled and  
> consulted the
> documentation of rdkit, but found no answer. Basically, I want to run a 
> search with a smarts
> string  on my molecule. I am interested in the hydrogen atoms bonded to an 
> atom that is part
> of the match, as GetSubstructMatches does not return the idx of hydrogens. 
> Because I am
> looking at crystal structures, I want the idx of hydrogen so that I get the 
> 3D coordinates
> of the hydrogen to perform further computations. If anyone has any tips and 
> good ideas,
> please let me know.

Are you sure? I use HasSubstrMatch to match hydrogens.

see set_atom_type() here:

https://github.com/pemsley/coot/blob/master/pyrogen/atom_types.py

I think that this is more or less what you want to do.

(As you might be able to work out, I too have an interest in hydrogens on 
ligands in protein 
ligand crystal structures.)

Paul.


--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] Stereochemistry

2016-12-19 Thread Paul Emsley
On 19/12/2016 10:42, Jean-Marc Nuzillard wrote:
> Thank you all!
>
> One more point:
>
> How do I get the bond indexes for which the E/Z configuration has been set?
> I seems there are no "magic" properties for bonds and no HasProp() function 
> for bonds.

Iterate through the bond list and use bond.GetStereo() to find particular 
values?

It returns one of:

STEREONONE  
STEREOANY   
STEREOZ 
STEREOE

Paul.


--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
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

2016-12-20 Thread Paul Emsley
On 20/12/16 15:13, Yingfeng Wang 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.
>
>

I would try disabling ccache.

Paul.



--
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] 3d descriptors generation

2017-07-13 Thread Paul Emsley

On 13/07/17 18:19, Abhik Seal wrote:

Hello

I am trying to generate 3d descriptors like RDF/MORSE using with 
2017.03.01 release of rdkit and i am getting an error like module' 
object has no attribute 'CalcRDF' . I have Eigen3 installed as well. 
Any point outs what can be the issue ?


Here is the code
from rdkit import Chem
from rdkit import rdBase
from rdkit import RDConfig
import os

from rdkit.Chem import rdMolDescriptors as rdMD
smi = 'CCC(C)CO'
m = Chem.MolFromSmiles(smi)
r= rdMD.CalcRDF(m)+rdMD.CalcMORSE(m)



That version of RDKit does not have CalcRDF as an attribute of 
rdMolDescriptors.


Paul.

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


[Rdkit-discuss] Contrib code license

2017-07-24 Thread Paul Emsley


Dear Greg,

What license(s) will you allow for Contrib code? Is the Mozilla Public License 
acceptable?

Thanks,

Paul.

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] Which package should be used to improve the drawing quality in win64

2017-05-09 Thread Paul Emsley
On 09/05/2017 05:27, Hongbin Yang wrote:
> Hi, all,
>
> By default, rdkit uses pillow to render images when using 
> rdkit.Chem.DrawMolecule. But
> the quality is not good enough, like this:

The effect you discuss is called aliasing.  You want anti-aliasing.

> If memory does not fail me, pycairo can solve this problem.

I imagine that it's cairo that actually does the drawing (draws the pixels) and 
pycairo is a 
wrapper on top of this.

HTH,

Paul.


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] Installation woes: Ubuntu 16.04, Boost 1.61, and RDKit not living so peacefully together after all ...

2017-06-16 Thread Paul Emsley

On 16/06/2017 12:08, JP wrote:

Hi Folks,

Must have been eons ago last time I posted to this mailing list.  The italians have a saying 
"chi non muore si rivede".


I am trying to install the RDKit (release 2017_03_2) from source, without conda, and I 
thought this will be a breeze.  But I am getting an error.  I am pretty sure this is because 
of the boost version I am using (1.61).


The error is:

[ 62%] Linking CXX executable testReaction
../../../lib/libRDKitChemReactions.so.1.2017.03.2: undefined reference to

`boost::archive::text_iarchive_impl::load_override(boost::archive::class_name_type&)'
../../../lib/libRDKitChemReactions.so.1.2017.03.2: undefined reference to

`boost::archive::archive_exception::archive_exception(boost::archive::archive_exception
const&)'
collect2: error: ld returned 1 exit status
Code/GraphMol/ChemReactions/CMakeFiles/testReaction.dir/build.make:116: 
recipe for
target 'Code/GraphMol/ChemReactions/testReaction' failed
make[2]: *** [Code/GraphMol/ChemReactions/testReaction] Error 1
CMakeFiles/Makefile2:4157: recipe for target
'Code/GraphMol/ChemReactions/CMakeFiles/testReaction.dir/all' failed
make[1]: *** [Code/GraphMol/ChemReactions/CMakeFiles/testReaction.dir/all] 
Error 2
Makefile:160: recipe for target 'all' failed
make: *** [all] Error 2


If you are using an outdated version of boost, this is not the most elegant way for RDKit to 
tell you so.


But I don't think that that's the case. I think that you are not linking with the correct 
boost libraries. Hard to say at the moment.


$ make  VERBOSE=1


As I side note, but this is just a deprecation warning, I do get a ton of these,
/opt/boost_1_61_0/include/boost/type_traits/detail/template_arity_spec.hpp:13:84: note: 
#pragma message: NOTE: Use of this header (template_arity_spec.hpp) is deprecated

  # pragma message("NOTE: Use of this header (template_arity_spec.hpp) is 
deprecated")


I see such things also - I comment out the pragmas in the header.


Paul.

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] Atom mapping

2018-05-09 Thread Paul Emsley

On 09/05/2018 16:27, carlo del moro wrote:


we would like to know if it is possible to map the atom's ID of a SMILES represented substructure to the 
atom sequence of a ligand contained in a pdb file. This in order to get the spatial coordinates related to 
such substructure.




Depending on how the details of how you (or others) converted the SMILES to a PDB file this either could be 
a (mere) book keeping problem or a graph matching problem. Which do you think it is?


Paul.

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] Atom mapping

2018-05-10 Thread Paul Emsley

On 10/05/2018 10:39, carlo del moro wrote:


I put an example for better explain my problem.
starting from a PDB representing HPE, I use RDKIT/obabel for calculate the 
relative SMILES.


The three-letter-code (chemical component id) in a PDB file has meaning - it is a pointer to chemistry. The 
chemistry description can be retrieved from the RCSB. Unless you know that the three-letter code doesn't 
refer to a standard chemical (as might be the case, for example, in internal use of 'LIG') you'd be well 
advised to get the chemistry from the canonical source. Here's a script that displays the SMILES strings. 
It seems to me that it would be better to go from PDB file -> RDKit molecule without the straight-jacket of 
SMILES.


Paul.
import urllib.request
import sys


if len(sys.argv) > 1:
   tlc = sys.argv[1]

   url='http://files.rcsb.org/ligands/view/' + tlc + '.cif'

   with urllib.request.urlopen(url) as response:
  html = response.read()
  lines = html.split(b'\n')
  print_it = False
  for line in lines:
 if b'#' in line:
print_it = False
 if print_it:
print(line.decode('ascii'))
 if b'_pdbx_chem_comp_descriptor.descriptor' in line:
print_it = True

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] Issue with the latest RDKit DB build

2017-12-29 Thread Paul Emsley

On 29/12/2017 19:01, Drew Gibson via Rdkit-discuss wrote:

Hello, and compliments of the season to you, RDKitters :)

I'm having trouble getting the conda build of the DB package 
(rdkit-postgresql95) working.

The issue I'm having occurs when trying to initialise the rdkit DB extension on 
a newly created DB, eg...

createdb emolecules
psql -c 'create extension rdkit' emolecules         which will give me the 
error...

psql: error while loading shared libraries: libncursesw.so.6: cannot open shared object file: No such file 
or directory


install the ncurses-libs package (I have 
ncurses-libs-6.0-8.20170212.fc26.x86_64 on fedora)






--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] postgres cartridge not parsing a SMILES

2018-01-13 Thread Paul Emsley

On 13/01/2018 18:52, Rajarshi Guha wrote:

Hi, I'm using RDKit 2017.09 with Postgres 9.5 and a substructure query is 
failing when the query SMILES is

C1=CC=C(C=C1)[N]2=CC=CC3=C2C4=C(C=CC(=C4)C5=CC=CN=C5)N=C3



Within [] the formal charge must be specified:

C1=CC=C(C=C1)[N+]2=CC=CC3=C2C4=C(C=CC(=C4)C5=CC=CN=C5)N=C3

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] Perceived bond orders of RNA PDB-files

2019-12-04 Thread Paul Emsley

On 04/12/2019 08:28, Illimar Hugo Rekand wrote:

Hello, everyone


I was wondering if there is any reason for why aromaticity and perceived bond 
orders are not set properly when using the MolFromPDB-function for RNA PDB 
files, while it works perfectly for protein PDB files?



You shouldn't be perceiving bond orders from PDB files - the chemistry is 
already specified in the CCD:

http://www.wwpdb.org/data/ccd

Here's a useful library

https://gitlab.ebi.ac.uk/pdbe/ccdutils

Paul.


___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] c++ atomic lifetime

2020-08-27 Thread Paul Emsley


On 27/08/2020 20:15, Jason Biggs wrote:
Everything I know about C++ I learned just so that I can write a link 
between an interpreted language and the rdkit, so there are definitely 
some gaps in my knowledge.


What I'm trying to understand right now is the expected lifetime of an 
Atom pointer returned by a molecule, for instance by the 
getAtomWithIdx method.  Based on the documentation, since this method 
doesn't say the user is responsible for deleting the returned pointer 
I know I'm not supposed to delete it. But when exactly does it get 
deleted? If I dereference it after deleting the molecule, what is it?


auto mol = RDKit::SmilesToMol("");
auto atom = mol->getAtomWithIdx(0);
auto m2 = atom->getOwningMol();
std::cout << "Z=" << atom->getAtomicNum() << std::endl;  // prints Z=6
delete mol;
std::cout << "Z=" << atom->getIdx() << std::endl; // prints Z=0
std::cout << "N=" << m2.getNumAtoms() << std::endl;// prints N=4
delete atom; // seg fault

I would have thought the first time dereferencing the atom pointer 
after deleting mol would have crashed, but it does not.  I would also 
have expected bad things when calling the getNumAtoms method on m2 
after calling delete on mol, but this also works just fine.  What am I 
missing?




Isn't this the soft of undefined behaviour that one would expect when 
accessing deleted memory? Try adding some code between the deletion of 
mol and the access of atom that allocates and deallocs some memory for a 
second or so.


Anyway, I wouldn't try to "out-clever" the RDKit by deleting molecules 
"by hand."



Paul.




___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] mol2 file with atom type that is suitable for amber

2020-08-07 Thread Paul Emsley



On 05/08/2020 19:44, Nikhil Maroli wrote:


I wanted to add atom types in mol2 file which is readable for 
amber/leap. Is it possible with rdkit?



I did some work on CCP4 and Amber atom types a few years ago and then 
converted to parm@Frosst (which I found to be a lot harder) but not to 
the point of correctness/publication (it was more than 90% coverage of 
the set suite though, IIRC).


https://github.com/pemsley/coot/blob/refinement/pyrogen/atom_types.py

Maybe it would be a useful start.


Paul.




___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] Problem with Drawing a molecule

2020-11-16 Thread Paul Emsley


On 16/11/2020 21:28, Navid Shervani-Tabar wrote:

Dear RDKit users,

I'm trying to plot a single molecule using RDKit. I use the following code

from rdkit.Chemimport Draw
from rdkitimport Chem

mol = Chem.MolFromSmiles('C1#CN2C1C2')
Chem.rdmolops.SanitizeMol(mol)
img = Draw.MolsToGridImage([mol], molsPerRow=1)
img.save(res_dir +'mol_1.png')

and I get the attached figure. There is an alkyne bridging in the 
molecule, which as you can see in the figure, is visualized with a 
double bond instead of a triple bond. I was wondering what causes this 
issue and how to fix it. Thanks!




To my eye, it is an unconventionally-rendered [1] triple bond where the 
right-hand most line is almost entirely clipped.



Paul.

[1] or is that how ring triple bonds are displayed? I would not have 
thought that the outside line should be short (maybe not even the inside 
line (although that does seem more elegant))




___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] chair vs boat detection

2021-03-12 Thread Paul Emsley



On 12/03/2021 05:11, Ling Chan wrote:



Just wonder if there is any function to distinguish between a chair 
ring and a boat ring?


Don't worry if there is no such utility. I can write my own geometry 
detection. Just that I don't want to reinvent the wheel.




Isn't this Cremer Pople?

http://enzyme13.bt.a.u-tokyo.ac.jp/CP/

https://smb.slac.stanford.edu/facilities/software/ccp4/html/privateer.html


Paul.




___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] explicit H atoms

2021-03-09 Thread Paul Emsley

On 09/03/2021 09:01, Jean-Marc Nuzillard wrote:

Sure, testosterone may be drawn as
[snip]


OK :-)

That's a top quality rendering by the way. How did you make it?

Paul.


___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] explicit H atoms

2021-03-08 Thread Paul Emsley

On 08/03/2021 13:55, Jean-Marc Nuzillard wrote:



Is it always possible to represent an organic molecule in 2D with all 
necessary

configuration hints (bond wedges pointing to the front or to the back)
without introducing any explicit hydrogen atom?




No. Testosterone.




___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] hybridization of nitrogen in beta-lactam

2021-02-13 Thread Paul Emsley


On 13/02/2021 18:15, Peter St. John wrote:
Is there any reason why RDKit says the nitrogen in beta-lactam is 
SP2-hybridized? I would have assumed it should be SP3. It doesn't seem 
to be the ring structure, 'C1NC1' lists all the atoms as being SP3.




>>> [(atom.GetSymbol(), atom.GetHybridization()) for atom 
in rdkit.Chem.MolFromSmiles('O=C1CCN1').GetAtoms()]


[('O', rdkit.Chem.rdchem.HybridizationType.SP2),
 ('C', rdkit.Chem.rdchem.HybridizationType.SP2),
 ('C', rdkit.Chem.rdchem.HybridizationType.SP3),
 ('C', rdkit.Chem.rdchem.HybridizationType.SP3),
 ('N', rdkit.Chem.rdchem.HybridizationType.SP2)]



Somewhat relevant:

http://iverson.cm.utexas.edu/courses/310N/POTDSp06/POTDLecture%2017.html

obviously the ring changes things somewhat, but it's basically like a 
protein amide bond.


Paul.


___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] Parsing a PDB file with atoms that are too close, causing bad bond

2021-09-28 Thread Paul Emsley



>  PDB files have no bond information,

This is not true. The chemistry is specified in the Chemical Component Dictionary using the residue 
identifier (so it's a reference to a chemical description, it's not embedded).


https://www.wwpdb.org/data/ccd

https://github.com/pdbeurope/ccdutils

Paul.


On 27/09/2021 11:22, Lewis Martin wrote:

Very interesting - thank you Francois! PDB re-do does the trick:

*import requests
from rdkit import Chem

def getPDB(code):
     out = requests.get(f'https://pdb-redo.eu/db/{code}/{code}_final.pdb 
')

     return out.content

pdb_string = getPDB('3udn')
Chem.MolFromPDBBlock(pdb_string)*

I think this solves it for me, but if anyone knows how to infer correct bonding information without relying 
on distances, I'd love to hear it too! So far I've noticed that Parmed and PDBFixer infer correct bonds, but 
they don't determine bond orders, so it's difficult to port the molecule into RDKit.


Cheers
Lewis



On Mon, Sep 27, 2021 at 5:55 PM Francois Berenger mailto:mli...@ligand.eu>> wrote:

Hi Lewis,

Just an idea: you might try to load your PDB in UCSF Chimera, then
save it as a mol2 or sdf file.
Then, try to read this sdf file from rdkit.

Another idea: try to get your pdb file through the pdbredo service.
https://pdb-redo.eu/ 
They might have fixed a few things; maybe this PDB will read better in
rdkit.

Regards,
F.

On 26/09/2021 17:02, Lewis Martin wrote:
 > Hi RDKit,
 > While parsing proteins from the PBD with RDKit, I've come across
 > situations where the distance-based bond determination leads to
 > 'incorrect' bonds between atoms that are erroneously too close
 > together. PDB files have no bond information, so it's not really
 > 'incorrect' (rather the model coordinates are off), but the bonds are
 > nonphysical - and it means the Mol objects won't sanitize.
 >
 > Here's an example:
 >
 > import requests
 > from io import BytesIO
 > import gzip
 > from rdkit import Chem
 >
 > def getPDB(code):
 >     out =
 > requests.get(f'https://files.rcsb.org/download/{code}.pdb1.gz
 [1]')
 >     binary_stream =  BytesIO(out.content)
 >     return gzip.open(binary_stream).read()
 >
 > pdb_string = getPDB('3udn')
 > Chem.MolFromPDBBlock(pdb_string)
 >
 > Error is:
 >
 > RDKit ERROR: [22:38:21] Explicit valence for atom # 573 O, 3, is
 > greater than permitted
 >
 > This is caused by the threonine 72 sidechain being too close to the
 > TYR71 backbone carbonyl oxygen (this can be visualized at
 > https://www.rcsb.org/3d-view/3UDN?preset=ligandInteraction=09B
 ,
 > TYR71 is near the ligand).
 >
 > Does anyone know how to avoid this to create a Chem.Mol? I've tried
 > using Parmed and PDBFixer, since they use residue templates to
 > generate the correct bonding topology, but they don't write CONECT
 > records or SDFs, so the bonds are still lost to RDKit.
 >
 > Thanks for your time!
 > Lewis
 > PS - why not just use PDBFixer? I'm trying to calculate atom
 > invariants using RDKit's morgan fingerprinter implementation, so
 > ultimately I want a sanitized Mol object
 >
 > Links:
 > --
 > [1] https://files.rcsb.org/download/%7Bcode%7D.pdb1.gz

 > ___
 > 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] cairo/png problem

2022-12-14 Thread Paul Emsley


On 13/12/2022 23:39, Thiessen, Paul (NIH/NLM/NCBI) [E] via Rdkit-discuss 
wrote:


Hi folks,

I’m trying to use the MolDraw2DCairo class to generate PNG images. But 
no matter what I’ve tried, including setting the ‘noFreetype’ param to 
true in the c’tor, I get an empty string from getDrawingText() and an 
exception with message “PNG header not recognized”. I traced this 
problem to the call to cairo_surface_write_to_png_stream() in 
MolDraw2DCairo.cpp, which gives an empty string and returns the cairo 
error/status “no memory.” Any ideas what’s causing this? I know 
nothing about cairo/freetype… I’m using cairo 1.16.


Are you linking the RDKit with other libraries? In my case, which gave 
weird png errors like yours, I was linking to other libraries that 
depended on a different version of libpng.



Paul.

___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] Get original SMILES from molecule

2022-12-14 Thread Paul Emsley


On 14/12/2022 17:37, Thomas wrote:
Is there a way to get the SMILES used to generate the molecule (NOT 
the canonical one)?

Not as far as I know.


If I generate a molecule from a SMILES, a call to GetAtoms() returns 
the atoms in the order of the input SMILES. I'd like to retrieve that 
SMILES, so I can play with it using the info from GetAtoms or 
GetBonds. Is that possible?



after you  create your mol, add a property:

mol = Chem.MolFromSmiles(smiles)

mol.SetProp("SMILES", smiles)


then use

mol.GetProp("SMILES")

when you need it later.


Paul.




___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss