TaproomDataSet
- class openff.evaluator.datasets.taproom.TaproomDataSet(host_codes: Optional[List[str]] = None, guest_codes: Optional[List[str]] = None, default_ionic_strength: Optional[Quantity] = 150 * unit.millimolar, negative_buffer_ion: str = '[Cl-]', positive_buffer_ion: str = '[Na+]', attach_apr_meta_data: bool = True)[source]
A dataset of host-guest binding affinity measurements which sources its data from the taproom package.
The loaded
HostGuestBindingAffinity
properties will also be optionally (enabled by default) initialized with the metadata required by the APR estimation workflow.- __init__(host_codes: Optional[List[str]] = None, guest_codes: Optional[List[str]] = None, default_ionic_strength: Optional[Quantity] = 150 * unit.millimolar, negative_buffer_ion: str = '[Cl-]', positive_buffer_ion: str = '[Na+]', attach_apr_meta_data: bool = True)[source]
- Parameters
host_codes – The three letter codes of the host molecules to load from
taproom
If no list is provided, all hosts will be loaded.guest_codes – The three letter codes of the guest molecules to load from
taproom
. If no list is provided, all guests will be loaded.default_ionic_strength – The default ionic strength to use for measurements. The value specified in
taproom
will be ignored and this value used instead. If no value is provided, no buffer will be included.negative_buffer_ion – The SMILES pattern of the negative buffer ion to use. The value specified in
taproom
will be ignored and this value used instead.positive_buffer_ion – The SMILES pattern of the positive buffer ion to use. The value specified in
taproom
will be ignored and this value used instead.attach_apr_meta_data – Whether to add the metadata required for an APR based calculation using the
paprika
based workflow.
Methods
__init__
([host_codes, guest_codes, ...])- param host_codes
The three letter codes of the host molecules to load from
taproom
add_properties
(*physical_properties[, validate])Adds a physical property to the data set.
from_json
(file_path)Create this object from a JSON file.
from_pandas
(data_frame)Constructs a data set object from a pandas
DataFrame
object.json
([file_path, format])Creates a JSON representation of this class.
merge
(data_set[, validate])Merge another data set into the current one.
parse_json
(string_contents)Parses a typed json string into the corresponding class structure.
properties_by_substance
(substance)A generator which may be used to loop over all of the properties which were measured for a particular substance.
properties_by_type
(property_type)A generator which may be used to loop over all of properties of a particular type, e.g.
Converts a PhysicalPropertyDataSet to a pandas.DataFrame object with columns of
validate
()Checks to ensure that all properties within the set are valid physical property object.
Attributes
A list of all of the properties within this set.
The types of property within this data set.
The sources from which the properties in this data set were gathered.
The substances for which the properties in this data set were collected for.
- add_properties(*physical_properties, validate=True)
Adds a physical property to the data set.
- Parameters
physical_properties (PhysicalProperty) – The physical property to add.
validate (bool) – Whether to validate the properties before adding them to the set.
- classmethod from_json(file_path)
Create this object from a JSON file.
- Parameters
file_path (str) – The path to load the JSON from.
- Returns
The parsed class.
- Return type
cls
- classmethod from_pandas(data_frame: DataFrame) PhysicalPropertyDataSet
Constructs a data set object from a pandas
DataFrame
object.Notes
All physical properties are assumed to be source from experimental measurements.
Currently this method onlu supports data frames containing properties which are built-in to the framework (e.g. Density).
This method assumes the data frame has a structure identical to that produced by the
PhysicalPropertyDataSet.to_pandas
function.
- Parameters
data_frame – The data frame to construct the data set from.
- Return type
The constructed data set.
- merge(data_set, validate=True)
Merge another data set into the current one.
- Parameters
data_set (PhysicalPropertyDataSet) – The secondary data set to merge into this one.
validate (bool) – Whether to validate the other data set before merging.
- classmethod parse_json(string_contents)
Parses a typed json string into the corresponding class structure.
- properties_by_substance(substance)
A generator which may be used to loop over all of the properties which were measured for a particular substance.
- Parameters
substance (Substance) – The substance of interest.
- Return type
generator of PhysicalProperty
- properties_by_type(property_type)
A generator which may be used to loop over all of properties of a particular type, e.g. all “Density” properties.
- Parameters
property_type (str or type of PhysicalProperty) – The type of property of interest. This may either be the string class name of the property or the class type.
- Return type
generator of PhysicalProperty
- property sources
The sources from which the properties in this data set were gathered.
- Type
set of Source
- property substances
The substances for which the properties in this data set were collected for.
- Type
set of Substance
- to_pandas()
Converts a PhysicalPropertyDataSet to a pandas.DataFrame object with columns of
‘Id’
‘Temperature (K)’
‘Pressure (kPa)’
‘Phase’
‘N Components’
‘Component 1’
‘Role 1’
‘Mole Fraction 1’
‘Exact Amount 1’
…
‘Component N’
‘Role N’
‘Mole Fraction N’
‘Exact Amount N’
‘<Property 1> Value (<default unit>)’
‘<Property 1> Uncertainty / (<default unit>)’
…
‘<Property N> Value / (<default unit>)’
‘<Property N> Uncertainty / (<default unit>)’
‘Source’
where ‘Component X’ is a column containing the smiles representation of component X.
- Returns
The create data frame.
- Return type