stko.MAEExtractor

class stko.MAEExtractor(run_name, n=1)[source]

Bases: object

Extracts the lowest energy conformer from a .maegz file.

Macromodel conformer searches produce -out.maegz files containing all of the conformers found during the search and their energies and other data.

Initializing this class with a ConstructedMolecule finds the -out.maegz file of that ConstructedMolecule and converts it to a .mae file. It then creates and additional .mae file holding only the lowest energy conformer found.

Attributes

maegz_path

-out.maegz file generated by the conformer search.

mae_path

.mae file holding the conformers from the conformer search.

content

The content of the .mae file holding all the conformers.

energies

Energies of the lowest energy confromers and their id.

min_energy

The minimum energy found in the .mae file.

path

.mae file holding the extracted lowest energy conformer.

Methods

extract_conformers

Creates .mae files holding the lowest energy conformers.

extract_energy

Extracts the energy value from a .mae energy data block.

lowest_energy_conformers

Returns the id and energy of the lowest energy conformers.

maegz_to_mae

Converts the .maegz file to a .mae file.

Parameters:
extract_conformers(n)[source]

Creates .mae files holding the lowest energy conformers.

Parameters:

n (int) – The number of conformers to extract.

Return type:

None

extract_energy(block)[source]

Extracts the energy value from a .mae energy data block.

Parameters:

block (str) – An .mae energy data block.

Returns:

The energy value extracted from block or None if one is not found.

Return type:

float | None

lowest_energy_conformers(n)[source]

Returns the id and energy of the lowest energy conformers.

Parameters:

n (int) – The number of lowest energy conformers to return.

Returns:

A list of the form

returned = [(123.3, 23), (143.89, 1), (150.6, 12), ...]

Where each tuple holds the energy of the n lowest energy conformers and the id, respectively.

Return type:

list[tuple[float | None, int]]

maegz_to_mae()[source]

Converts the .maegz file to a .mae file.

Return type:

None

content: str

The content of the .mae file holding all the conformers.

This holds other data such as their energies too.

energies: list[tuple[float | None, int]]

Energies of the lowest energy confromers and their id.

mae_path: Path

.mae file holding the conformers from the conformer search.

maegz_path: Path

-out.maegz file generated by the conformer search.

min_energy: float | None

The minimum energy found in the .mae file.

path: Path

.mae file holding the extracted lowest energy conformer.