Re: [Rdkit-discuss] MolToMolBlock problem

2023-02-22 Thread Ling Chan
Please ignore the "conda update" question in my previous email. Problem
solved. Thank you!

> HOWEVER, I would also need some advice. When I was in my original rdkit
environment, I did a "conda update rdkit".
> It downloaded many packages, installed many, removed some. But at the end
of the exercise, I still ended up with
> what I initially had, namely RDKit 2021.03.4. I had to install rdkit
again from scratch to get the new version.
> What am I doing wrongly?

I forgot to set the channel to conda-forge. After I set this, the update
was successful.


Ling Chan  於 2023年2月22日週三 下午4:13寫道:

> Hello Greg,
>
> Indeed it was the RDKit version. I was using 2021.03.4. Sorry about the
> false alarm! The error message was as below. When I use 2022.09.4, there
> was no problem.
>
> HOWEVER, I would also need some advice. When I was in my original rdkit
> environment, I did a "conda update rdkit". It downloaded many packages,
> installed many, removed some. But at the end of the exercise, I still ended
> up with what I initially had, namely RDKit 2021.03.4. I had to install
> rdkit again from scratch to get the new version. What am I doing wrongly?
>
> Thanks again!
>
> Ling
>
>
> 
>
> 
> Invariant Violation
> no eligible neighbors for chiral center
> Violation occurred on line 209 in file
> /home/conda/feedstock_root/build_artifacts/rdkit_1626029732763/work/Code/GraphMol/FileParsers/MolFileStereochem.cpp
> Failed Expression: nbrScores.size()
> 
>
> Traceback (most recent call last):
>   File "/home/c/Documents/Notes/rdkIllustrate/MolToMolBlock/p1.py", line
> 9, in 
> MolBlock2(sys.argv[1])
>   File "/home/c/Documents/Notes/rdkIllustrate/MolToMolBlock/p1.py", line
> 7, in MolBlock2
> print (Chem.MolToMolBlock(m2))
> RuntimeError: Invariant Violation
> no eligible neighbors for chiral center
> Violation occurred on line 209 in file
> Code/GraphMol/FileParsers/MolFileStereochem.cpp
> Failed Expression: nbrScores.size()
> RDKIT: 2021.03.4
> BOOST: 1_74
>
>
>
>
> Greg Landrum  於 2023年2月22日週三 上午7:14寫道:
>
>> Hi Ling,
>>
>> I can't reproduce this problem on windows using the most recent version
>> of the RDKit.
>> Which version of the RDKit are you using and how did you install it?
>>
>> Please also share exactly what you see for an error message.
>>
>> -greg
>>
>>
>> On Tue, Feb 21, 2023 at 7:03 AM Ling Chan  wrote:
>>
>>> Dear colleagues,
>>>
>>> Don't know if this is a bug, or if my input molecule is not good. I
>>> suspect that it is the former.
>>>
>>> If you run the following on the file "full.sdf", it will crash at the
>>> MolToMolBlock line.
>>>
>>> for m1 in Chem.SDMolSupplier(inputsdf, removeHs=False):
>>> m2=Chem.RemoveHs(m1)
>>> print (Chem.MolToMolBlock(m2))
>>>
>>> You can confirm that the problem is due to the stereo definition of the
>>> double bond, since if you edit the bond line " 4 5 2 3" to " 4 5 2 0" it
>>> will not crash.
>>>
>>> I tried to simplify the situation by boiling the molecule down to
>>> "simple.sdf". Unfortunately it does not crash any more.
>>>
>>> Thanks.
>>>
>>> Ling
>>>
>>>
>>>
>>> ___
>>> 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] MolToMolBlock problem

2023-02-22 Thread Wim Dehaen
Hi all,
No error on rdkit 2022.09.04 boost 1_78 (Ubuntu 20.04).
However I am able to reproduce the error on 2022.03.2, here it is:


Invariant Violation
no eligible neighbors for chiral center
Violation occurred on line 238 in file
/project/build/temp.linux-x86_64-cpython-39/rdkit/Code/GraphMol/FileParsers/MolFileStereochem.cpp
Failed Expression: nbrScores.size()



---RuntimeError
 Traceback (most recent call
last) in   3 for m1 in
Chem.SDMolSupplier("full.sdf", removeHs=False):  4
m2=Chem.RemoveHs(m1)> 5 print (Chem.MolToMolBlock(m2))
RuntimeError: Invariant Violation
no eligible neighbors for chiral center
Violation occurred on line 238 in file
Code/GraphMol/FileParsers/MolFileStereochem.cpp
Failed Expression: nbrScores.size()
RDKIT: 2022.03.2
BOOST: 1_75

