Featurize
Class to convert SMILES to Morgan fingerprints
FeaturizeResult(items, skipped=dict())
¶
Dataclass holding the results of a featurization pass.
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:
|
fp_size
|
Fingerprint length in bits.
TYPE:
|
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:
|
| RETURNS | DESCRIPTION |
|---|---|
FeaturizeResult
|
A |
resolve_smiles(variants, *, standardize=True)
¶
Resolve a set of SMILES mapping to the same InChIKey to a single deterministic representative SMILES string.
| PARAMETER | DESCRIPTION |
|---|---|
variants
|
A set of SMILES strings that map to the same InChIKey.
TYPE:
|
standardize
|
Whether to standardize the molecules before comparison. Default is True.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
tuple[str, str]
|
A tuple containing the chosen SMILES string and a method string indicating how the choice was made one of the following: - "single" Only one SMILES string is available for these variants. - "same_structure" variants that were parsed canonicalize to one structure so any of them can be returned. Thus, the minimum lexicographically ordered canonical SMILES of the variants is returned. - "standardized" when standardize is True, when compared in their neutral parent forms, the neutral parents agree. Thus, the canonical SMILES of the neutral parent is returned. - "standardized_picked" when standardize is True, but the neutral parents still differ. Thus, the minimum lexicographically ordered canonical SMILES of the neutral parents is returned - "picked_raw" when standardize is False or nothing standardized, the minimum lexicographically ordered canonical SMILES of the raw variants is returned. |