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
>>> [email protected]
>>> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>>>
>>
___
Rdkit-discuss mailing list
[email protected]
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
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>>
> ___
> Rdkit-discuss mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>
___
Rdkit-discuss mailing list
[email protected]
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
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>>
>
___
Rdkit-discuss mailing list
[email protected]
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
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>
___
Rdkit-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss