Skip to content

Different fingerprints results from PubChemFingerprints.py and PubChemPy module. #24

Description

@jslee-hits

When I tested a molecule(aspirin) to get fingerprints by using PubChemFingerprints.py and pubchempy module, I have got a problem.

There are some differences between two FP results.

I have attached my test code which consists of PubChemFingerprints.py + my def to calculate pubchempy FP.


# ------------------------------------

def pubchem_fp(mol):
   import pubchempy as pcp

   smi = Chem.MolToSmiles(mol)
   pubchem_compound = pcp.get_compounds(smi, "smiles")[0]
   feature = [int(bit) for bit in pubchem_compound.cactvs_fingerprint]

   return feature

if __name__ == "__main__":
   SMILES = "CC(=O)OC1=CC=CC=C1C(=O)O"
   mol = Chem.MolFromSmiles(SMILES)
   mol2 = Chem.AddHs(mol)
   result = calcPubChemFingerAll(mol2)

   pcp_result= pubchem_fp(mol2)

   print(result[:15])
   print(pcp_result[:15])

# ------------------------------------

Results:
[1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0]
[1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0]

Results of index 10, 11 are different.

Can you help me?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions