Re: [Rdkit-discuss] reading BEGIN COLLECTION - END COLLECTION blocks in SDF

2018-07-16 Thread Greg Landrum
Hi Kuba,

that's correct, the RDKit does not currently support COLLECTION blocks.
In this particular case, the COLLECTION block in question is connected to
extended stereochemistry. I hope that we'll have (at least some) support
for the in the RDKit in the next release.

Best,
-greg

On Mon, Jul 16, 2018 at 5:12 PM Kaminski Jakub (PSI) 
wrote:

> Dear Community,
>
> I have SDF file with following block (pasting relevant fragment below):
>
>   0  0  0  0  0  0  0 V3000
> M  V30 BEGIN CTAB
> M  V30 COUNTS 8 6 0 0 0
> M  V30 BEGIN ATOM
> M  V30 1 Cl 0.0 0.0 0.0 0
> M  V30 2 Cl 0.0 1.5025 0.0 0
> M  V30 3 N -4.758 -0.5008 0.0 0
> M  V30 4 C -3.5998 0.1565 0.0 0
> M  V30 5 C -5.9162 0.1565 0.0 0
> M  V30 6 C -3.5998 1.5025 0.0 0 CFG=2
> M  V30 7 C -5.9162 1.5025 0.0 0
> M  V30 8 N -2.6607 2.4416 0.0 0
> M  V30 END ATOM
> M  V30 BEGIN BOND
> M  V30 1 1 3 4
> M  V30 2 1 3 5
> M  V30 3 1 4 6
> M  V30 4 1 5 7
> M  V30 5 1 6 8 CFG=3
> M  V30 6 1 6 7
> M  V30 END BOND
> M  V30 BEGIN COLLECTION
> M  V30 MDLV30/STERAC1 ATOMS=(1 6)
> M  V30 END COLLECTION
> M  V30 END CTAB
> M  END
>
>
> I can read this information with RDKit using Chem.SDMolSupplier.
>
> When I write the same information to new file with SDWriter I have
> following message:
>
> "skipping block at line 97: BEGIN COLLECTION"
>
>
> and the block "M  V30 BEGIN COLLECTION   …M  V30 END COLLECTION" is
> missing in the new file.
>
> Why is that? Is COLLECTION block not recognised/implemented in RDKit?
>
> I am using RDKit Version: 2017.09.3 on MacOS Sierra
>
> Thanks,
> Kuba
>
>
>
>
>
>
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> ___
> Rdkit-discuss mailing list
> Rdkit-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] Removing and Setting STEREOANY For Double Bonds

2018-07-16 Thread Chris Murphy
Thanks so much for the help. This did the trick for setting single bonds to
squiggly bonds, and setting double bonds to the crossed any stereo worked.

However, what is not seeming to work is setting a double bond to STEREONONE
so I can return it to a normal double bond without any stereo indication.
Is this not supported or is there a different function I can use to clear
the stereochemistry for just this bond?

Thanks again!
-Chris

On Wed, Jul 11, 2018 at 12:42 AM Greg Landrum 
wrote:

> Hi Chris,
>
> I think at least some of what you observed may be due to older bugs that
> have been fixed.
> Here's your example using a recent version of the RDKit:
>
> In [9]: rdkit.rdBase.rdkitVersion
> Out[9]: '2018.03.1'
>
> In [10]: m = Chem.MolFromMolBlock(mb)
>
> In [11]: Chem.MolToSmiles(m)
> Out[11]: 'CNC(C)=CCc1c1'
>
> In [12]: print(Chem.MolToMolBlock(m))
>  SomeID
>  RDKit  3D
>
>  12 12  0  0  0  0  0  0  0  0999 V2000
> 1.42900.20630. C   0  0  0  0  0  0  0  0  0  0  0  0
> 0.7145   -0.20620. C   0  0  0  0  0  0  0  0  0  0  0  0
> 0.0.20630. C   0  0  0  0  0  0  0  0  0  0  0  0
> 1.42901.03130. N   0  0  0  0  0  0  0  0  0  0  0  0
> 2.1434   -0.20620. C   0  0  0  0  0  0  0  0  0  0  0  0
> 2.14341.44380. C   0  0  0  0  0  0  0  0  0  0  0  0
>-0.7143   -0.20620. C   0  0  0  0  0  0  0  0  0  0  0  0
>-1.42880.20620. C   0  0  0  0  0  0  0  0  0  0  0  0
>-2.1433   -0.20630. C   0  0  0  0  0  0  0  0  0  0  0  0
>-2.1434   -1.03120. C   0  0  0  0  0  0  0  0  0  0  0  0
>-1.4289   -1.44380. C   0  0  0  0  0  0  0  0  0  0  0  0
>-0.7144   -1.03120. C   0  0  0  0  0  0  0  0  0  0  0  0
>   2  1  2  3
>   2  3  1  0
>   1  5  1  0
>   1  4  1  0
>   4  6  1  0
>   3  7  1  0
>   8  9  1  0
>   9 10  2  0
>  10 11  1  0
>  11 12  2  0
>   7  8  2  0
>  12  7  1  0
> M  END
>
>
> A bit more detail:
> The RDKit "prefers" to mark the unknown stereo directly on the double
> bond, so it writes mol files with crossed double bonds. It should, however,
> do the right thing with squiggly bonds that are attached to double bonds
> (as your example shows).
>
> I would also expect setting double bond stereo to STEREOANY to work from
> Python:
>
> In [17]: m = Chem.MolFromSmiles('C/C=C/C')
>
> In [18]: Chem.MolToSmiles(m)
> Out[18]: 'C/C=C/C'
>
> In [19]: m.GetBondWithIdx(1).SetStereo(Chem.BondStereo.STEREOANY)
>
> In [20]: Chem.MolToSmiles(m)
> Out[20]: 'CC=CC'
>
>
> Though if you want to use the adjacent squiggle bonds, you need to
> re-perceive aromaticity:
>
> In [28]: m = Chem.MolFromSmiles('C/C=C/C')
>
> In [29]: m.GetBondWithIdx(0).SetBondDir(Chem.BondDir.UNKNOWN)
>
> In [30]: Chem.AssignStereochemistry(m,cleanIt=True,force=True)
>
> In [31]: Chem.MolToSmiles(m)
> Out[31]: 'CC=CC'
>
>
> I hope this helps,
> -greg
>
>
> On Tue, Jul 10, 2018 at 11:51 PM Chris Murphy <
> chris.mur...@schrodinger.com> wrote:
>
>> Hi,
>>
>> I want to manipulate the "any" stereochemistry representation of double
>> bonds. I am trying to set the stereo property for a double bond as
>> STEREOANY so it appears as a crossed bond, but I know that the SetStereo
>> method does not actually work in Python (not sure if it's just python
>> actually?). Alternatively, I also want to be able to remove the STEREOANY
>> from a double bond and set one of the adjacent single bonds as STEREOANY so
>> it appears as a wiggly bond. Is there a way to manipulate this, directly or
>> indirectly, in Python?
>>
>> Additionally, it seems that when the following sdf is read into a Mol
>> object, with a wiggly bond present, it automatically converts the double
>> bond to a crossed bond so there is both a wiggly single bond and a crossed
>> double bond when the Mol is written back out to MolBlock. Is this because
>> the crossed bond is the preferred standard for this situation?
>> =
>>
>>   SomeID
>>
>>  12 12  0  0  0  0999 V2000
>> 1.42900.20630. C   0  0  0  0  0  0  0  0  0  0  0  0
>> 0.7145   -0.20620. C   0  0  0  0  0  0  0  0  0  0  0  0
>> 0.0.20630. C   0  0  0  0  0  0  0  0  0  0  0  0
>> 1.42901.03130. N   0  0  0  0  0  0  0  0  0  0  0  0
>> 2.1434   -0.20620. C   0  0  0  0  0  0  0  0  0  0  0  0
>> 2.14341.44380. C   0  0  0  0  0  0  0  0  0  0  0  0
>>-0.7143   -0.20620. C   0  0  0  0  0  0  0  0  0  0  0  0
>>-1.42880.20620. C   0  0  0  0  0  0  0  0  0  0  0  0
>>-2.1433   -0.20630. C   0  0  0  0  0  0  0  0  0  0  0  0
>>-2.1434   -1.03120. C   0  0  0  0  0  0  0  0  0  0  0  0
>>-1.4289   -1.44380. C   0  0  0  0  0  0  0  0  0  0  0  0
>>-0.7144   -1.03120. C   0  0  0  0  0  0  0  0  0  0  0  0
>>   2  1  2  0  0  0  0
>>   2  3  1  0  0  0  0
>>   1  

[Rdkit-discuss] reading BEGIN COLLECTION - END COLLECTION blocks in SDF

2018-07-16 Thread Kaminski Jakub (PSI)
Dear Community,

I have SDF file with following block (pasting relevant fragment below):

  0  0  0  0  0  0  0 V3000
M  V30 BEGIN CTAB
M  V30 COUNTS 8 6 0 0 0
M  V30 BEGIN ATOM
M  V30 1 Cl 0.0 0.0 0.0 0
M  V30 2 Cl 0.0 1.5025 0.0 0
M  V30 3 N -4.758 -0.5008 0.0 0
M  V30 4 C -3.5998 0.1565 0.0 0
M  V30 5 C -5.9162 0.1565 0.0 0
M  V30 6 C -3.5998 1.5025 0.0 0 CFG=2
M  V30 7 C -5.9162 1.5025 0.0 0
M  V30 8 N -2.6607 2.4416 0.0 0
M  V30 END ATOM
M  V30 BEGIN BOND
M  V30 1 1 3 4
M  V30 2 1 3 5
M  V30 3 1 4 6
M  V30 4 1 5 7
M  V30 5 1 6 8 CFG=3
M  V30 6 1 6 7
M  V30 END BOND
M  V30 BEGIN COLLECTION
M  V30 MDLV30/STERAC1 ATOMS=(1 6)
M  V30 END COLLECTION
M  V30 END CTAB
M  END


I can read this information with RDKit using Chem.SDMolSupplier.

When I write the same information to new file with SDWriter I have following 
message:

"skipping block at line 97: BEGIN COLLECTION"


and the block "M  V30 BEGIN COLLECTION   …M  V30 END COLLECTION" is missing 
in the new file.

Why is that? Is COLLECTION block not recognised/implemented in RDKit? 

I am using RDKit Version: 2017.09.3 on MacOS Sierra

Thanks,
Kuba





--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss