Re: [Rdkit-discuss] V2000 to V3000 enhanced stereo question

2024-01-31 Thread Tomkinson, Nicholas
Thanks for that Greg.

Nick


From: Greg Landrum 
Sent: Wednesday, January 31, 2024 2:48 PM
To: Tomkinson, Nicholas 
Cc: rdkit-discuss@lists.sourceforge.net
Subject: Re: [Rdkit-discuss] V2000 to V3000 enhanced stereo question

Thanks for that example Nick.
We can't handle this automatically since there are multiple interpretations of 
what the chiral flag means, but I think some relatively straightforward 
post-processing can do what you're looking for.
https://gist.github.com/greglandrum/f85097a8489ba4a5825b0981b1fd2408<https://gist.github.com/greglandrum/f85097a8489ba4a5825b0981b1fd2408>

If people think it's useful, this is something which we could add to the RDKit 
itself.

-greg



On Wed, Jan 31, 2024 at 2:53 PM Tomkinson, Nicholas 
mailto:nick.tomkin...@astrazeneca.com>> wrote:
Hi Greg – sure. So -

[cid:image001.png@01DA5458.9B7BD490]

If I have a V2000 with or without the chiral flag:


  ACCLDraw01312413482D

  8  8  0  0  1  0  0  0  0  0999 V2000
4.6334   -6.59690. C   0  0  0  0  0  0  0  0  0  0  0  0
5.6563   -6.00640. C   0  0  2  0  0  0  0  0  0  0  0  0
6.6791   -6.59690. N   0  0  3  0  0  0  0  0  0  0  0  0
6.6791   -7.77810. C   0  0  0  0  0  0  0  0  0  0  0  0
5.6563   -8.36860. C   0  0  0  0  0  0  0  0  0  0  0  0
4.6334   -7.77810. C   0  0  1  0  0  0  0  0  0  0  0  0
5.6563   -4.82570. C   0  0  0  0  0  0  0  0  0  0  0  0
3.6109   -8.36840. C   0  0  0  0  0  0  0  0  0  0  0  0
  1  2  1  0  0  0  0
  3  2  1  0  0  0  0
  4  3  1  0  0  0  0
  5  4  1  0  0  0  0
  1  6  1  0  0  0  0
  6  5  1  0  0  0  0
  2  7  1  1  0  0  0
  6  8  1  1  0  0  0
M  END


  ACCLDraw01312413492D

  8  8  0  0  0  0  0  0  0  0999 V2000
4.6334   -6.59690. C   0  0  0  0  0  0  0  0  0  0  0  0
5.6563   -6.00640. C   0  0  2  0  0  0  0  0  0  0  0  0
6.6791   -6.59690. N   0  0  3  0  0  0  0  0  0  0  0  0
6.6791   -7.77810. C   0  0  0  0  0  0  0  0  0  0  0  0
5.6563   -8.36860. C   0  0  0  0  0  0  0  0  0  0  0  0
4.6334   -7.77810. C   0  0  1  0  0  0  0  0  0  0  0  0
5.6563   -4.82570. C   0  0  0  0  0  0  0  0  0  0  0  0
3.6109   -8.36840. C   0  0  0  0  0  0  0  0  0  0  0  0
  1  2  1  0  0  0  0
  3  2  1  0  0  0  0
  4  3  1  0  0  0  0
  5  4  1  0  0  0  0
  1  6  1  0  0  0  0
  6  5  1  0  0  0  0
  2  7  1  1  0  0  0
  6  8  1  1  0  0  0
M  END


I’d expect the enhanced collections to be output in V3000 format. In this case 
the chiral flag is also set but that’s not a biggy for me. (I wish the chiral 
flag didn’t exist in V3000.)


  ACCLDraw01312413472D

  0  0  0 0  0999 V3000
M  V30 BEGIN CTAB
M  V30 COUNTS 8 8 0 0 1
M  V30 BEGIN ATOM
M  V30 1 C 4.6334 -6.5969 0 0
M  V30 2 C 5.6563 -6.0064 0 0 CFG=2
M  V30 3 N 6.6791 -6.5969 0 0 CFG=3
M  V30 4 C 6.6791 -7.7781 0 0
M  V30 5 C 5.6563 -8.3686 0 0
M  V30 6 C 4.6334 -7.7781 0 0 CFG=1
M  V30 7 C 5.6563 -4.8257 0 0
M  V30 8 C 3.6109 -8.3684 0 0
M  V30 END ATOM
M  V30 BEGIN BOND
M  V30 1 1 1 2
M  V30 2 1 3 2
M  V30 3 1 4 3
M  V30 4 1 5 4
M  V30 5 1 1 6
M  V30 6 1 6 5
M  V30 7 1 2 7 CFG=1
M  V30 8 1 6 8 CFG=1
M  V30 END BOND
M  V30 BEGIN COLLECTION
M  V30 MDLV30/STEABS ATOMS=(2 2 6)
M  V30 END COLLECTION
M  V30 END CTAB
M  END


  ACCLDraw01312413492D

  0  0  0 0  0999 V3000
M  V30 BEGIN CTAB
M  V30 COUNTS 8 8 0 0 0
M  V30 BEGIN ATOM
M  V30 1 C 4.6334 -6.5969 0 0
M  V30 2 C 5.6563 -6.0064 0 0 CFG=2
M  V30 3 N 6.6791 -6.5969 0 0 CFG=3
M  V30 4 C 6.6791 -7.7781 0 0
M  V30 5 C 5.6563 -8.3686 0 0
M  V30 6 C 4.6334 -7.7781 0 0 CFG=1
M  V30 7 C 5.6563 -4.8257 0 0
M  V30 8 C 3.6109 -8.3684 0 0
M  V30 END ATOM
M  V30 BEGIN BOND
M  V30 1 1 1 2
M  V30 2 1 3 2
M  V30 3 1 4 3
M  V30 4 1 5 4
M  V30 5 1 1 6
M  V30 6 1 6 5
M  V30 7 1 2 7 CFG=1
M  V30 8 1 6 8 CFG=1
M  V30 END BOND
M  V30 BEGIN COLLECTION
M  V30 MDLV30/STERAC1 ATOMS=(2 6 2)
M  V30 END COLLECTION
M  V30 END CTAB
M  END

Cheers

Nick



From: Greg Landrum mailto:greg.land...@gmail.com>>
Sent: Wednesday, January 31, 2024 1:45 PM
To: Tomkinson, Nicholas 
mailto:nick.tomkin...@astrazeneca.com>>
Cc: 
rdkit-discuss@lists.sourceforge.net<mailto:rdkit-discuss@lists.sourceforge.net>
Subject: Re: [Rdkit-discuss] V2000 to V3000 enhanced stereo question

Hi Nick,

Can you provide an example of exactly what you would like to have happen?

-greg


On Tue, Jan 30, 2024 at 5:46 PM Tomkinson, Nicholas 
mailto:nick.tomkin...@astrazeneca.com>> wrote:
I am trying to convert a simple V2000 molfile with or without the chiral flag 
into a V3000 molfile but this does not create an enhanced stereo collection in 
the V3000 molfile. This is a requirement for another application that does not 
handle V2000/V3000 mixtures well. Is there anyway of forcing the writing of the 
enhanced collection in this context?

Thanks

Nick

_

Re: [Rdkit-discuss] V2000 to V3000 enhanced stereo question

2024-01-31 Thread Greg Landrum
Thanks for that example Nick.
We can't handle this automatically since there are multiple interpretations
of what the chiral flag means, but I think some relatively straightforward
post-processing can do what you're looking for.
https://gist.github.com/greglandrum/f85097a8489ba4a5825b0981b1fd2408

If people think it's useful, this is something which we could add to the
RDKit itself.

-greg



On Wed, Jan 31, 2024 at 2:53 PM Tomkinson, Nicholas <
nick.tomkin...@astrazeneca.com> wrote:

