Re: [Rdkit-discuss] mol file parsing, 3D or 2D

2018-01-17 Thread Dimitri Maziuk
On 2018-01-16 22:46, Greg Landrum wrote: It might be worth thinking about adding an option to the aromaticity perception code to maintain the original bond types and just set the "isAromatic" flag on the bonds. This is how it's modeled in mmCIF chem. comp. It may or may not come from

[Rdkit-discuss] ConstrainedEmbed and issues with overlapping Hs

2018-01-17 Thread Susan Leung
Dear all, I am using Constrained embed to generate conformers. I AddHs before I use ConstrainedEmbed but I am finding that some of the conformers have Hs which overlap (have the same coordinates). Here is one example below. from rdkit import Chem from rdkit.Chem import AllChem, rdFMCS from

Re: [Rdkit-discuss] mol file parsing, 3D or 2D

2018-01-17 Thread Jason Biggs
On Wed, Jan 17, 2018 at 10:12 AM, Dimitri Maziuk wrote: > On 2018-01-16 22:46, Greg Landrum wrote: > > It might be worth thinking about adding an option to the aromaticity >> perception code to maintain the original bond types and just set the >> "isAromatic" flag on the

[Rdkit-discuss] edge matrix

2018-01-17 Thread Mario Lovrić
Dear all, Does any one have an idea how to get an edge matrix (graph theory) out of Rdkit, I digged deep but didnt find anything. F.example for: 'CC(C)CC' it would be: array([[0, 1, 1, 0], [1, 0, 1, 0], [1, 1, 0, 1], [0, 0, 1, 0]]) Thanks. -- Mario Lovrić

Re: [Rdkit-discuss] edge matrix

2018-01-17 Thread Guillaume GODIN
Dear Mario, There is a adjacency matrix available: from rdkit import Chem mol = Chem.MolFromSmiles('CC(C)CC') adj = Chem.GetAdjacencyMatrix(mol) print adj [[0 1 0 0 0] [1 0 1 1 0] [0 1 0 0 0] [0 1 0 0 1] [0 0 0 1 0]] But this is not what you want… Can you explain your output

[Rdkit-discuss] Exhaustive Library Enumeration

2018-01-17 Thread Andy Jennings
Hi RDKitters, I have a question and an observation on the topic of library enumeration. First, the question: is there a call within RDKit to trigger the exhaustive reaction of reagents? For example, if I have two reagents - a primary amine and an akyl chloride - can I tell RDKit to enumerate the

Re: [Rdkit-discuss] edge matrix

2018-01-17 Thread Mario Lovrić
Dear Marta and Guillaume, Thank you both. Your solutions are giving the same output, which is the vertices-adjacency matrix. There is something called the edge-adjaceny matrix. Its defined in several papers by Trinajstic to calculate the M2 Zagreb indices, eg. "The Zagreb Indices 30 Years After"

Re: [Rdkit-discuss] edge matrix

2018-01-17 Thread Jason Biggs
I am a novice when it comes to graph theory, but it seems like what is wanted here is the adjacency matrix of the corresponding line graph ( http://mathworld.wolfram.com/LineGraph.html). I don't know how to do this in python, but if I use mathematica, it goes like this adjacencyMatrix = {{0, 1,

Re: [Rdkit-discuss] mol file parsing, 3D or 2D

2018-01-17 Thread Dimitri Maziuk
On 2018-01-17 10:25, Jason Biggs wrote: For the case in question, I find that if I read in a mol file containing 2D coordinates, and I skip the sanitization step altogether, then the 3D embedding algorithms fail. Well, yes, as I mentioned in the other thread: the only way you can get it to

Re: [Rdkit-discuss] edge matrix

2018-01-17 Thread Marta Stępniewska-Dziubińska via Rdkit-discuss
Hi Mario, What exactly do you mean by 'edge matrix'? Are you sure you provided a correct example? If you want to get an adjacency matrix of a molecular graph you can iterate over bonds to get it: from rdkit.Chem import MolFromSmiles import numpy as np m = MolFromSmiles('CC(C)CC') n =

Re: [Rdkit-discuss] edge matrix

2018-01-17 Thread Chris Earnshaw
I don't think there's a way to do this using RDKit itself, but it appears to be straightforward using Python with numpy and networkx, e.g. import numpy as np import networkx as nx a = np.matrix([[0, 1, 0, 0, 0],[1, 0, 1, 1, 0],[0, 1, 0, 0, 0],[0, 1, 0, 0, 1],[0, 0, 0, 1, 0]]) b =

Re: [Rdkit-discuss] Exhaustive Library Enumeration

2018-01-17 Thread Christos Kannas
Hi Andy, A better option is to sanitize the products of a reaction enumeration before using them as reactants. Look at this example from RDKit "Getting Started" documentation. Note that the molecules that are produced by the chemical reaction processing code are not sanitized, as this artificial

Re: [Rdkit-discuss] Exhaustive Library Enumeration

2018-01-17 Thread Christos Kannas
Hi Andy, The reason that your code breaks is that the second product of the third iteration ( 'NN(Cc1c1)(Cc1c1)Cc1c1') is not a valid molecule. And when calling Chem.MolFromSmiles( 'NN(Cc1c1)(Cc1c1)Cc1c1') it creates a None object. So you have to filter out the

Re: [Rdkit-discuss] Exhaustive Library Enumeration

2018-01-17 Thread Andy Jennings
Hi Christos, Many thanks for the reply. I hadn't appreciated that the presence of a single invalid reagent would bring the entire thing crashing down, rather than issuing a warning/error and moving onto other molecules in the set. Good to know, and I'll have to be less lazy in my code ;-) Best,

Re: [Rdkit-discuss] RDKit and Google Summer of Code 2018

2018-01-17 Thread Michal Krompiec
+1 vote for Symmetrizer. It would be very useful for preparing input for computational chemistry codes. Best, Michal Krompiec Merck KGaA On Mon, 15 Jan 2018 at 15:21, Jason Biggs wrote: > >- I've had this on my to-do list for a few months now, implementing >the

Re: [Rdkit-discuss] RDKit and Google Summer of Code 2018

2018-01-17 Thread Guillaume GODIN
+1 for Symmetrizer too, A must! De : Michal Krompiec Date : jeudi, 18 janvier 2018 à 08:18 À : Jason Biggs Cc : RDKit Discuss, Greg Landrum Objet : Re: [Rdkit-discuss] RDKit and Google Summer of Code 2018 +1 vote for Symmetrizer. It would be very useful for preparing input for computational

Re: [Rdkit-discuss] edge matrix

2018-01-17 Thread Mario Lovrić
Correct, I am looking for a rdkit-hidden-option to do it :D On Wed, Jan 17, 2018 at 5:56 PM, Jason Biggs wrote: > I am a novice when it comes to graph theory, but it seems like what is > wanted here is the adjacency matrix of the corresponding line graph ( >