Dear all,

Working in an example I realized that there are at least two ways of
computing morgan fingerprints for a molecule using rdkit. But using the
exact same properties in both ways I get different vectors. Am I missing
something?

First approach:

    info = {}
    mol = Chem.MolFromSmiles('C/C1=C\\C[C@H]([C+](C)C)CC/C(C)=C/CC1')
    fp = AllChem.GetMorganFingerprintAsBitVect(mol, useChirality=True,
radius=2, nBits = 124, bitInfo=info)
    vector = np.array(fp)
    vector
    array([0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0,
           0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0,
           0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0,
           0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,
           0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0,
           0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1])

Second approach:

    morgan_fp_gen =
rdFingerprintGenerator.GetMorganGenerator(includeChirality=True, radius=2,
fpSize=124)
    mol = Chem.MolFromSmiles('C/C1=C\\C[C@H]([C+](C)C)CC/C(C)=C/CC1')
    fp = morgan_fp_gen.GetFingerprint(mol)
    vector = np.array(fp)
    vector
    array([0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
           0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0,
           1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0,
           0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
           1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1,
           1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0])

Which are clearly different, even using chirality in both cases.

Besides,  is there a way to get the bitInfo from a bit vector using the
second approach?. This means if there is a way to get the bitInfo
dictionary from a bit vector created using a generator as in the second
approach. Cause as far as I know what you can get is the info corresponding
to 1 in the vector using fp.GetOnBits() but that does not include the atom
position

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

Reply via email to