> Hi Greg – sure. So -
>
>
>
>
>
> If I have a V2000 with or without the chiral flag:
>
>
>
>
>
>   ACCLDraw01312413482D
>
>
>
>   8  8  0  0  1  0  0  0  0  0999 V2000
>
> 4.6334   -6.59690. C   0  0  0  0  0  0  0  0  0  0  0  0
>
> 5.6563   -6.00640. C   0  0  2  0  0  0  0  0  0  0  0  0
>
> 6.6791   -6.59690. N   0  0  3  0  0  0  0  0  0  0  0  0
>
> 6.6791   -7.77810. C   0  0  0  0  0  0  0  0  0  0  0  0
>
> 5.6563   -8.36860. C   0  0  0  0  0  0  0  0  0  0  0  0
>
> 4.6334   -7.77810. C   0  0  1  0  0  0  0  0  0  0  0  0
>
> 5.6563   -4.82570. C   0  0  0  0  0  0  0  0  0  0  0  0
>
> 3.6109   -8.36840. C   0  0  0  0  0  0  0  0  0  0  0  0
>
>   1  2  1  0  0  0  0
>
>   3  2  1  0  0  0  0
>
>   4  3  1  0  0  0  0
>
>   5  4  1  0  0  0  0
>
>   1  6  1  0  0  0  0
>
>   6  5  1  0  0  0  0
>
>   2  7  1  1  0  0  0
>
>   6  8  1  1  0  0  0
>
> M  END
>
>
>
>
>
>   ACCLDraw01312413492D
>
>
>
>   8  8  0  0  0  0  0  0  0  0999 V2000
>
> 4.6334   -6.59690. C   0  0  0  0  0  0  0  0  0  0  0  0
>
> 5.6563   -6.00640. C   0  0  2  0  0  0  0  0  0  0  0  0
>
> 6.6791   -6.59690. N   0  0  3  0  0  0  0  0  0  0  0  0
>
> 6.6791   -7.77810. C   0  0  0  0  0  0  0  0  0  0  0  0
>
> 5.6563   -8.36860. C   0  0  0  0  0  0  0  0  0  0  0  0
>
> 4.6334   -7.77810. C   0  0  1  0  0  0  0  0  0  0  0  0
>
> 5.6563   -4.82570. C   0  0  0  0  0  0  0  0  0  0  0  0
>
> 3.6109   -8.36840. C   0  0  0  0  0  0  0  0  0  0  0  0
>
>   1  2  1  0  0  0  0
>
>   3  2  1  0  0  0  0
>
>   4  3  1  0  0  0  0
>
>   5  4  1  0  0  0  0
>
>   1  6  1  0  0  0  0
>
>   6  5  1  0  0  0  0
>
>   2  7  1  1  0  0  0
>
>   6  8  1  1  0  0  0
>
> M  END
>
>
>
>
>
> I’d expect the enhanced collections to be output in V3000 format. In this
> case the chiral flag is also set but that’s not a biggy for me. (I wish the
> chiral flag didn’t exist in V3000.)
>
>
>
>
>
>   ACCLDraw01312413472D
>
>
>
>   0  0  0 0  0999 V3000
>
> M  V30 BEGIN CTAB
>
> M  V30 COUNTS 8 8 0 0 1
>
> M  V30 BEGIN ATOM
>
> M  V30 1 C 4.6334 -6.5969 0 0
>
> M  V30 2 C 5.6563 -6.0064 0 0 CFG=2
>
> M  V30 3 N 6.6791 -6.5969 0 0 CFG=3
>
> M  V30 4 C 6.6791 -7.7781 0 0
>
> M  V30 5 C 5.6563 -8.3686 0 0
>
> M  V30 6 C 4.6334 -7.7781 0 0 CFG=1
>
> M  V30 7 C 5.6563 -4.8257 0 0
>
> M  V30 8 C 3.6109 -8.3684 0 0
>
> M  V30 END ATOM
>
> M  V30 BEGIN BOND
>
> M  V30 1 1 1 2
>
> M  V30 2 1 3 2
>
> M  V30 3 1 4 3
>
> M  V30 4 1 5 4
>
> M  V30 5 1 1 6
>
> M  V30 6 1 6 5
>
> M  V30 7 1 2 7 CFG=1
>
> M  V30 8 1 6 8 CFG=1
>
> M  V30 END BOND
>
> M  V30 BEGIN COLLECTION
>
> M  V30 MDLV30/STEABS ATOMS=(2 2 6)
>
> M  V30 END COLLECTION
>
> M  V30 END CTAB
>
> M  END
>
>
>
>
>
>   ACCLDraw01312413492D
>
>
>
>   0  0  0 0  0999 V3000
>
> M  V30 BEGIN CTAB
>
> M  V30 COUNTS 8 8 0 0 0
>
> M  V30 BEGIN ATOM
>
> M  V30 1 C 4.6334 -6.5969 0 0
>
> M  V30 2 C 5.6563 -6.0064 0 0 CFG=2
>
> M  V30 3 N 6.6791 -6.5969 0 0 CFG=3
>
> M  V30 4 C 6.6791 -7.7781 0 0
>
> M  V30 5 C 5.6563 -8.3686 0 0
>
> M  V30 6 C 4.6334 -7.7781 0 0 CFG=1
>
> M  V30 7 C 5.6563 -4.8257 0 0
>
> M  V30 8 C 3.6109 -8.3684 0 0
>
> M  V30 END ATOM
>
> M  V30 BEGIN BOND
>
> M  V30 1 1 1 2
>
> M  V30 2 1 3 2
>
> M  V30 3 1 4 3
>
> M  V30 4 1 5 4
>
> M  V30 5 1 1 6
>
> M  V30 6 1 6 5
>
> M  V30 7 1 2 7 CFG=1
>
> M  V30 8 1 6 8 CFG=1
>
> M  V30 END BOND
>
> M  V30 BEGIN COLLECTION
>
> M  V30 MDLV30/STERAC1 ATOMS=(2 6 2)
>
> M  V30 END COLLECTION
>
> M  V30 END CTAB
>
> M  END
>
>
>
> Cheers
>
>
>
> Nick
>
>
>
>
>
>
>
> *From:* Greg Landrum 
> *Sent:* Wednesday, Janu

Re: [Rdkit-discuss] V2000 to V3000 enhanced stereo question

2024-01-31 Thread Giovanni Tricarico
Hello Nick,
We faced a (seemingly) related problem a while ago. In our case we were trying 
to convert V2000 CTABs to CXSMILES, and we were expecting that the V2000 
chirality flag would translate to an enhanced stereo string in the CXSMILES.
That is not so, by design. See my question, and the answer it got, here: V2000 
chiral flag does not seem to be read by Chem.MolFromMolBlock() * Issue #6062 * 
rdkit/rdkit * GitHub<https://github.com/rdkit/rdkit/issues/6062>

I imagine that the reason why the V2000 to V3000 conversion does not use the 
V2000 chirality flag is conceptually the same, but indeed worth checking.

FYI, the practical solution for our workflow was:

  *   create a function 'chiral_flag_from_molblock' that detects if a CTAB is 
V2000 or V3000; if V2000, reads the flag (by simple text parsing) and returns 
it (0 or 1), if V3000, returns -1
  *   create a function 'CTAB_to_CXSMILES' that calls the above; for V3000, the 
rdkit-generated CXSMILES is (or usually is) already correct; for V2000, if the 
flag is 1, the SMILES is identical to the CXSMILES; if the flag is 0, the 
function loops through all atoms, identifies those that have tetrahedral 
stereochemistry, and uses their indices to put together an '&1' enhanced stereo 
group string, which is then appended to the SMILES (as a V2000 CTAB with 
chirality flag 0 can only represent a racemic mixture where all configurations 
are inverted together, so it only needs one '&' group - of course with all the 
exceptions and issues you can imagine: meso stereoisomers or moieties, etc)

Probably not ideal, but lacking any suggestion or a better 'native' solution, 
that's what we went for, and it seems to have worked so far.
[I'll mention for completeness that we also run a further standardisation 
function on CXSMILES, which takes care of removing the enhanced stereo flags 
from meso moieties].

I hope this helps.

Regards

[cid:image001.png@01DA5433.970407E0]

[cid:image002.png@01DA5433.970407E0]<https://twitter.com/GalapagosGlobal> 
[cid:image003.png@01DA5433.970407E0] <https://www.linkedin.com/company/glpg>  
[cid:image004.png@01DA5433.970407E0] 
<https://www.youtube.com/c/GalapagosGlobal>  
[cid:image005.png@01DA5433.970407E0] <https://www.glpg.com/>
Giovanni Tricarico
Principal Scientist Chemoinformatics

