rdmc.conformer_generation.metrics#

Modules for computing metrics to decide when to stop generating conformers

class rdmc.conformer_generation.metrics.SCGMetric(metric: str | None = 'entropy', window: int | None = 5, threshold: float | None = 0.01, T: float | None = 298)#

Bases: object

A class to calculate and track the given metric (“entropy”, “partition function”, or “total conformers”) for a molecule over time.

Parameters:
  • metric (str, optional) – Metric to be calculated. Options are "entropy", "partition function", or "total conformers". Defaults to "entropy".

  • window (int, optional) – Window size to compute the change in metric (doesn’t work when the metric is “total conformers”). Defaults to 5.

  • threshold (float, optional) – Threshold for the change in metric to decide when to stop generating conformers. Defaults to 0.01.

  • T (float, optional) – Temperature for entropy or partition function calculations. Defaults to 298 K.

calculate_entropy(mol_data: List[dict])#

Calculate the entropy of a molecule.

Parameters:

mol_data (List[dict]) – A list of dictionaries with molecule conformers.

calculate_metric(mol_data: List[dict])#

Calculate the metric for a given molecule. The calculated value will be appended to the metric_history list.

Parameters:

mol_data (List[dict]) – A list of dictionaries with molecule conformers.

calculate_partition_function(mol_data: List[dict])#

Calculate the partition function of a molecule.

Parameters:

mol_data (List[dict]) – A list of dictionaries with molecule conformers.

check_metric()#

Check if the change in metric is below the threshold.

Returns:

boolTrue if the change in metric is below the threshold, False otherwise.