Skip to content

Featurize

Class to convert SMILES to Morgan fingerprints

FeaturizeResult(items, skipped=dict())

Dataclass holding the results of a featurization pass.

items

Dictionary of compound id as key and their Morgan fingerprint as value

n_compounds

Total compounds seen (featurized + skipped).

skipped = field(default_factory=dict)

Dictionary of compound id as key and the reason for skipping as value.

MorganFeaturizer(radius=2, fp_size=2048)

Class to convert SMILES to Morgan fingerprints.

PARAMETER DESCRIPTION
radius

Morgan radius to use . Default is 2 which is ECFP4.

TYPE: int DEFAULT: 2

fp_size

Fingerprint length in bits.

TYPE: int DEFAULT: 2048

fp_size = fp_size

radius = radius

featurize(raw)

Featurize a batch of SMILES keyed by their compound id.

PARAMETER DESCRIPTION
raw

dictionary of compound id as key and their SMILES as value.

TYPE: dict[str, str]

RETURNS DESCRIPTION
FeaturizeResult

A FeaturizeResult object containing the fingerprints and any skipped compounds.