In fact, just rendering m2 in the jupyter notebook using display() causes a
crash

RuntimeError: Invariant Violation
no eligible neighbors for chiral center
Violation occurred on line 238 in file
Code/GraphMol/FileParsers/MolFileStereochem.cpp
Failed Expression: nbrScores.size()
RDKIT: 2022.03.2
BOOST: 1_75

This seems to be related to sulfoxide stereochemistry assignment, see this
issue https://github.com/rdkit/rdkit/issues/2227
In any case, it seems like it is fixed in up-to-date rdkit.

However, it looks like there is still a subtle stereochemistry related
issue: if i convert m2 to SMILES I get:

C[C@@H]1[C@@H](C)[C@H](C=C[At])[S@](=O)[C@@H]1*[SH]*=O

I.e. the second sulfur (bolded) is not assigned stereochemistry, but the
first one is. Both are asymmetric.

best wishes
wim





On Wed, Feb 22, 2023 at 4:20 PM Greg Landrum  wrote:

> Hi Ling,
>
> I can't reproduce this problem on windows using the most recent version of
> the RDKit.
> Which version of the RDKit are you using and how did you install it?
>
> Please also share exactly what you see for an error message.
>
> -greg
>
>
> On Tue, Feb 21, 2023 at 7:03 AM Ling Chan  wrote:
>
>> Dear colleagues,
>>
>> Don't know if this is a bug, or if my input molecule is not good. I
>> suspect that it is the former.
>>
>> If you run the following on the file "full.sdf", it will crash at the
>> MolToMolBlock line.
>>
>> for m1 in Chem.SDMolSupplier(inputsdf, removeHs=False):
>> m2=Chem.RemoveHs(m1)
>> print (Chem.MolToMolBlock(m2))
>>
>> You can confirm that the problem is due to the stereo definition of the
>> double bond, since if you edit the bond line " 4 5 2 3" to " 4 5 2 0" it
>> will not crash.
>>
>> I tried to simplify the situation by boiling the molecule down to
>> "simple.sdf". Unfortunately it does not crash any more.
>>
>> Thanks.
>>
>> Ling
>>
>>
>>
>> ___
>> 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] MolToMolBlock problem

2023-02-22 Thread Ling Chan
Hello Greg,

Indeed it was the RDKit version. I was using 2021.03.4. Sorry about the
false alarm! The error message was as below. When I use 2022.09.4, there
was no problem.

HOWEVER, I would also need some advice. When I was in my original rdkit
environment, I did a "conda update rdkit". It downloaded many packages,
installed many, removed some. But at the end of the exercise, I still ended
up with what I initially had, namely RDKit 2021.03.4. I had to install
rdkit again from scratch to get the new version. What am I doing wrongly?

Thanks again!

Ling




Invariant Violation
no eligible neighbors for chiral center
Violation occurred on line 209 in file
/home/conda/feedstock_root/build_artifacts/rdkit_1626029732763/work/Code/GraphMol/FileParsers/MolFileStereochem.cpp
Failed Expression: nbrScores.size()


Traceback (most recent call last):
  File "/home/c/Documents/Notes/rdkIllustrate/MolToMolBlock/p1.py", line 9,
in 
MolBlock2(sys.argv[1])
  File "/home/c/Documents/Notes/rdkIllustrate/MolToMolBlock/p1.py", line 7,
in MolBlock2
print (Chem.MolToMolBlock(m2))
RuntimeError: Invariant Violation
no eligible neighbors for chiral center
Violation occurred on line 209 in file
Code/GraphMol/FileParsers/MolFileStereochem.cpp
Failed Expression: nbrScores.size()
RDKIT: 2021.03.4
BOOST: 1_74




Greg Landrum  於 2023年2月22日週三 上午7:14寫道:

> Hi Ling,
>
> I can't reproduce this problem on windows using the most recent version of
> the RDKit.
> Which version of the RDKit are you using and how did you install it?
>
> Please also share exactly what you see for an error message.
>
> -greg
>
>
> On Tue, Feb 21, 2023 at 7:03 AM Ling Chan  wrote:
>
>> Dear colleagues,
>>
>> Don't know if this is a bug, or if my input molecule is not good. I
>> suspect that it is the former.
>>
>> If you run the following on the file "full.sdf", it will crash at the
>> MolToMolBlock line.
>>
>> for m1 in Chem.SDMolSupplier(inputsdf, removeHs=False):
>> m2=Chem.RemoveHs(m1)
>> print (Chem.MolToMolBlock(m2))
>>
>> You can confirm that the problem is due to the stereo definition of the
>> double bond, since if you edit the bond line " 4 5 2 3" to " 4 5 2 0" it
>> will not crash.
>>
>> I tried to simplify the situation by boiling the molecule down to
>> "simple.sdf". Unfortunately it does not crash any more.
>>
>> Thanks.
>>
>> Ling
>>
>>
>>
>> ___
>> 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] Inconsistent GETAWAY descriptors

