[Rdkit-discuss] atom coordinates

2013-11-08 Thread Michal Krompiec
Hello,
In the Python API, is it possible to read the 3D coordinates of an
atom (from a Mol object created from an SDF file with 3D coords)?
Thanks,
Michal

--
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most 
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231iu=/4140/ostg.clktrk
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] atom coordinates

2013-11-08 Thread JP
Yes, of course - try this:

conf = mol.GetConformer()
pt = conf.GetAtomPosition(0)

Cheers
JP



On 8 November 2013 12:01, Michal Krompiec michal.kromp...@gmail.com wrote:

 Hello,
 In the Python API, is it possible to read the 3D coordinates of an
 atom (from a Mol object created from an SDF file with 3D coords)?
 Thanks,
 Michal


 --
 November Webinars for C, C++, Fortran Developers
 Accelerate application performance with scalable programming models.
 Explore
 techniques for threading, error checking, porting, and tuning. Get the most
 from the latest Intel processors and coprocessors. See abstracts and
 register
 http://pubads.g.doubleclick.net/gampad/clk?id=60136231iu=/4140/ostg.clktrk
 ___
 Rdkit-discuss mailing list
 Rdkit-discuss@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

--
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most 
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231iu=/4140/ostg.clktrk___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] atom coordinates

2013-11-08 Thread Michal Krompiec
Thanks a lot!
Michal

On 8 November 2013 12:40, Paolo Tosco paolo.to...@unito.it wrote:
 Hi Michal,

 I think this Python snippet should do what you need:

 from rdkit import Chem
 from rdkit.Chem import AllChem

 sdf = 'benzene.sdf'
 supplier = Chem.SDMolSupplier(sdf, True, False)
 mol = supplier[0]
 for i in range(0, mol.GetNumAtoms()):
   pos = mol.GetConformer().GetAtomPosition(i)
   print '{0:12.4f}{1:12.4f}{2:12.4f}'.format(pos.x, pos.y, pos.z)


 Cheers,
 p.


 On 11/08/2013 01:01 PM, Michal Krompiec wrote:

 Hello,
 In the Python API, is it possible to read the 3D coordinates of an
 atom (from a Mol object created from an SDF file with 3D coords)?
 Thanks,
 Michal


 --
 November Webinars for C, C++, Fortran Developers
 Accelerate application performance with scalable programming models.
 Explore
 techniques for threading, error checking, porting, and tuning. Get the
 most
 from the latest Intel processors and coprocessors. See abstracts and
 register

 http://pubads.g.doubleclick.net/gampad/clk?id=60136231iu=/4140/ostg.clktrk
 ___
 Rdkit-discuss mailing list
 Rdkit-discuss@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/rdkit-discuss



 --
 ==
 Paolo Tosco, Ph.D.
 Department of Drug Science and Technology
 Via Pietro Giuria, 9 - 10125 Torino (Italy)
 Tel: +39 011 670 7680 | Mob: +39 348 5537206
 Fax: +39 011 670 7687 | E-mail: paolo.to...@unito.it
 http://open3dqsar.org | http://open3dalign.org
 ==


--
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most 
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231iu=/4140/ostg.clktrk
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


[Rdkit-discuss] postgres FPs in python

2013-11-08 Thread George Papadatos
Hi there,
DB-related question again:
When I retrieve fps from a postgres db, they look like this:
\x020c00102204810001040001981408420180400040048088c020800423a192001814002021044200092400040208

Is there are way to convert them to RDKit bitvector fingerprint objects or
at least bitvector strings in python?


Thanks,

George
--
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most 
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231iu=/4140/ostg.clktrk___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] postgres FPs in python

2013-11-08 Thread Greg Landrum
Hi George,

On Fri, Nov 8, 2013 at 5:02 PM, George Papadatos gpapada...@gmail.comwrote:

 Hi there,
 DB-related question again:
 When I retrieve fps from a postgres db, they look like this:

 \x020c00102204810001040001981408420180400040048088c020800423a192001814002021044200092400040208

 Is there are way to convert them to RDKit bitvector fingerprint objects or
 at least bitvector strings in python?


There is an rdkit cartridge function called bfp_to_binary_text() that you
can use for the bit vector fingerprints:

In [61]: m = Chem.MolFromSmiles('COC')

In [62]: fp =
Chem.RDKFingerprint(m,minPath=1,maxPath=6,fpSize=1024,nBitsPerHash=2)

In [63]: curs.execute(select bfp_to_binary_text(rdkit_fp('COC')))

In [64]: row = curs.fetchone()

In [66]: nfp = DataStructs.CreateFromBinaryText(str(row[0]))

In [67]: nfp==fp
Out[67]: True


I don't think there's currently a way to do something equivalent for
count-based fingerprints (sfp's in the cartridge nomenclature), but it
could be added if there was demand.

-greg
--
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most 
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231iu=/4140/ostg.clktrk___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss