Re: [Rdkit-discuss] PathToSubmol on atom indices?

2020-06-04 Thread Michal Krompiec
Dear Kangway,
Thank you very much!
M.

On Thu, Jun 4, 2020 at 6:56 PM Chuang, Kangway 
wrote:

> Hi Michal,
>
> You can use rdkit.Chem.rdmolfiles.MolFragmentToSmiles (or related
> MolFragmentToSmarts) and specify an atom id list with "atomsToUse":
>
> e.g.
>
> rdkit.Chem.rdmolfiles.MolFragmentToSmiles(mol, atomsToUse=[11,13,22,15])
>
> Kangway
> --
> *From:* Michal Krompiec 
> *Sent:* Thursday, June 4, 2020 10:45 AM
> *To:* RDKit Discuss 
> *Subject:* [Rdkit-discuss] PathToSubmol on atom indices?
>
> Hello, I noticed this was discussed before and I'm wondering if anything's
> changed.
> Is it possible to extract a substructure from a molecule, based on atom
> indices? I understand that Chem.PathToSubmol does something similar, but
> takes bond indices.
> Best,
> Michal
>
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] PathToSubmol on atom indices?

2020-06-04 Thread Chuang, Kangway
Hi Michal,

You can use rdkit.Chem.rdmolfiles.MolFragmentToSmiles (or related 
MolFragmentToSmarts) and specify an atom id list with "atomsToUse":

e.g.

rdkit.Chem.rdmolfiles.MolFragmentToSmiles(mol, atomsToUse=[11,13,22,15])

Kangway

From: Michal Krompiec 
Sent: Thursday, June 4, 2020 10:45 AM
To: RDKit Discuss 
Subject: [Rdkit-discuss] PathToSubmol on atom indices?

Hello, I noticed this was discussed before and I'm wondering if anything's 
changed.
Is it possible to extract a substructure from a molecule, based on atom 
indices? I understand that Chem.PathToSubmol does something similar, but takes 
bond indices.
Best,
Michal
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


[Rdkit-discuss] PathToSubmol on atom indices?

2020-06-04 Thread Michal Krompiec
Hello, I noticed this was discussed before and I'm wondering if anything's
changed.
Is it possible to extract a substructure from a molecule, based on atom
indices? I understand that Chem.PathToSubmol does something similar, but
takes bond indices.
Best,
Michal
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] check if there is a path between atoms in fragmented molecule

2020-06-04 Thread Paolo Tosco

Dear Michal,

You can use

http://rdkit.org/docs/source/rdkit.Chem.rdmolops.html?highlight=path#rdkit.Chem.rdmolops.GetShortestPath

or

http://rdkit.org/docs/source/rdkit.Chem.rdmolops.html?highlight=distance#rdkit.Chem.rdmolops.GetDistanceMatrix

e.g.:

from  rdkit  import  Chem

cx=Chem.MolFromSmiles('C1C1')
bonds=(cx.GetBondBetweenAtoms(1,2).GetIdx(),  
cx.GetBondBetweenAtoms(3,4).GetIdx())
fragmented=Chem.FragmentOnBonds(cx,bonds)

mat  =  Chem.GetDistanceMatrix(cx)

mat[1,2]

1.0

Chem.GetShortestPath(cx,  1,  2)

(1, 2)

mat  =  Chem.GetDistanceMatrix(fragmented)

mat[1, 2]

1.0

Chem.GetShortestPath(fragmented,  1,  2)

()


Cheers,
p.

On 04/06/2020 16:17, Michal Krompiec wrote:

Hello,
When a molecule is fragmented with Chem.FragmentOnBonds, how can I 
check if there still is a path between two given atoms?
For example, this snippet breaks C1-C2 and C3-C4 bonds in cyclohexane, 
producing two fragments:


from rdkit import Chem
cx=Chem.MolFromSmiles('C1C1')
bonds=(cx.GetBondBetweenAtoms(1,2).GetIdx(), 
cx.GetBondBetweenAtoms(3,4).GetIdx())

fragmented=Chem.FragmentOnBonds(cx,bonds)

Is there a way in RDKit to check if there is a path between, say, C1 
and C2, without having to manually traverse the whole molecular graph? 
I guess the alternative is to load everything into a graph library 
like networkx...


Best wishes,
Michal Krompiec
Merck KGaA


___
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] Scalability of Postgres cartridge

2020-06-04 Thread Ivan Tubert-Brohman
Hi,

I've never tried the RDKit PostgreSQL cartridge but I'm curious about it.
In particular I wonder how far have people pushed it in terms of
database size. The documentation gives examples with several million rows;
has anyone tried it with a couple billion rows? How fast are substructure
queries with databases of that size? How much storage is needed after
accounting for the fingerprints etc.

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


Re: [Rdkit-discuss] Install RDKit (Docker, rapids, rdkit=2020.03.2) ?/

2020-06-04 Thread Greg Landrum
Hi Joey,

It looks like there's a dependency conflict in there somewhere that conda
is unable to resolve.

Unsurprisingly, it looks like at least part of the problem here is the
version of boost. The rapids environment that you are using has boost 1.70
installed (and that's probably a dependency of some other package in the
environment), but the 2020.03 rdkit builds from conda-forge requires boost
1.72.

I was able to make things work by simplifying your dockerfile and letting
conda install the most recent compatible version of the RDKit (in this case
that ends up being 2019.09.3):

FROM rapidsai/rapidsai:0.12-cuda10.1-runtime-ubuntu18.04

ARG ENVNAME=rapids

ENV ENVNAME=$ENVNAME

#RUN source activate $ENVNAME && \
#conda install boost>='1.72.0,<1.72.1.0a0' cairo>='1.16.0,<1.17.0a0'
freetype>='2.9.1,<3.0a0' libgcc-ng>='7.3.0' libstdcxx-ng>='7.3.0'
numpy>='1.14.6,<2.0a0' pandas pillow pycairo python>='3.7,<3.8.0a0'
python_abi='3.7.* *_cp37m' six


RUN source activate $ENVNAME && \
conda list && \
conda install rdkit



I hope this helps,
-greg








On Wed, Jun 3, 2020 at 10:43 PM Storer, Joey (J)  wrote:

> Hi,
>
>
>
> I am trying to run the following Docker file and the container fails to
> install rdkit.  Other incarnations install either the 2019 version or even
> the 2017 version.
>
>
>
> *#*
>
> *FROM rapidsai/rapidsai:0.12-cuda10.1-runtime-ubuntu18.04*
>
>
>
> *ARG ENVNAME=rapids*
>
> *ENV ENVNAME=$ENVNAME*
>
>
>
> *RUN source activate $ENVNAME && \*
>
> *conda install boost>='1.72.0,<1.72.1.0a0' cairo>='1.16.0,<1.17.0a0'
> freetype>='2.9.1,<3.0a0' libgcc-ng>='7.3.0' libstdcxx-ng>='7.3.0'
> numpy>='1.14.6,<2.0a0' pandas pillow pycairo python>='3.7,<3.8.0a0'
> python_abi='3.7.* *_cp37m' six*
>
>
>
> *RUN source activate $ENVNAME && \*
>
> *conda install "rdkit=2020.03.2=py37hdd87690_0"*
>
>
>
> *#*
>
>
>
> Any advice on getting RDKit into a Rapids/Ubuntu Docker container?
>
>
>
> Thanks!
>
> Joey Storer (Dow, Inc.)
> ___
> 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