[Rdkit-discuss] rearomatize only benzene rigns after kekulize + clearAromaticFlags

2016-09-19 Thread Guillaume GODIN
Dear All,


I would like to kekulize the molecule, but only conserve the aromaticity 
knowledge of C6 (benzene like)  type rings


So what to need to do after this command?


Chem.rdmolops.Kekulize(mol, clearAromaticFlags=True)


Should I need to store benzene like location before the Kekulize process and 
restore it after and How to restore it (SetIsAromatic of atoms as true and 
change bondtype )?


best regards,


Guillaume GODIN
**  
DISCLAIMER  
This email and any files transmitted with it, including replies and forwarded 
copies (which may contain alterations) subsequently transmitted from Firmenich, 
are confidential and solely for the use of the intended recipient. The contents 
do not represent the opinion of Firmenich except to the extent that it relates 
to their official business.  
**--
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] bond length in 2D structure drawing

2016-09-19 Thread Axel Pahl

Hi Greg,

thanks a lot.
That is exactly what I was looking for!

RDKit rules!

Kind regards,
Axel


On 19.09.2016 09:35, Greg Landrum wrote:

Hi Axel,

It's probably most straightforward to use the function 
AllChem.TransformMol() to scale the coordinates.
Here's an example of applying the function to scale all the 
coordinates by a factor of 2:


In [1]: from rdkit import Chem

In [2]: from rdkit.Chem import rdMolTransforms

In [5]: from rdkit.Chem import AllChem

In [6]: import numpy

In [7]: tm = numpy.zeros((4,4),numpy.double)

In [8]: for i in range(3): tm[i,i] = 2.

In [9]: tm[3,3] = 1.

In [10]: m = Chem.MolFromSmiles('C1CCC1')

In [11]: AllChem.Compute2DCoords(m)
Out[11]: 0

In [12]: print(Chem.MolToMolBlock(m))

 RDKit  2D

  4  4  0  0  0  0  0  0  0  0999 V2000
1.0607   -0.0. C   0  0  0  0  0  0  0  0  0  0  0  0
   -0.   -1.06070. C   0  0  0  0  0  0  0  0  0  0  0  0
   -1.06070.0. C   0  0  0  0  0  0  0  0  0  0  0  0
0.1.06070. 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  1  1  0
M  END


In [13]: AllChem.TransformMol(m,tm)

In [14]: print(Chem.MolToMolBlock(m))

 RDKit  2D

  4  4  0  0  0  0  0  0  0  0999 V2000
2.1213   -0.0. C   0  0  0  0  0  0  0  0  0  0  0  0
   -0.   -2.12130. C   0  0  0  0  0  0  0  0  0  0  0  0
   -2.12130.0. C   0  0  0  0  0  0  0  0  0  0  0  0
0.2.12130. 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  1  1  0
M  END


In your case, assuming that the bond length in the drawings is 1.0A, 
you would use a scale factor of 1.5 (that's on line [8] above).


Best,
-greg


On Mon, Sep 19, 2016 at 8:41 AM, Axel Pahl > wrote:


Dear fellow RDKitters,

I have an SD file with 2D molecules generated by another
Cheminformatics
toolkit (yes, there are others! ;-) ).
When I depict them with RDKit (with Draw.MolToImage()) they look very
condensed with too short bonds and just appear not right.
When I re-generate the coordinates by using Compute2DCoord(), the
structure drawings do look great, but RDkit re-calculates all
coordinates and the orientation of the whole molecule is
completely changed.
Can I avoid this, keep the original orientation of the molecules and
just do something like "apply drawing settings" or "use standard bond
lengths" to a molecule?

Many thanks in advance.

Kind regards,
Axel



--
___
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] a SMILES that rdkit cannot read

2016-09-19 Thread Greg Landrum
What Curt says is true if you just start the jupyter notebook and import
the RDKit.
However, if you also import the Jupyter integration (using "from
rdkit.Chem.Draw import IPythonConsole"), then you should also see the C++
error messages and warnings show up in the console:
[image: Inline image 1]

This may not work on Windows (which is another problem, please let us know
if it doesn't), but it definitely ought to work on Linux and the Mac.

-greg



On Mon, Sep 19, 2016 at 5:38 PM, Curt Fischer 
wrote:

>
> I ran it in jupyter via browser. Both docker/ubuntu and windows were
>> tested and found that jupyter won't give error. Ipython or python in
>> terminal(cmd) would show this error.
>>
>>
> That problem is related to how Jupyter interacts with python kernels.
> It's not an RDKit issue.  If you check the terminal that you used to launch
> the jupyter notebook process, the error/warning that you are talking about
> is probably displayed there rather than in the Jupyter notebook.
>
> Curt
>
>
--
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] a SMILES that rdkit cannot read

2016-09-19 Thread Curt Fischer
> I ran it in jupyter via browser. Both docker/ubuntu and windows were
> tested and found that jupyter won't give error. Ipython or python in
> terminal(cmd) would show this error.
>
>
That problem is related to how Jupyter interacts with python kernels.  It's
not an RDKit issue.  If you check the terminal that you used to launch the
jupyter notebook process, the error/warning that you are talking about is
probably displayed there rather than in the Jupyter notebook.

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


Re: [Rdkit-discuss] a SMILES that rdkit cannot read

2016-09-19 Thread 杨弘宾






Thanks. It's really a obvious error.I ran it in jupyter via browser. Both 
docker/ubuntu and windows were tested and found that jupyter won't give error. 
Ipython or python in terminal(cmd) would show this error.
Why not raise a python error or warning?

Hongbin Yang 

 From: Greg LandrumDate: 2016-09-19 12:08To: 杨弘宾CC: rdkit-discussSubject: Re: 
[Rdkit-discuss] a SMILES that rdkit cannot readHi,

On Mon, Sep 19, 2016 at 5:33 AM, 杨弘宾  wrote:

   When I used rdkit to parse a smi file, I found that there was a SMILES that 
rdkit cannot parse, and no any error or warning.


version: Release_2016_03_1>>> mol = 
Chem.MolFromSmiles('N(CC(O)C1=C\C(=N/#N)\C(=O)C=C1)N=O')>>> print molNone

This compound can be read by OpenBabel. But I have no idea why it didnot work.
I don't know why OpenBabel accepts it, but there's definitely an error in that 
SMILES. This part: "=N/#N" has a single bond (the "/") directly followed by a 
triple bond (the "#"), and that's not legal SMILES.
I do see an error message when I try the SMILES:In [2]: mol = 
Chem.MolFromSmiles('N(CC(O)C1=C\C(=N/#N)\C(=O)C=C1)N=O')[06:04:54] SMILES 
Parse Error: syntax error for input: 
'N(CC(O)C1=C\C(=N/#N)\C(=O)C=C1)N=O'and find it a bit odd that you don't. 
What operating system are you using and how are you running the code?
Best,-greg


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


Re: [Rdkit-discuss] bond length in 2D structure drawing

2016-09-19 Thread Greg Landrum
Hi Axel,

It's probably most straightforward to use the function
AllChem.TransformMol() to scale the coordinates.
Here's an example of applying the function to scale all the coordinates by
a factor of 2:

In [1]: from rdkit import Chem

In [2]: from rdkit.Chem import rdMolTransforms

In [5]: from rdkit.Chem import AllChem

In [6]: import numpy

In [7]: tm = numpy.zeros((4,4),numpy.double)

In [8]: for i in range(3): tm[i,i] = 2.

In [9]: tm[3,3] = 1.

In [10]: m = Chem.MolFromSmiles('C1CCC1')

In [11]: AllChem.Compute2DCoords(m)
Out[11]: 0

In [12]: print(Chem.MolToMolBlock(m))

 RDKit  2D

  4  4  0  0  0  0  0  0  0  0999 V2000
1.0607   -0.0. C   0  0  0  0  0  0  0  0  0  0  0  0
   -0.   -1.06070. C   0  0  0  0  0  0  0  0  0  0  0  0
   -1.06070.0. C   0  0  0  0  0  0  0  0  0  0  0  0
0.1.06070. 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  1  1  0
M  END


In [13]: AllChem.TransformMol(m,tm)

In [14]: print(Chem.MolToMolBlock(m))

 RDKit  2D

  4  4  0  0  0  0  0  0  0  0999 V2000
2.1213   -0.0. C   0  0  0  0  0  0  0  0  0  0  0  0
   -0.   -2.12130. C   0  0  0  0  0  0  0  0  0  0  0  0
   -2.12130.0. C   0  0  0  0  0  0  0  0  0  0  0  0
0.2.12130. 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  1  1  0
M  END


In your case, assuming that the bond length in the drawings is 1.0A, you
would use a scale factor of 1.5 (that's on line [8] above).

Best,
-greg


On Mon, Sep 19, 2016 at 8:41 AM, Axel Pahl  wrote:

> Dear fellow RDKitters,
>
> I have an SD file with 2D molecules generated by another Cheminformatics
> toolkit (yes, there are others! ;-) ).
> When I depict them with RDKit (with Draw.MolToImage()) they look very
> condensed with too short bonds and just appear not right.
> When I re-generate the coordinates by using Compute2DCoord(), the
> structure drawings do look great, but RDkit re-calculates all
> coordinates and the orientation of the whole molecule is completely
> changed.
> Can I avoid this, keep the original orientation of the molecules and
> just do something like "apply drawing settings" or "use standard bond
> lengths" to a molecule?
>
> Many thanks in advance.
>
> Kind regards,
> Axel
>
>
> 
> --
> ___
> 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] bond length in 2D structure drawing

2016-09-19 Thread Axel Pahl
Dear fellow RDKitters,

I have an SD file with 2D molecules generated by another Cheminformatics 
toolkit (yes, there are others! ;-) ).
When I depict them with RDKit (with Draw.MolToImage()) they look very 
condensed with too short bonds and just appear not right.
When I re-generate the coordinates by using Compute2DCoord(), the 
structure drawings do look great, but RDkit re-calculates all 
coordinates and the orientation of the whole molecule is completely changed.
Can I avoid this, keep the original orientation of the molecules and 
just do something like "apply drawing settings" or "use standard bond 
lengths" to a molecule?

Many thanks in advance.

Kind regards,
Axel


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