Hi Mario,
What exactly do you mean by 'edge matrix'? Are you sure you provided a
correct example? If you want to get an adjacency matrix of a molecular
graph you can iterate over bonds to get it:
from rdkit.Chem import MolFromSmiles
import numpy as np
m = MolFromSmiles('CC(C)CC')
n = m.GetNumAtoms()
E = np.zeros((n, n))
for b in m.GetBonds():
i = b.GetBeginAtomIdx()
j = b.GetEndAtomIdx()
E[[i,j], [j,i]] = 1
Hope this helps,
Marta SD
2018-01-17 16:31 GMT+01:00 Mario Lovrić <mario.lovri...@gmail.com>:
> Dear all,
>
> Does any one have an idea how to get an edge matrix (graph theory) out of
> Rdkit, I digged deep but didnt find anything.
>
> F.example for:
>
> 'CC(C)CC'
>
>
> it would be:
>
> array([[0, 1, 1, 0],
> [1, 0, 1, 0],
> [1, 1, 0, 1],
> [0, 0, 1, 0]])
>
> Thanks.
>
>
> --
> Mario Lovrić
>
> ------------------------------------------------------------
> ------------------
> 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