Skip to content

Latest commit

 

History

History
34 lines (24 loc) · 952 Bytes

README.md

File metadata and controls

34 lines (24 loc) · 952 Bytes

Molecules and CGR's fingerprints

This project now is the part of chython.

Library provides transformers of molecules and CGR's into features.

  • Pure python code
  • Sklearn like API. Pipelines supported.
  • Linear fingerprints
  • Morgan fingerprints
  • Linear features lists
  • Morgan features lists

Install

pip install StructureFingerprint

Example

import numpy as np
from CGRtools import smiles
from StructureFingerprint import LinearFingerprint, MorganFingerprint

lfp = LinearFingerprint()  # Sklearn-like transformer
mol = smiles('CN(C)C=O')

print(lfp.transform([mol]))  # array. Can be used in sklearn estimators
print(lfp.transform_bitset([mol]))  # active bits indexes

print(set(np.where(lfp.transform([mol])==1)[1]) == set(lfp.transform_bitset([mol])[0]))

print(lfp.transform_hashes([mol]))  # hashes of fragments