+32 15 6514 30
giovanni.tricar...@glpg.com<mailto:giovanni.tricar...@glpg.com>

Galapagos NV
Generaal De Wittelaan L11 A3
2800 Mechelen, Belgium













From: Tomkinson, Nicholas 
Sent: Tuesday, January 30, 2024 5:28 PM
To: rdkit-discuss@lists.sourceforge.net
Subject: [Rdkit-discuss] V2000 to V3000 enhanced stereo question

Some people who received this message don't often get email from 
nick.tomkin...@astrazeneca.com<mailto:nick.tomkin...@astrazeneca.com>. Learn 
why this is important<https://aka.ms/LearnAboutSenderIdentification>
I am trying to convert a simple V2000 molfile with or without the chiral flag 
into a V3000 molfile but this does not create an enhanced stereo collection in 
the V3000 molfile. This is a requirement for another application that does not 
handle V2000/V3000 mixtures well. Is there anyway of forcing the writing of the 
enhanced collection in this context?

Thanks

Nick


AstraZeneca UK Limited is a company incorporated in England and Wales with 
registered number:03674842 and its registered office at 1 Francis Crick Avenue, 
Cambridge Biomedical Campus, Cambridge, CB2 0AA.
This e-mail and its attachments are intended for the above named recipient only 
and may contain confidential and privileged information. If they have come to 
you in error, you must not copy or show them to anyone; instead, please reply 
to this e-mail, highlighting the error to the sender and then immediately 
delete the message. For information about how AstraZeneca UK Limited and its 
affiliates may process information, personal data and monitor communications, 
please see our privacy notice at 
www.astrazeneca.com<https://www.astrazeneca.com/>
This e-mail and its attachment(s) (if any) may contain confidential and/or 
proprietary information and is intended for its addressee(s) only. Any 
unauthorized use of the information contained herein (including, but not 
limited to, alteration, reproduction, communication, distribution or any other 
form of dissemination) is strictly prohibited. If you are not the intended 
addressee, please notify the originator promptly and delete this e-mail and its 
attachment(s) (if any) subsequently. Neither Galapagos nor any of its 
affiliates shall be liable for direct, special, indirect or consequential 
damages arising from alteration of the contents of this message (by a third 
party) or as a result of a virus being passed on.
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] V2000 to V3000 enhanced stereo question

2024-01-31 Thread Tomkinson, Nicholas
Hi Greg – sure. So -

[cid:image001.png@01DA544C.50E20B90]

If I have a V2000 with or without the chiral flag:


  ACCLDraw01312413482D

  8  8  0  0  1  0  0  0  0  0999 V2000
4.6334   -6.59690. C   0  0  0  0  0  0  0  0  0  0  0  0
5.6563   -6.00640. C   0  0  2  0  0  0  0  0  0  0  0  0
6.6791   -6.59690. N   0  0  3  0  0  0  0  0  0  0  0  0
6.6791   -7.77810. C   0  0  0  0  0  0  0  0  0  0  0  0
5.6563   -8.36860. C   0  0  0  0  0  0  0  0  0  0  0  0
4.6334   -7.77810. C   0  0  1  0  0  0  0  0  0  0  0  0
5.6563   -4.82570. C   0  0  0  0  0  0  0  0  0  0  0  0
3.6109   -8.36840. C   0  0  0  0  0  0  0  0  0  0  0  0
  1  2  1  0  0  0  0
  3  2  1  0  0  0  0
  4  3  1  0  0  0  0
  5  4  1  0  0  0  0
  1  6  1  0  0  0  0
  6  5  1  0  0  0  0
  2  7  1  1  0  0  0
  6  8  1  1  0  0  0
M  END


  ACCLDraw01312413492D

  8  8  0  0  0  0  0  0  0  0999 V2000
