gt4sd.properties.scores.core module¶
Implementation of scorers.
Summary¶
Classes:
Functions:
calculating exponential for a given distance |
Reference¶
- distance_to_score(distance, beta)[source]¶
calculating exponential for a given distance
- Parameters
distance (
float
) – A float.- Return type
float
- Returns
An exponential score value for a given SMILES
- class DistanceScorer(beta=1e-08)[source]¶
Bases:
ScoringFunction
- __init__(beta=1e-08)[source]¶
DistanceScorer is used to call a partial copy of distance_to_score function.
- Parameters
beta (
float
) – A float value used for getting an exponential score value
- get_distance(smile_distance)[source]¶
Generates a partial copy of distance_to_score function
- Parameters
smiles – SMILES.
- Return type
float
- Returns
An exponential score value for a given SMILES
- __annotations__ = {}¶
- __doc__ = None¶
- __module__ = 'gt4sd.properties.scores.core'¶
- class TargetValueScorer(target, scoring_function)[source]¶
Bases:
DistanceScorer
- __init__(target, scoring_function)[source]¶
Scoring function which is used to generate a score based on a taget and a scoring function.
- Parameters
target (
float
) – target score that will be used to get the distance to the score of the SMILESscoring_function (
Callable
[[str
],float
]) – an instance of a scoring class
- score(smiles)[source]¶
Generates a score for a given SMILES
- Parameters
smiles (
str
) – SMILES.- Return type
float
- Returns
A score for the given SMILES
- score_list(smiles_list)[source]¶
Generates a list of scores for a given SMILES List
- Parameters
smiles_list (
List
[str
]) – A List of SMILES.- Return type
List
[float
]- Returns
A List of scores
- __annotations__ = {}¶
- __doc__ = None¶
- __module__ = 'gt4sd.properties.scores.core'¶
- class CombinedScorer(scorer_list, weights=None)[source]¶
Bases:
object
- __init__(scorer_list, weights=None)[source]¶
Scoring function which generates a combined score for a SMILES as per the given scoring functions.
- Parameters
scorer_list (
List
[Type
[Any
]]) – A list of the scoring functionsweights (
Optional
[List
[float
],None
]) – A list of weights
- _normalize_weights(weights=None)[source]¶
It is used for normalizing weights.
- Parameters
weights – A list of weights.
- Return type
List
[float
]- Returns
Sum of all the scores generated by the given scoring functions
- score(smiles)[source]¶
Generates a score for a given SMILES
- Parameters
smiles (
str
) – SMILES.- Returns
Sum of all the scores generated by the given scoring functions
- score_list(smiles_list)[source]¶
Generates a list of scores for a given SMILES List
- Parameters
smiles_list (
List
[str
]) – A List of SMILES.- Return type
List
[float
]- Returns
A List of scores
- __dict__ = mappingproxy({'__module__': 'gt4sd.properties.scores.core', '__init__': <function CombinedScorer.__init__>, '_normalize_weights': <function CombinedScorer._normalize_weights>, 'score': <function CombinedScorer.score>, 'score_list': <function CombinedScorer.score_list>, '__dict__': <attribute '__dict__' of 'CombinedScorer' objects>, '__weakref__': <attribute '__weakref__' of 'CombinedScorer' objects>, '__doc__': None, '__annotations__': {}})¶
- __doc__ = None¶
- __module__ = 'gt4sd.properties.scores.core'¶
- __weakref__¶
list of weak references to the object (if defined)
- class RDKitDescriptorScorer(target, modifier='gaussian_modifier', descriptor='num_rotatable_bonds')[source]¶
Bases:
TargetValueScorer
- __init__(target, modifier='gaussian_modifier', descriptor='num_rotatable_bonds')[source]¶
Scoring function wrapping RDKit descriptors.
- Parameters
target (
float
) – target score that will be used to get the distance to the score of the SMILESmodifier (
str
) – score modifierdescriptor (
str
) – molecular descriptors
- score(smiles)[source]¶
Generates a score for a given SMILES
- Parameters
smiles (
str
) – SMILES.- Return type
float
- Returns
A score for the given SMILES
- __annotations__ = {}¶
- __doc__ = None¶
- __module__ = 'gt4sd.properties.scores.core'¶
- class TanimotoScorer(target, target_smile, fp_type='ECFP4', modifier='gaussian_modifier')[source]¶
Bases:
TargetValueScorer
- __init__(target, target_smile, fp_type='ECFP4', modifier='gaussian_modifier')[source]¶
Scoring function that looks at the fingerprint similarity against a target molecule.
- Parameters
target (
float
) – target score that will be used to get the distance to the score of the SMILEStarget_smile (
str
) – target molecule to compare similarityfp_type (
str
) – fingerprint typemodifier (
str
) – score modifier
- score(smiles)[source]¶
Generates a score for a given SMILES
- Parameters
smiles (
str
) – SMILES.- Return type
float
- Returns
A score for the given SMILES
- __annotations__ = {}¶
- __doc__ = None¶
- __module__ = 'gt4sd.properties.scores.core'¶
- class IsomerScorer(target, target_smile)[source]¶
Bases:
TargetValueScorer
- __init__(target, target_smile)[source]¶
Scoring function for closeness to a molecular formula.
- Parameters
target (
float
) – target score that will be used to get the distance to the score of the SMILEStarget_smile (
str
) – targeted SMILES to compare closeness with
- score(smiles)[source]¶
Generates a score for a given SMILES
- Parameters
smiles (
str
) – SMILES.- Return type
float
- Returns
A score for the given SMILES
- __annotations__ = {}¶
- __doc__ = None¶
- __module__ = 'gt4sd.properties.scores.core'¶
- class SMARTSScorer(target, target_smile, inverse=True)[source]¶
Bases:
TargetValueScorer
- __init__(target, target_smile, inverse=True)[source]¶
Scoring function that looks at the fingerprint similarity against a target molecule.
- Parameters
target (
float
) – target score that will be used to get the distance to the score of the SMILEStarget_smile (
str
) – The SMARTS string to matchinverse (
bool
) – If True then SMARTS is desired else it is not desired in the molecules
- score(smiles)[source]¶
Generates a score for a given SMILES
- Parameters
smiles (
str
) – SMILES.- Return type
float
- Returns
A score for the given SMILES
- __annotations__ = {}¶
- __doc__ = None¶
- __module__ = 'gt4sd.properties.scores.core'¶
- class QEDScorer(target)[source]¶
Bases:
TargetValueScorer
- __init__(target)[source]¶
Scoring function that calculates the weighted sum of ADS mapped properties using QED module of rdkit
- Parameters
target (
float
) – target score that will be used to get the distance to the score of the SMILES
- score(smiles)[source]¶
Generates a score for a given SMILES
- Parameters
smiles (
str
) – SMILES.- Return type
float
- Returns
A score for the given SMILES
- __annotations__ = {}¶
- __doc__ = None¶
- __module__ = 'gt4sd.properties.scores.core'¶