schrodinger.application.matsci.msml.mlutils module¶
Utilities for managing ML prediction models (model data definitions and paths)
Copyright Schrodinger, LLC. All rights reserved.
- class schrodinger.application.matsci.msml.mlutils.ModelData(group, name, flag, prop, directory, skip_standardization, input_type, additional_model, model_file)¶
Bases:
tuple- additional_model¶
Alias for field number 7
- directory¶
Alias for field number 4
- flag¶
Alias for field number 2
- group¶
Alias for field number 0
- input_type¶
Alias for field number 6
- model_file¶
Alias for field number 8
- name¶
Alias for field number 1
- prop¶
Alias for field number 3
- skip_standardization¶
Alias for field number 5
- class schrodinger.application.matsci.msml.mlutils.SolventComposition(solvent_1, solvent_2, solvent_1_fraction)¶
Bases:
tuple- solvent_1¶
Alias for field number 0
- solvent_1_fraction¶
Alias for field number 2
- solvent_2¶
Alias for field number 1
- schrodinger.application.matsci.msml.mlutils.get_model_dir(subdir_name, info_dir=False)¶
Get the directory path for a model
- Parameters:
subdir_name (str) – The subdir name for the model
info_dir (bool) – Whether the directory is for information about model
- Return type:
str
- Returns:
The full path to the model directory, default or custom
- schrodinger.application.matsci.msml.mlutils.get_oled_models()¶
Return list of OLED ModelData objects
- Return type:
list
- Returns:
List of OLED model data
- schrodinger.application.matsci.msml.mlutils.get_models_by_group(group)¶
Return list of ModelData objects for a given group
- Parameters:
group (str) – Model group (SINGLE_MOL, POLYMER, OLED, etc.)
- Return type:
list
- Returns:
List of ModelData objects matching the group
- schrodinger.application.matsci.msml.mlutils.get_model_by_flag(flag)¶
Return ModelData for a given flag
- Parameters:
flag (str) – Model flag (e.g., ‘-density_predict’)
- Return type:
ModelData or None
- Returns:
ModelData object if found, None otherwise
- schrodinger.application.matsci.msml.mlutils.read_model_info(model_data, model_dir=None)¶
Read the info.json metadata for one ML model.
- Parameters:
model_data (ModelData) – ML model data definition
model_dir (str) – Optional explicit model/info directory containing info.json
- Return type:
dict
- Returns:
Parsed info.json contents
- schrodinger.application.matsci.msml.mlutils.get_model_chemical_space(model_data, model_dir=None)¶
Return the supported element list for one ML model.
- Parameters:
model_data (ModelData) – ML model data definition
model_dir (str) – Optional explicit model/info directory containing info.json
- Return type:
list
- Returns:
Ordered list of supported element symbols
- schrodinger.application.matsci.msml.mlutils.fetch_model_from_URL(model_dir, url)¶
Fetch the model from the given URL
- Parameters:
model_dir (str) – The directory to save the model to
url (str) – The URL to download the model from
- Return type:
(bool, str)
- Returns:
True, empty string if the model was downloaded successfully, False and error message if not
- schrodinger.application.matsci.msml.mlutils.download_model(model_data)¶
Download the model if it is not already present
- Parameters:
model_data (ModelData) – ML model data to download
- Return type:
bool, str
- Returns:
True, model directory if the model is present or downloaded successfully, False and error message if there was an error downloading the model
- schrodinger.application.matsci.msml.mlutils.read_solvent_file(solvent_file='opto_training_solvents.csv')¶
Read in the solvent file and store it as dictionary
- Parameters:
solvent_file (str) – The name of the solvent file to read
- Return type:
dict, dict
- Returns:
Dictionary of solvent names to SMILES strings, and SMILES string to names
- schrodinger.application.matsci.msml.mlutils.get_smiles(struct, mark_head_tail=True, logger=None)¶
Get SMILES pattern of the structures
- Parameters:
struct (Structure) – The structure to get SMILES for
mark_head_tail (bool) – Whether to replace polymer head and tail atoms if found
- Return type:
str or None
- Returns:
SMILES pattern, or None if there was an issue
- schrodinger.application.matsci.msml.mlutils.get_smasher_data(flag='these')¶
Load the in slow-to-import ligand_ml information if ligand_ml is available
- Parameters:
flag (str) – The model flag for the warning message
- schrodinger.application.matsci.msml.mlutils.get_numpy_dataset_class(flag='these')¶
Load the Ligand ML NumpyDataset class required for crystal prediction.
- Parameters:
flag (str) – Model flag to include in the missing-product error.
- Return type:
type(NumpyDataset)
- Returns:
NumpyDataset class
- schrodinger.application.matsci.msml.mlutils.struct_to_pmg_crystal(struct)¶
Convert a periodic Schrodinger structure to a ligand_ml PMGStructure.
- Parameters:
struct (Structure) – Periodic structure to convert
- Raises:
TypeError – If the conversion fails
ValueError – If the structure is invalid
- Return type:
ligand_ml.data.datasets.PMGStructure
- Returns:
Converted crystal structure
- schrodinger.application.matsci.msml.mlutils.get_molecular_weight(struct, is_polymer, range_max)¶
Get the molecular weight of a structure, removing dummy atoms if necessary
- Parameters:
struct (Structure) – The structure to get molecular weight for
is_polymer (bool) – Whether the structure is a polymer
range_max (float) – The maximum molecular weight allowed
- Return type:
float
- Returns:
The molecular weight of the structure
- exception schrodinger.application.matsci.msml.mlutils.MLPredictionError¶
Bases:
RuntimeError
- schrodinger.application.matsci.msml.mlutils.validate_structure_input_type(structs, input_type)¶
Validate that structures are compatible with a model input type.
- Parameters:
structs (list(Structure)) – Structures to validate
input_type (str) – One of MODEL_INPUT_TYPES
- Raises:
ValueError – If input_type is unknown
MLPredictionError – If any structure is incompatible
- class schrodinger.application.matsci.msml.mlutils.MLPropPredictor(options, structs=None, input_file=None, force_cpu=False, warn_func=None, logger=None)¶
Bases:
objectClass to handle ML property prediction
- SMILES_JOINER = '.[1S].'¶
- SMILES_HEADER = 'SMILES'¶
- FEATURE_0_HEADER = 'additional_feature_0'¶
- MODEL_FILE = 'pkgd_model_qzip.qzip'¶
- DATA_INFO_FILE = 'data_info.json'¶
- PANEL_INFO_FILE = 'info.json'¶
- LOGGER = None¶
- FLAG_TO_DATA = {'-absorption_fwhm_predict': ModelData(group='optoelectronics', name='Absorption bandwidth', flag='-absorption_fwhm_predict', prop='r_matsci_Absorption_Bandwidth_(cm-1)', directory='opto_absorption_FWHM', skip_standardization=False, input_type='molecule', additional_model=None, model_file='pkgd_model_qzip.qzip'), '-absorption_lmax_predict': ModelData(group='optoelectronics', name='Absorption peak position', flag='-absorption_lmax_predict', prop='r_matsci_Absorption_Lmax_(nm)', directory='opto_absorption_lambda_max', skip_standardization=False, input_type='molecule', additional_model=None, model_file='pkgd_model_qzip.qzip'), '-aqua_solubility_predict': ModelData(group='single_molecule', name='Aqueous solubility', flag='-aqua_solubility_predict', prop='r_matsci_Aqueous_Solubility_(log_mol/L)', directory='aqueous_solubility', skip_standardization=False, input_type='molecule', additional_model=None, model_file='pkgd_model_qzip.qzip'), '-band_gap_predict': ModelData(group='crystal', name='Band gap', flag='-band_gap_predict', prop='r_matsci_Band_Gap_(eV)', directory='band_gap', skip_standardization=False, input_type='crystal', additional_model=None, model_file='pkgd_model_qzip.qzip'), '-bulk_modulus_predict': ModelData(group='crystal', name='Bulk modulus', flag='-bulk_modulus_predict', prop='r_matsci_Bulk_Modulus_(GPa)', directory='bulk_modulus', skip_standardization=False, input_type='crystal', additional_model=None, model_file='pkgd_model_qzip.qzip'), '-de_s1_t1_gap_predict': ModelData(group='oled', name='Singlet-triplet energy gap', flag='-de_s1_t1_gap_predict', prop='r_matsci_Singlet_Triplet_Energy_Gap_(eV)', directory='oled_singlet_triplet_gap', skip_standardization=True, input_type='molecule', additional_model=None, model_file='pkgd_model_qzip.qzip'), '-density_predict': ModelData(group='single_molecule', name='Density', flag='-density_predict', prop='r_matsci_Density_(g/cm3)_at_%.2f_K', directory='organic_density', skip_standardization=False, input_type='molecule', additional_model=None, model_file='pkgd_model_qzip.qzip'), '-df_predict': ModelData(group='polymer', name='Dielectric loss', flag='-df_predict', prop='r_matsci_Polymer_Df_at_%.2f_Hz', directory='polymer_df', skip_standardization=False, input_type='molecule', additional_model=None, model_file='pkgd_model_qzip.qzip'), '-dk_predict': ModelData(group='polymer', name='Dielectric constant', flag='-dk_predict', prop='r_matsci_Polymer_Dk_at_%.2f_Hz', directory='polymer_dk', skip_standardization=False, input_type='molecule', additional_model=None, model_file='pkgd_model_qzip.qzip'), '-electron_reorg_predict': ModelData(group='oled', name='Electron reorganization energy', flag='-electron_reorg_predict', prop='r_matsci_Electron_Reorganization_(eV)', directory='oled_electron_reorg', skip_standardization=True, input_type='molecule', additional_model=None, model_file='pkgd_model_qzip.qzip'), '-emission_fwhm_predict': ModelData(group='optoelectronics', name='Emission bandwidth', flag='-emission_fwhm_predict', prop='r_matsci_Emission_Bandwidth_(cm-1)', directory='opto_emission_FWHM', skip_standardization=False, input_type='molecule', additional_model=None, model_file='pkgd_model_qzip.qzip'), '-emission_lifetime_predict': ModelData(group='optoelectronics', name='Emission lifetime', flag='-emission_lifetime_predict', prop='r_matsci_Emission_Lifetime_(log_ns)', directory='opto_log_lifetime', skip_standardization=False, input_type='molecule', additional_model=None, model_file='pkgd_model_qzip.qzip'), '-emission_lmax_predict': ModelData(group='optoelectronics', name='Emission peak position', flag='-emission_lmax_predict', prop='r_matsci_Emission_Emax_(nm)', directory='opto_emission_lambda_max', skip_standardization=False, input_type='molecule', additional_model=None, model_file='pkgd_model_qzip.qzip'), '-energy_above_hull_predict': ModelData(group='crystal', name='Energy above hull', flag='-energy_above_hull_predict', prop='r_matsci_Energy_Above_Hull_(eV/atom)', directory='energy_above_hull', skip_standardization=False, input_type='crystal', additional_model=None, model_file='pkgd_model_qzip.qzip'), '-extinction_predict': ModelData(group='optoelectronics', name='Extinction coefficient', flag='-extinction_predict', prop='r_matsci_Extinction_Coefficient_(log_mol-1_dm3_cm-1)', directory='opto_log_e', skip_standardization=False, input_type='molecule', additional_model=None, model_file='pkgd_model_qzip.qzip'), '-formation_energy_predict': ModelData(group='crystal', name='Formation energy', flag='-formation_energy_predict', prop='r_matsci_Formation_Energy_(eV/atom)', directory='formation_energy', skip_standardization=False, input_type='crystal', additional_model=None, model_file='pkgd_model_qzip.qzip'), '-hole_reorg_predict': ModelData(group='oled', name='Hole reorganization energy', flag='-hole_reorg_predict', prop='r_matsci_Hole_Reorganization_(eV)', directory='oled_hole_reorg', skip_standardization=True, input_type='molecule', additional_model=None, model_file='pkgd_model_qzip.qzip'), '-melting_point_predict': ModelData(group='single_molecule', name='Melting point', flag='-melting_point_predict', prop='r_matsci_Melting_Point_(K)', directory='melting_temp', skip_standardization=False, input_type='molecule', additional_model=None, model_file='pkgd_model_qzip.qzip'), '-non_aqua_solubility_predict': ModelData(group='formulation', name='Non-aqueous solubility', flag='-non_aqua_solubility_predict', prop='r_matsci_NonAq_Solubility_(log_mol_frac)_at_%s_K', directory='nonaqueous_solubility', skip_standardization=False, input_type='molecule', additional_model=None, model_file='pkgd_model_qzip.qzip'), '-oxidation_potential_predict': ModelData(group='single_molecule', name='Oxidation potential', flag='-oxidation_potential_predict', prop='r_matsci_Oxidation_Potential_(V)', directory='oxidation_potential', skip_standardization=False, input_type='molecule', additional_model=None, model_file='pkgd_model_qzip.qzip'), '-plqy_predict': ModelData(group='optoelectronics', name='Photoluminescence quantum yield', flag='-plqy_predict', prop='r_matsci_Photoluminescence_Quantum_Yield', directory='opto_quantum_yield', skip_standardization=False, input_type='molecule', additional_model=None, model_file='pkgd_model_qzip.qzip'), '-reduction_potential_predict': ModelData(group='single_molecule', name='Reduction potential', flag='-reduction_potential_predict', prop='r_matsci_Reduction_Potential_(V)', directory='reduction_potential', skip_standardization=False, input_type='molecule', additional_model=None, model_file='pkgd_model_qzip.qzip'), '-scaled_homo_predict': ModelData(group='oled', name='Scaled HOMO', flag='-scaled_homo_predict', prop='r_matsci_scaled_HOMO_Energy_(eV)', directory='oled_scaled_homo', skip_standardization=True, input_type='molecule', additional_model=None, model_file='pkgd_model_qzip.qzip'), '-scaled_lumo_predict': ModelData(group='oled', name='Scaled LUMO', flag='-scaled_lumo_predict', prop='r_matsci_scaled_LUMO_Energy_(eV)', directory='oled_scaled_lumo', skip_standardization=True, input_type='molecule', additional_model=None, model_file='pkgd_model_qzip.qzip'), '-semi_organic_bp_predict': ModelData(group='single_molecule', name='Boiling point', flag='-semi_organic_bp_predict', prop='r_matsci_Evaporation_temperature_(K)_at_%.2f_Torr', directory='semi_organic_bp', skip_standardization=False, input_type='molecule', additional_model=None, model_file='pkgd_model_qzip.qzip'), '-semi_organic_vp_predict': ModelData(group='single_molecule', name='Vapor pressure', flag='-semi_organic_vp_predict', prop='r_matsci_Vapor_pressure_(Torr)_at_%s_K', directory='semi_organic_vp', skip_standardization=False, input_type='molecule', additional_model=None, model_file='pkgd_model_qzip.qzip'), '-semi_organometal_bp_predict': ModelData(group='single_molecule', name='Boiling point', flag='-semi_organometal_bp_predict', prop='r_matsci_Evaporation_temperature_(K)_at_%.2f_Torr', directory='semi_organometallic_bp', skip_standardization=True, input_type='molecule', additional_model=None, model_file='pkgd_model_qzip.qzip'), '-shear_modulus_predict': ModelData(group='crystal', name='Shear modulus', flag='-shear_modulus_predict', prop='r_matsci_Shear_Modulus_(GPa)', directory='shear_modulus', skip_standardization=False, input_type='crystal', additional_model=None, model_file='pkgd_model_qzip.qzip'), '-tg_predict': ModelData(group='polymer', name='Polymer glass transition temperature', flag='-tg_predict', prop='r_matsci_Polymer_Tg_(K)', directory='polymer_tg', skip_standardization=False, input_type='molecule', additional_model=None, model_file='pkgd_model_qzip.qzip'), '-triplet_energy_predict': ModelData(group='oled', name='Triplet Energy (E(S0T1))', flag='-triplet_energy_predict', prop='r_matsci_Triplet_Energy_(eV)', directory='oled_triplet_energy', skip_standardization=True, input_type='molecule', additional_model=None, model_file='pkgd_model_qzip.qzip'), '-triplet_reorg_predict': ModelData(group='oled', name='Triplet reorganization energy', flag='-triplet_reorg_predict', prop='r_matsci_Triplet_Reorganization_Energy_(eV)', directory='oled_triplet_reorg', skip_standardization=True, input_type='molecule', additional_model=None, model_file='pkgd_model_qzip.qzip'), '-viscosity_predict': ModelData(group='single_molecule', name='Viscosity', flag='-viscosity_predict', prop='r_matsci_Viscosity_(cP)_at_%.2f_K', directory='organic_viscosity', skip_standardization=False, input_type='molecule', additional_model=None, model_file='pkgd_model_qzip.qzip')}¶
- __init__(options, structs=None, input_file=None, force_cpu=False, warn_func=None, logger=None)¶
Create a ML prediction class instance
type options:
argparse.Namespace:param options: The command line options- Parameters:
structs (list of
schrodinger.structure.Structure) – list of structures for predictioninput_file (str) – name of the input file
force_cpu (bool) – If true, force the model to run on CPU else LigandML will figure out the best device to run the model on. The default is False.
warn_func (callable) – The function to call to log/show warnings
- Raises:
MLPredictionError – if the input structure is coarse-grained.
- log(msg, **kwargs)¶
Add a message to the log file
- Parameters:
msg (str) – The message to log
Additional keyword arguments are passed to the textlogger.log_msg function
- run()¶
Run the workflow
- Return type:
pandas.DataFrame
- Returns:
Dataframe containing structures and predicted properties
- getComputedValues()¶
Get computed values from data frame.
- Return type:
list[float or None]
- Returns:
Computed values for all the structures. None if a value wasn’t computed
- getSolventComposition()¶
Normalize the solvent option to one solvent composition.
The legacy scalar solvent option is accepted as a pure-solvent composition. A missing option represents the pure thin-film condition.
- Return type:
- Returns:
Solvent composition for the prediction
- Raises:
MLPredictionError – If the solvent composition has an invalid type
- classmethod getProperty(options)¶
Get the name of the computed property for the model.
- Return type:
str
- Returns:
The name of the computed property
- Raises:
MLPredictionError – If no property is requested
- validateAtomPresent()¶
Validate the input structure to check if structure is differing from trained chemical space. If not, remove the structure from prediction.
- Raises:
MLPredictionError – If the atom in the input structure is not part of trained dataset.
- featurizeStruct()¶
Prepare structures for the representation required by the model input type.
- featurizeMolStructs()¶
Convert non-periodic structures into RDKit molecules and SMILES strings.
Structures that cannot be converted are skipped, and the successfully converted structures are used to initialize the prediction output.
- Raises:
MLPredictionError – If no structures convert successfully
- featurizeCrystalStructs()¶
Convert periodic structures into a Ligand ML crystal dataset.
- Raises:
MLPredictionError – If no structures convert successfully
- convertToMol(struct)¶
Convert the structure to a rdkit mol that includes the solvent and necessary properties
- Parameters:
struct (Structure) – The structure to convert
- Return type:
dict
- Returns:
Row data for the structure, including the RDKit molecule under the RDKIT_MOL key, or an empty dictionary if conversion failed.
- getFormulationMol(smiles, struct, solvent_composition)¶
Create a formulation molecule for a formulation-type prediction.
- Parameters:
smiles (str) – smiles of the input structure
struct (Structure or None) – Structure corresponding to smiles. Its title is updated for non-solubility formulations.
solvent_composition (SolventComposition) – Solvent composition for this molecule
- Return type:
Chem.rdchem.Mol or None
- Returns:
Formulation molecule, or None if the SMILES are invalid.
- getFormulationComponents(smiles, struct, solvent_composition)¶
Return formulation components, composition, and solid indicator.
- Parameters:
smiles (str) – SMILES of the input structure.
struct (Structure or None) – Input structure whose title is updated for the formulation.
solvent_composition (SolventComposition) – Solvent composition for the formulation.
- Return type:
tuple(list(str), list(float), str)
- Returns:
Component SMILES, component fractions, and solid indicator.
- Raises:
MLPredictionError – If two solvents are supplied for a model that does not support binary solvents.
- getRDKitMol(smiles)¶
Get RDKIT mol object from SMILES string
- Parameters:
smiles (str) – The SMILES string
- Return type:
Chem.rdchem.Mol or None
- Returns:
The RDKIT mol object or None if smiles to mol object conversion failed
- getAdditionFeaturesVectors(feature_flag)¶
Get the additional features for the model
- Parameters:
feature_flag (str) – The flag for the model
- Return type:
float
- Returns:
The additional features for the model
- getModel()¶
Get the ligand_ml model object
- Raises:
MLPredictionError – If the user did not select a model to run
- getModelFromData(model_data, Smasher)¶
Load a model package from its metadata.
- Parameters:
model_data (ModelData) – Model metadata
Smasher (type) – Ligand ML Smasher class.
- Return type:
Smasher
- Returns:
Loaded model with metadata attributes
- getFullModelPath(dirname, model_filename=None)¶
Get the full path to the model file, using the custom version if found
- Parameters:
dirname (str) – The path to built-in model
model_filename (str) – Model package filename. If omitted, use the standard model package filename.
- Return type:
tuple(str, str)
- Returns:
The actual path to the model directory and model package.
- Raises:
MLPredictionError – If the model file is not found
- getInfoFromModelDir(model_directory)¶
Get molecular weight range and chemical space from a model directory.
- Parameters:
model_directory (str) – The path to the model directory
- Return type:
tuple(list(float), list(str))
- Returns:
Molecular-weight range and chemical space
- getAdditionalFeaturesFromModelDir(model_directory)¶
Get the additional features from a model directory.
- Parameters:
model_directory (str) – The path to the model directory
- Return type:
dict or None
- Returns:
Additional model features, if defined
- predictMols(mols, model)¶
Run a batched prediction on RDKit molecules.
- Parameters:
mols (list(Chem.rdchem.Mol)) – Molecules for prediction.
model (Smasher) – Loaded model to evaluate.
- Return type:
list(tuple(float, float))
- Returns:
Prediction and uncertainty pairs.
- Raises:
MLPredictionError – If model prediction fails or returns an unexpected number of results.
- predictCrystal(model)¶
Run a batched prediction on the crystal dataset.
- Parameters:
model (Smasher) – Loaded model to evaluate.
- Return type:
list(tuple(float, float))
- Returns:
Prediction and uncertainty pairs.
- Raises:
MLPredictionError – If model prediction fails or returns an unexpected number of results.
- postProcessResults(results, model)¶
Apply model-specific post-processing to prediction results.
- Parameters:
results (list(tuple(float, float))) – Prediction and uncertainty pairs.
model (Smasher) – Model used for the predictions.
- Return type:
list(tuple(float, float))
- Returns:
Post-processed prediction and uncertainty pairs.
- predict()¶
Run the predictions
- cleanDataFrame()¶
Remove internal prediction data and rows without numerical results.
- Raises:
MLPredictionError – if the dataframe is empty after removal
- cleanModelFiles()¶
Clean temporary files created by the loaded models.
- checkMolecularWeights()¶
Check the molecular weight of the structures and add a warning property if the molecular weight is outside the range
- classmethod getDefaultOptions(model_data, option_overrides=None)¶
Build default options dict for MLPropPredictor.
- Parameters:
model_data (ModelData) – ML model data
option_overrides – Option values that override the model defaults
- Return type:
dict
- Returns:
Options dictionary for MLPropPredictor to run prediction
- class schrodinger.application.matsci.msml.mlutils.SolubilityMLPropPredictor(options, structs=None, input_file=None, force_cpu=False, warn_func=None, logger=None)¶
Bases:
MLPropPredictorML property predictor with solubility-specific processing.
- FLAG_TO_DATA = {'-absorption_fwhm_predict': ModelData(group='optoelectronics', name='Absorption bandwidth', flag='-absorption_fwhm_predict', prop='r_matsci_Absorption_Bandwidth_(cm-1)', directory='opto_absorption_FWHM', skip_standardization=False, input_type='molecule', additional_model=None, model_file='pkgd_model_qzip.qzip'), '-absorption_lmax_predict': ModelData(group='optoelectronics', name='Absorption peak position', flag='-absorption_lmax_predict', prop='r_matsci_Absorption_Lmax_(nm)', directory='opto_absorption_lambda_max', skip_standardization=False, input_type='molecule', additional_model=None, model_file='pkgd_model_qzip.qzip'), '-aqua_solubility_predict': ModelData(group='single_molecule', name='Aqueous solubility', flag='-aqua_solubility_predict', prop='r_matsci_Aqueous_Solubility_(log_mol/L)', directory='aqueous_solubility', skip_standardization=False, input_type='molecule', additional_model=None, model_file='pkgd_model_qzip.qzip'), '-band_gap_predict': ModelData(group='crystal', name='Band gap', flag='-band_gap_predict', prop='r_matsci_Band_Gap_(eV)', directory='band_gap', skip_standardization=False, input_type='crystal', additional_model=None, model_file='pkgd_model_qzip.qzip'), '-bulk_modulus_predict': ModelData(group='crystal', name='Bulk modulus', flag='-bulk_modulus_predict', prop='r_matsci_Bulk_Modulus_(GPa)', directory='bulk_modulus', skip_standardization=False, input_type='crystal', additional_model=None, model_file='pkgd_model_qzip.qzip'), '-de_s1_t1_gap_predict': ModelData(group='oled', name='Singlet-triplet energy gap', flag='-de_s1_t1_gap_predict', prop='r_matsci_Singlet_Triplet_Energy_Gap_(eV)', directory='oled_singlet_triplet_gap', skip_standardization=True, input_type='molecule', additional_model=None, model_file='pkgd_model_qzip.qzip'), '-density_predict': ModelData(group='single_molecule', name='Density', flag='-density_predict', prop='r_matsci_Density_(g/cm3)_at_%.2f_K', directory='organic_density', skip_standardization=False, input_type='molecule', additional_model=None, model_file='pkgd_model_qzip.qzip'), '-df_predict': ModelData(group='polymer', name='Dielectric loss', flag='-df_predict', prop='r_matsci_Polymer_Df_at_%.2f_Hz', directory='polymer_df', skip_standardization=False, input_type='molecule', additional_model=None, model_file='pkgd_model_qzip.qzip'), '-dk_predict': ModelData(group='polymer', name='Dielectric constant', flag='-dk_predict', prop='r_matsci_Polymer_Dk_at_%.2f_Hz', directory='polymer_dk', skip_standardization=False, input_type='molecule', additional_model=None, model_file='pkgd_model_qzip.qzip'), '-electron_reorg_predict': ModelData(group='oled', name='Electron reorganization energy', flag='-electron_reorg_predict', prop='r_matsci_Electron_Reorganization_(eV)', directory='oled_electron_reorg', skip_standardization=True, input_type='molecule', additional_model=None, model_file='pkgd_model_qzip.qzip'), '-emission_fwhm_predict': ModelData(group='optoelectronics', name='Emission bandwidth', flag='-emission_fwhm_predict', prop='r_matsci_Emission_Bandwidth_(cm-1)', directory='opto_emission_FWHM', skip_standardization=False, input_type='molecule', additional_model=None, model_file='pkgd_model_qzip.qzip'), '-emission_lifetime_predict': ModelData(group='optoelectronics', name='Emission lifetime', flag='-emission_lifetime_predict', prop='r_matsci_Emission_Lifetime_(log_ns)', directory='opto_log_lifetime', skip_standardization=False, input_type='molecule', additional_model=None, model_file='pkgd_model_qzip.qzip'), '-emission_lmax_predict': ModelData(group='optoelectronics', name='Emission peak position', flag='-emission_lmax_predict', prop='r_matsci_Emission_Emax_(nm)', directory='opto_emission_lambda_max', skip_standardization=False, input_type='molecule', additional_model=None, model_file='pkgd_model_qzip.qzip'), '-energy_above_hull_predict': ModelData(group='crystal', name='Energy above hull', flag='-energy_above_hull_predict', prop='r_matsci_Energy_Above_Hull_(eV/atom)', directory='energy_above_hull', skip_standardization=False, input_type='crystal', additional_model=None, model_file='pkgd_model_qzip.qzip'), '-extinction_predict': ModelData(group='optoelectronics', name='Extinction coefficient', flag='-extinction_predict', prop='r_matsci_Extinction_Coefficient_(log_mol-1_dm3_cm-1)', directory='opto_log_e', skip_standardization=False, input_type='molecule', additional_model=None, model_file='pkgd_model_qzip.qzip'), '-formation_energy_predict': ModelData(group='crystal', name='Formation energy', flag='-formation_energy_predict', prop='r_matsci_Formation_Energy_(eV/atom)', directory='formation_energy', skip_standardization=False, input_type='crystal', additional_model=None, model_file='pkgd_model_qzip.qzip'), '-hole_reorg_predict': ModelData(group='oled', name='Hole reorganization energy', flag='-hole_reorg_predict', prop='r_matsci_Hole_Reorganization_(eV)', directory='oled_hole_reorg', skip_standardization=True, input_type='molecule', additional_model=None, model_file='pkgd_model_qzip.qzip'), '-melting_point_predict': ModelData(group='single_molecule', name='Melting point', flag='-melting_point_predict', prop='r_matsci_Melting_Point_(K)', directory='melting_temp', skip_standardization=False, input_type='molecule', additional_model=None, model_file='pkgd_model_qzip.qzip'), '-non_aqua_solubility_predict': ModelData(group='formulation', name='Non-aqueous solubility', flag='-non_aqua_solubility_predict', prop='r_matsci_NonAq_Solubility_(log_mol_frac)_at_%s_K', directory='nonaqueous_solubility', skip_standardization=False, input_type='molecule', additional_model=None, model_file='pkgd_model_qzip.qzip'), '-oxidation_potential_predict': ModelData(group='single_molecule', name='Oxidation potential', flag='-oxidation_potential_predict', prop='r_matsci_Oxidation_Potential_(V)', directory='oxidation_potential', skip_standardization=False, input_type='molecule', additional_model=None, model_file='pkgd_model_qzip.qzip'), '-plqy_predict': ModelData(group='optoelectronics', name='Photoluminescence quantum yield', flag='-plqy_predict', prop='r_matsci_Photoluminescence_Quantum_Yield', directory='opto_quantum_yield', skip_standardization=False, input_type='molecule', additional_model=None, model_file='pkgd_model_qzip.qzip'), '-reduction_potential_predict': ModelData(group='single_molecule', name='Reduction potential', flag='-reduction_potential_predict', prop='r_matsci_Reduction_Potential_(V)', directory='reduction_potential', skip_standardization=False, input_type='molecule', additional_model=None, model_file='pkgd_model_qzip.qzip'), '-scaled_homo_predict': ModelData(group='oled', name='Scaled HOMO', flag='-scaled_homo_predict', prop='r_matsci_scaled_HOMO_Energy_(eV)', directory='oled_scaled_homo', skip_standardization=True, input_type='molecule', additional_model=None, model_file='pkgd_model_qzip.qzip'), '-scaled_lumo_predict': ModelData(group='oled', name='Scaled LUMO', flag='-scaled_lumo_predict', prop='r_matsci_scaled_LUMO_Energy_(eV)', directory='oled_scaled_lumo', skip_standardization=True, input_type='molecule', additional_model=None, model_file='pkgd_model_qzip.qzip'), '-semi_organic_bp_predict': ModelData(group='single_molecule', name='Boiling point', flag='-semi_organic_bp_predict', prop='r_matsci_Evaporation_temperature_(K)_at_%.2f_Torr', directory='semi_organic_bp', skip_standardization=False, input_type='molecule', additional_model=None, model_file='pkgd_model_qzip.qzip'), '-semi_organic_vp_predict': ModelData(group='single_molecule', name='Vapor pressure', flag='-semi_organic_vp_predict', prop='r_matsci_Vapor_pressure_(Torr)_at_%s_K', directory='semi_organic_vp', skip_standardization=False, input_type='molecule', additional_model=None, model_file='pkgd_model_qzip.qzip'), '-semi_organometal_bp_predict': ModelData(group='single_molecule', name='Boiling point', flag='-semi_organometal_bp_predict', prop='r_matsci_Evaporation_temperature_(K)_at_%.2f_Torr', directory='semi_organometallic_bp', skip_standardization=True, input_type='molecule', additional_model=None, model_file='pkgd_model_qzip.qzip'), '-shear_modulus_predict': ModelData(group='crystal', name='Shear modulus', flag='-shear_modulus_predict', prop='r_matsci_Shear_Modulus_(GPa)', directory='shear_modulus', skip_standardization=False, input_type='crystal', additional_model=None, model_file='pkgd_model_qzip.qzip'), '-solubility_predict': ModelData(group='formulation', name='Solubility prediction', flag='-solubility_predict', prop='r_matsci_Solubility_(log_g/L)_at_%s_K', directory='solubility', skip_standardization=False, input_type='molecule', additional_model=[ModelData(group='single_molecule', name='Solubility density', flag='-solubility_density_predict', prop='r_matsci_Solubility_Density_(g/cm3)_at_%.2f_K', directory='solubility', skip_standardization=False, input_type='molecule', additional_model=None, model_file='density_prod_package.tar.gz')], model_file='pkgd_model_qzip.qzip'), '-tg_predict': ModelData(group='polymer', name='Polymer glass transition temperature', flag='-tg_predict', prop='r_matsci_Polymer_Tg_(K)', directory='polymer_tg', skip_standardization=False, input_type='molecule', additional_model=None, model_file='pkgd_model_qzip.qzip'), '-triplet_energy_predict': ModelData(group='oled', name='Triplet Energy (E(S0T1))', flag='-triplet_energy_predict', prop='r_matsci_Triplet_Energy_(eV)', directory='oled_triplet_energy', skip_standardization=True, input_type='molecule', additional_model=None, model_file='pkgd_model_qzip.qzip'), '-triplet_reorg_predict': ModelData(group='oled', name='Triplet reorganization energy', flag='-triplet_reorg_predict', prop='r_matsci_Triplet_Reorganization_Energy_(eV)', directory='oled_triplet_reorg', skip_standardization=True, input_type='molecule', additional_model=None, model_file='pkgd_model_qzip.qzip'), '-viscosity_predict': ModelData(group='single_molecule', name='Viscosity', flag='-viscosity_predict', prop='r_matsci_Viscosity_(cP)_at_%.2f_K', directory='organic_viscosity', skip_standardization=False, input_type='molecule', additional_model=None, model_file='pkgd_model_qzip.qzip')}¶
- predictFromJson(prediction_data)¶
Predict solubility from JSON-compatible data without Structures.
Each value contains the solute and solvent SMILES, the complete semicolon-separated composition in additional_feature_0, and the temperature in Kelvin. The caller is responsible for validating the data.
- Parameters:
prediction_data (dict(str, dict)) – Maps prediction identifiers to SMILES, composition, and temperature values.
- Return type:
list(tuple(float, float))
- Returns:
Prediction and uncertainty pairs.
- Raises:
MLPredictionError – If model loading or prediction fails.
- getFormulationComponents(smiles, struct, solvent_composition)¶
Return solubility components and their composition.
- Parameters:
smiles (str) – SMILES of the solute.
struct (Structure or None) – Input structure whose title is updated for the formulation.
solvent_composition (SolventComposition) – Solvent composition for the formulation.
- Return type:
tuple(list(str), list(float), None)
- Returns:
Component SMILES, component fractions, and solid indicator.
- postProcessResults(results, model)¶
Apply the density correction to solubility results.
- Parameters:
results (list(tuple(float, float))) – Prediction and uncertainty pairs.
model (Smasher) – Model used for the predictions.
- Return type:
list(tuple(float, float))
- Returns:
Predictions converted to log10(g/L) for the solubility model, or unchanged predictions for other models.
- alignWithDensity(results)¶
Refine solubility predictions using solvent-density predictions.
- Parameters:
results (list(tuple(float, float))) – Solubility predictions.
- Return type:
list(tuple(float, float))
- Returns:
Solubility predictions converted to log10(g/L).
- predictSolventDensity(density_model)¶
Predict the pure-solvent densities in g/cm3.
- Parameters:
density_model (Smasher) – Loaded solvent-density model.
- Return type:
dict(tuple, tuple(float, float))
- Returns:
Solvent and feature keys mapped to finite density prediction and uncertainty pairs.
- Raises:
MLPredictionError – If the model returns an unexpected number of results.
- getUniqueSolventMols(density_model)¶
Return density-model inputs keyed by solvent and feature values.
- Parameters:
density_model (Smasher) – Loaded solvent-density model.
- Return type:
dict(tuple, Chem.rdchem.Mol)
- Returns:
Unique solvent and feature keys mapped to RDKit molecules.
- static getDensityKey(density_model, solvent, row)¶
Return the density-result key for one solvent dataframe row.
- Parameters:
density_model (Smasher) – Loaded solvent-density model.
solvent (str) – Solvent SMILES.
row (pandas.Series) – Formulation data containing density-model feature values.
- Return type:
tuple(str, tuple)
- Returns:
Solvent SMILES and ordered feature-name/value pairs.
- postProcessWithDensity(results, density_model, density_results)¶
Convert mole-fraction solubility predictions to log10(g/L).
- Parameters:
results (list(tuple(float, float))) – Solubility predictions.
density_model (Smasher) – Loaded density model.
density_results (dict) – Maps solvent and feature values to their pure-solvent density predictions.
- Return type:
list(tuple(float, float))
- Returns:
Converted solubility predictions.