Hi,

There is PathToSubmol() although it takes the list of bonds. If you have
atom indices:

bonds = []
> atommap = {}

for i,j in combinations(atom_path, 2):
>      b = ParentMol.GetBondBetweenAtoms(i,j)
>      if b:
>            bonds.append(b.GetIdx())

NewMol = Chem.PathToSubmol(ParentMol, bonds, atomMap=atommap)



atommap is a dictionary populated with atom indicies mapping from ParentMol
to the new one.


----
Pozdrawiam,  |  Best regards,
Maciek Wójcikowski
[email protected]

2016-11-01 11:00 GMT+01:00 Juuso Lehtivarjo <[email protected]>:

> Hi All,
>
> Is there a python function (or any simple way whatsoever) to create a
> substructure mol object from another one based on the given atom
> indices? In C++ this could apparently be done with
> getMolFragsWithQuery, but that does not seem to be much used in python
> wrappers...
>
> Best,
>    Juuso
>
> ------------------------------------------------------------
> ------------------
> Developer Access Program for Intel Xeon Phi Processors
> Access to Intel Xeon Phi processor-based developer platforms.
> With one year of Intel Parallel Studio XE.
> Training and support from Colfax.
> Order your platform today. http://sdm.link/xeonphi
> _______________________________________________
> Rdkit-discuss mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>
------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
Rdkit-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to