4.6334   -6.59690. C   0  0  0  0  0  0  0  0  0  0  0  0
5.6563   -6.00640. C   0  0  2  0  0  0  0  0  0  0  0  0
6.6791   -6.59690. N   0  0  3  0  0  0  0  0  0  0  0  0
6.6791   -7.77810. C   0  0  0  0  0  0  0  0  0  0  0  0
5.6563   -8.36860. C   0  0  0  0  0  0  0  0  0  0  0  0
4.6334   -7.77810. C   0  0  1  0  0  0  0  0  0  0  0  0
5.6563   -4.82570. C   0  0  0  0  0  0  0  0  0  0  0  0
3.6109   -8.36840. C   0  0  0  0  0  0  0  0  0  0  0  0
  1  2  1  0  0  0  0
  3  2  1  0  0  0  0
  4  3  1  0  0  0  0
  5  4  1  0  0  0  0
  1  6  1  0  0  0  0
  6  5  1  0  0  0  0
  2  7  1  1  0  0  0
  6  8  1  1  0  0  0
M  END


I’d expect the enhanced collections to be output in V3000 format. In this case 
the chiral flag is also set but that’s not a biggy for me. (I wish the chiral 
flag didn’t exist in V3000.)


  ACCLDraw01312413472D

  0  0  0 0  0999 V3000
M  V30 BEGIN CTAB
M  V30 COUNTS 8 8 0 0 1
M  V30 BEGIN ATOM
M  V30 1 C 4.6334 -6.5969 0 0
M  V30 2 C 5.6563 -6.0064 0 0 CFG=2
M  V30 3 N 6.6791 -6.5969 0 0 CFG=3
M  V30 4 C 6.6791 -7.7781 0 0
M  V30 5 C 5.6563 -8.3686 0 0
M  V30 6 C 4.6334 -7.7781 0 0 CFG=1
M  V30 7 C 5.6563 -4.8257 0 0
M  V30 8 C 3.6109 -8.3684 0 0
M  V30 END ATOM
M  V30 BEGIN BOND
M  V30 1 1 1 2
M  V30 2 1 3 2
M  V30 3 1 4 3
M  V30 4 1 5 4
M  V30 5 1 1 6
M  V30 6 1 6 5
M  V30 7 1 2 7 CFG=1
M  V30 8 1 6 8 CFG=1
M  V30 END BOND
M  V30 BEGIN COLLECTION
M  V30 MDLV30/STEABS ATOMS=(2 2 6)
M  V30 END COLLECTION
M  V30 END CTAB
M  END


  ACCLDraw01312413492D

  0  0  0 0  0999 V3000
M  V30 BEGIN CTAB
M  V30 COUNTS 8 8 0 0 0
M  V30 BEGIN ATOM
M  V30 1 C 4.6334 -6.5969 0 0
M  V30 2 C 5.6563 -6.0064 0 0 CFG=2
M  V30 3 N 6.6791 -6.5969 0 0 CFG=3
M  V30 4 C 6.6791 -7.7781 0 0
M  V30 5 C 5.6563 -8.3686 0 0
M  V30 6 C 4.6334 -7.7781 0 0 CFG=1
M  V30 7 C 5.6563 -4.8257 0 0
M  V30 8 C 3.6109 -8.3684 0 0
M  V30 END ATOM
M  V30 BEGIN BOND
M  V30 1 1 1 2
M  V30 2 1 3 2
M  V30 3 1 4 3
M  V30 4 1 5 4
M  V30 5 1 1 6
M  V30 6 1 6 5
M  V30 7 1 2 7 CFG=1
M  V30 8 1 6 8 CFG=1
M  V30 END BOND
M  V30 BEGIN COLLECTION
M  V30 MDLV30/STERAC1 ATOMS=(2 6 2)
M  V30 END COLLECTION
M  V30 END CTAB
M  END

Cheers

Nick



From: Greg Landrum 
Sent: Wednesday, January 31, 2024 1:45 PM
To: Tomkinson, Nicholas 
Cc: rdkit-discuss@lists.sourceforge.net
Subject: Re: [Rdkit-discuss] V2000 to V3000 enhanced stereo question

Hi Nick,

Can you provide an example of exactly what you would like to have happen?

-greg


On Tue, Jan 30, 2024 at 5:46 PM Tomkinson, Nicholas 
mailto:nick.tomkin...@astrazeneca.com>> wrote:
I am trying to convert a simple V2000 molfile with or without the chiral flag 
into a V3000 molfile but this does not create an enhanced stereo collection in 
the V3000 molfile. This is a requirement for another application that does not 
handle V2000/V3000 mixtures well. Is there anyway of forcing the writing of the 
enhanced collection in this context?

Thanks

Nick



AstraZeneca UK Limited is a company incorporated in England and Wales with 
registered number:03674842 and its registered office at 1 Francis Crick Avenue, 
Cambridge Biomedical Campus, Cambridge, CB2 0AA.

This e-mail and its attachments are intended for the above named recipient only 
and may contain confidential and privileged information. If they have come to 
you in error, you must not copy or show them to anyone; instead, please reply 
to this e-mail, highlighting the error to the sender and then immediately 
delete the message. For information about how AstraZeneca UK Limited and its 
affiliates may process information, personal data and monitor communications, 
please see our privacy notice at 
www.astrazeneca.com<https://www.astrazeneca.com>
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net<mailto:Rdkit-discuss@lists.sourcef

Re: [Rdkit-discuss] V2000 to V3000 enhanced stereo question

2024-01-31 Thread Greg Landrum
Hi Nick,

Can you provide an example of exactly what you would like to have happen?

-greg


On Tue, Jan 30, 2024 at 5:46 PM Tomkinson, Nicholas <
nick.tomkin...@astrazeneca.com> wrote:

> I am trying to convert a simple V2000 molfile with or without the chiral
> flag into a V3000 molfile but this does not create an enhanced stereo
> collection in the V3000 molfile. This is a requirement for another
> application that does not handle V2000/V3000 mixtures well. Is there anyway
> of forcing the writing of the enhanced collection in this context?
>
>
>
> Thanks
>
>
>
> Nick
>
>
> --
>
> AstraZeneca UK Limited is a company incorporated in England and Wales with
> registered number:03674842 and its registered office at 1 Francis Crick
> Avenue, Cambridge Biomedical Campus, Cambridge, CB2 0AA.
>
> This e-mail and its attachments are intended for the above named recipient
> only and may contain confidential and privileged information. If they have
> come to you in error, you must not copy or show them to anyone; instead,
> please reply to this e-mail, highlighting the error to the sender and then
> immediately delete the message. For information about how AstraZeneca UK
> Limited and its affiliates may process information, personal data and
> monitor communications, please see our privacy notice at
> www.astrazeneca.com
> ___
> 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] V2000 to V3000 enhanced stereo question

2024-01-31 Thread Tomkinson, Nicholas
Thanks Tricarico - I was afraid this might be the answer, but thanks for your 
suggestion. I'm not entirely sure I understand how adding an enhanced stereo 
collection reflecting the status of the chiral flag when going from V2000 to 
V3000 is a problem; it would be good to see some examples. I know the chiral 
flag is a nightmare in when reading V3000 but when reading V2000 if it's not 
set correctly then the file is broken and setting the enhanced collection 
doesn't make it more broken. It would be nice if creating an enhanced 
collection from the chiral flag (when reading V2000 only)  was available as an 
option.

Cheers

Nick


From: Giovanni Tricarico 
Sent: Wednesday, January 31, 2024 9:55 AM
To: Tomkinson, Nicholas ; 
rdkit-discuss@lists.sourceforge.net
Subject: RE: V2000 to V3000 enhanced stereo question

Hello Nick,
We faced a (seemingly) related problem a while ago. In our case we were trying 
to convert V2000 CTABs to CXSMILES, and we were expecting that the V2000 
chirality flag would translate to an enhanced stereo string in the CXSMILES.
That is not so, by design. See my question, and the answer it got, here: V2000 
chiral flag does not seem to be read by Chem.MolFromMolBlock() * Issue #6062 * 
rdkit/rdkit * GitHub<https://github.com/rdkit/rdkit/issues/6062>

I imagine that the reason why the V2000 to V3000 conversion does not use the 
V2000 chirality flag is conceptually the same, but indeed worth checking.

FYI, the practical solution for our workflow was:

  *   create a function 'chiral_flag_from_molblock' that detects if a CTAB is 
V2000 or V3000; if V2000, reads the flag (by simple text parsing) and returns 
it (0 or 1), if V3000, returns -1
  *   create a function 'CTAB_to_CXSMILES' that calls the above; for V3000, the 