2023-02-22 Thread J Sousa
Hi Greg,

Thanks for looking at this.

I'm using rdkit '2022.09.4' in
Linux 5.4.0-139-generic #156-Ubuntu SMP Fri Jan 20 17:27:18 UTC 2023 x86_64
x86_64 x86_64 GNU/Linux

A similar behavior occurs with rdkit '2019.09.3' in
Linux 3.10.0-957.el7.x86_64 #1 SMP Thu Nov 8 23:39:32 UTC 2018 x86_64
x86_64 x86_64 GNU/Linux
(but descriptors with inconsistent values are 173 and 174)

With rdkit '2022.09.4' in Windows 10 Pro Version 10.0.19043 Build 19043 I
get always the same values, but descriptors 123 and 124 are 'nan' and
several values are significantly different from those obtained in Linux.

Joao

Greg Landrum  escreveu no dia quarta, 22/02/2023
à(s) 15:12:

> Hi Joao,
>
> I can't reproduce that behavior on Windows using the most recent
> conda-forge version of the RDKit: I always get the same values for the
> first few GETAWAY descriptors and  numbers 245 and 246.
>
> Which operating system/RDKit version are you using?
>
> -greg
>
>
> -greg
>
> On Fri, Feb 17, 2023 at 9:45 PM J Sousa  wrote:
>
>> Hi,
>> I'm getting different results almost every time I run the script below.
>> Sometimes the descriptors in positions 245 and 246 get different very high
>> values.
>> The input.sdf file goes attached.
>>
>> import rdkit
>> from rdkit import Chem
>> from rdkit.Chem import Descriptors, rdMolDescriptors
>> suppl = Chem.SDMolSupplier('input.sdf', removeHs = False)
>> foutput = open("output.txt", "w")
>> for mol in suppl:
>>  descriptorsGETAWAY=rdMolDescriptors.CalcGETAWAY(mol)
>>  for item in descriptorsGETAWAY:
>>  foutput.write("%s\n" % item)
>> foutput.close()
>>
>>
>> What is wrong?
>> Thanks,
>> Joao Sousa
>> ___
>> 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] MolToMolBlock problem

2023-02-22 Thread Greg Landrum
Hi Ling,

I can't reproduce this problem on windows using the most recent version of
the RDKit.
Which version of the RDKit are you using and how did you install it?

Please also share exactly what you see for an error message.

-greg


On Tue, Feb 21, 2023 at 7:03 AM Ling Chan  wrote:

> Dear colleagues,
>
> Don't know if this is a bug, or if my input molecule is not good. I
> suspect that it is the former.
>
> If you run the following on the file "full.sdf", it will crash at the
> MolToMolBlock line.
>
> for m1 in Chem.SDMolSupplier(inputsdf, removeHs=False):
> m2=Chem.RemoveHs(m1)
> print (Chem.MolToMolBlock(m2))
>
> You can confirm that the problem is due to the stereo definition of the
> double bond, since if you edit the bond line " 4 5 2 3" to " 4 5 2 0" it
> will not crash.
>
> I tried to simplify the situation by boiling the molecule down to
> "simple.sdf". Unfortunately it does not crash any more.
>
> Thanks.
>
> Ling
>
>
>
> ___
> 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] Inconsistent GETAWAY descriptors

2023-02-22 Thread Greg Landrum
Hi Joao,

I can't reproduce that behavior on Windows using the most recent
conda-forge version of the RDKit: I always get the same values for the
first few GETAWAY descriptors and  numbers 245 and 246.

Which operating system/RDKit version are you using?

-greg


-greg

On Fri, Feb 17, 2023 at 9:45 PM J Sousa  wrote:

> Hi,
> I'm getting different results almost every time I run the script below.
> Sometimes the descriptors in positions 245 and 246 get different very high
> values.
> The input.sdf file goes attached.
>
> import rdkit
> from rdkit import Chem
> from rdkit.Chem import Descriptors, rdMolDescriptors
> suppl = Chem.SDMolSupplier('input.sdf', removeHs = False)
> foutput = open("output.txt", "w")
> for mol in suppl:
>  descriptorsGETAWAY=rdMolDescriptors.CalcGETAWAY(mol)
>  for item in descriptorsGETAWAY:
>  foutput.write("%s\n" % item)
> foutput.close()
>
>
> What is wrong?
> Thanks,
> Joao Sousa
> ___
> 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