Re: [Rdkit-discuss] Strange behaviour for GetSubstructMatches with dative bonds

2024-03-20 Thread Greg Landrum
For what it's worth, this one works too:
m.GetSubstructMatches(Chem.MolFromSmarts('P1->[Zr+3]<-C1'))

It looks like a problem in the way ring closure bonds are being handled in
the SMARTS parser.
Jan: would you mind creating an issue for this in github?

-greg


On Wed, Mar 20, 2024 at 3:30 PM Jan Halborg Jensen 
wrote:

> The following finds no matches:
>
> m = Chem.MolFromSmiles('C1P->[Zr+3]<-1')
> m.GetSubstructMatches(Chem.MolFromSmarts('C1P->[Zr+3]<-1’))
>
> But all these work:
>
> m.GetSubstructMatches(Chem.MolFromSmiles('C1P->[Zr+3]<-1’))
>
> m.GetSubstructMatches(Chem.MolFromSmarts('[*]->[Zr+3]’))
>
> m = Chem.MolFromSmiles('C1P-[Zr+3]-1')
> m.GetSubstructMatches(Chem.MolFromSmarts('C1P-[Zr+3]-1’))
>
>
> Is this a bug, or is there something I’m missing with regard to the first
> case?
>
> Best regards, Jan
> ___
> 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] Strange behaviour for GetSubstructMatches with dative bonds

2024-03-20 Thread Jan Halborg Jensen
The following finds no matches:

m = Chem.MolFromSmiles('C1P->[Zr+3]<-1')
m.GetSubstructMatches(Chem.MolFromSmarts('C1P->[Zr+3]<-1’))

But all these work:

m.GetSubstructMatches(Chem.MolFromSmiles('C1P->[Zr+3]<-1’))

m.GetSubstructMatches(Chem.MolFromSmarts('[*]->[Zr+3]’))

m = Chem.MolFromSmiles('C1P-[Zr+3]-1')
m.GetSubstructMatches(Chem.MolFromSmarts('C1P-[Zr+3]-1’))


Is this a bug, or is there something I’m missing with regard to the first case?

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