rdkit-generated CXSMILES is (or usually is) already correct; for V2000, if the 
flag is 1, the SMILES is identical to the CXSMILES; if the flag is 0, the 
function loops through all atoms, identifies those that have tetrahedral 
stereochemistry, and uses their indices to put together an '&1' enhanced stereo 
group string, which is then appended to the SMILES (as a V2000 CTAB with 
chirality flag 0 can only represent a racemic mixture where all configurations 
are inverted together, so it only needs one '&' group - of course with all the 
exceptions and issues you can imagine: meso stereoisomers or moieties, etc)

Probably not ideal, but lacking any suggestion or a better 'native' solution, 
that's what we went for, and it seems to have worked so far.
[I'll mention for completeness that we also run a further standardisation 
function on CXSMILES, which takes care of removing the enhanced stereo flags 
from meso moieties].

I hope this helps.

Regards

[cid:image001.png@01DA542E.D3A90830]

[cid:image002.png@01DA542E.D3A90830]<https://twitter.com/GalapagosGlobal> 
[cid:image003.png@01DA542E.D3A90830] <https://www.linkedin.com/company/glpg>  
[cid:image004.png@01DA542E.D3A90830] 
<https://www.youtube.com/c/GalapagosGlobal>  
[cid:image005.png@01DA542E.D3A90830] <https://www.glpg.com/>
Giovanni Tricarico
Principal Scientist Chemoinformatics
+32 15 6514 30
giovanni.tricar...@glpg.com<mailto:giovanni.tricar...@glpg.com>
Galapagos NV
Generaal De Wittelaan L11 A3
2800 Mechelen, Belgium













From: Tomkinson, Nicholas 
mailto:nick.tomkin...@astrazeneca.com>>
Sent: Tuesday, January 30, 2024 5:28 PM
To: 
rdkit-discuss@lists.sourceforge.net<mailto:rdkit-discuss@lists.sourceforge.net>
Subject: [Rdkit-discuss] V2000 to V3000 enhanced stereo question

Some people who received this message don't often get email from 
nick.tomkin...@astrazeneca.com<mailto:nick.tomkin...@astrazeneca.com>. Learn 
why this is important<https://aka.ms/LearnAboutSenderIdentification>
I am trying to convert a simple V2000 molfile with or without the chiral flag 
into a V3000 molfile but this does not create an enhanced stereo collection in 
the V3000 molfile. This is a requirement for another application that does not 
handle V2000/V3000 mixtures well. Is there anyway of forcing the writing of the 
enhanced collection in this context?

Thanks

Nick


AstraZeneca UK Limited is a company incorporated in England and Wales with 
registered number:03674842 and its registered office at 1 Francis Crick Avenue, 
Cambridge Biomedical Campus, Cambridge, CB2 0AA.
This e-mail and its attachments are intended for the above named recipient only 
and may contain confidential and privileged information. If they have come to 
you in error, you must not copy or show them to anyone; instead, please reply 
to this e-mail, highlighting the error to the sender and then immediately 
delete the message. For information about how AstraZeneca UK Limited and its 
affiliates may process information, personal data and monitor communications, 
please see our privacy notice at 
www.astrazeneca.com<https://www.astrazeneca.co

[Rdkit-discuss] V2000 to V3000 enhanced stereo question

2024-01-30 Thread Tomkinson, Nicholas
I am trying to convert a simple V2000 molfile with or without the chiral flag 
into a V3000 molfile but this does not create an enhanced stereo collection in 
the V3000 molfile. This is a requirement for another application that does not 
handle V2000/V3000 mixtures well. Is there anyway of forcing the writing of the 
enhanced collection in this context?

Thanks

Nick



AstraZeneca UK Limited is a company incorporated in England and Wales with 
registered number:03674842 and its registered office at 1 Francis Crick Avenue, 
Cambridge Biomedical Campus, Cambridge, CB2 0AA.

This e-mail and its attachments are intended for the above named recipient only 
and may contain confidential and privileged information. If they have come to 
you in error, you must not copy or show them to anyone; instead, please reply 
to this e-mail, highlighting the error to the sender and then immediately 
delete the message. For information about how AstraZeneca UK Limited and its 
affiliates may process information, personal data and monitor communications, 
please see our privacy notice at 
www.astrazeneca.com
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss