dimers
#
Train against dimer energies.
Classes:
-
Dimer
–Represents a single experimental data point.
Functions:
-
create_dataset
–Create a dataset from a list of existing dimers.
-
create_from_des
–Create a dataset from a DESXXX dimer set.
-
extract_smiles
–Return a list of unique SMILES strings in the dataset.
-
compute_dimer_energy
–Compute the energy of a dimer in a series of conformers.
-
predict
–Predict the energies of each dimer in the dataset.
-
report
–Generate a report comparing the predicted and reference energies of each dimer.
Dimer
#
Bases: TypedDict
Represents a single experimental data point.
create_dataset
#
create_dataset(dimers: list[Dimer]) -> Dataset
Create a dataset from a list of existing dimers.
Parameters:
-
dimers
(list[Dimer]
) –The dimers to create the dataset from.
Returns:
-
Dataset
–The created dataset.
Source code in descent/targets/dimers.py
create_from_des
#
Create a dataset from a DESXXX dimer set.
Parameters:
-
data_dir
(Path
) –The path to the DESXXX directory.
-
energy_fn
(EnergyFn
) –A function which computes the reference energy of a dimer. This should take as input a pandas DataFrame containing the metadata for a given group, a tuple of geometry IDs, and a tensor of coordinates with
shape=(n_dimers, n_atoms, 3)
. It should return a tensor of energies withshape=(n_dimers,)
and units of [kcal/mol].
Returns:
-
Dataset
–The created dataset.
Source code in descent/targets/dimers.py
extract_smiles
#
Return a list of unique SMILES strings in the dataset.
Parameters:
-
dataset
(Dataset
) –The dataset to extract the SMILES strings from.
Returns:
-
list[str]
–The list of unique SMILES strings.
Source code in descent/targets/dimers.py
compute_dimer_energy
#
compute_dimer_energy(
topology_a: TensorTopology,
topology_b: TensorTopology,
force_field: TensorForceField,
coords: Tensor,
) -> Tensor
Compute the energy of a dimer in a series of conformers.
Parameters:
-
topology_a
(TensorTopology
) –The topology of the first monomer.
-
topology_b
(TensorTopology
) –The topology of the second monomer.
-
force_field
(TensorForceField
) –The force field to use.
-
coords
(Tensor
) –The coordinates of the dimer with
shape=(n_dimers, n_atoms, 3)
.
Returns:
-
Tensor
–The energy [kcal/mol] of the dimer in each conformer.
Source code in descent/targets/dimers.py
predict
#
predict(
dataset: Dataset,
force_field: TensorForceField,
topologies: dict[str, TensorTopology],
) -> tuple[Tensor, Tensor]
Predict the energies of each dimer in the dataset.
Parameters:
-
dataset
(Dataset
) –The dataset to predict the energies of.
-
force_field
(TensorForceField
) –The force field to use.
-
topologies
(dict[str, TensorTopology]
) –The topologies of each monomer. Each key should be a fully mapped SMILES string.
Returns:
-
tuple[Tensor, Tensor]
–The reference and predicted energies [kcal/mol] of each dimer, each with
shape=(n_dimers * n_conf_per_dimer,)
.
Source code in descent/targets/dimers.py
report
#
report(
dataset: Dataset,
force_fields: dict[str, TensorForceField],
topologies: dict[str, TensorTopology],
output_path: Path,
)
Generate a report comparing the predicted and reference energies of each dimer.
Parameters:
-
dataset
(Dataset
) –The dataset to generate the report for.
-
force_fields
(dict[str, TensorForceField]
) –The force fields to use to predict the energies.
-
topologies
(dict[str, TensorTopology]
) –The topologies of each monomer. Each key should be a fully mapped SMILES string.
-
output_path
(Path
) –The path to write the report to.
Source code in descent/targets/dimers.py
307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 |
|