psiresp.molecule.Molecule

pydantic model psiresp.molecule.Molecule[source]

Class to manage a molecule

Fields:
Validators:
field charge: Optional[int] = None

Charge to apply to the molecule. If charge=None, the charge is taken to be the molecular_charge on the QCElemental molecule

field conformer_generation_options: ConformerGenerationOptions [Optional]

Conformer generation options

field conformers: List[Conformer] [Optional]

List of psiresp.conformer.Conformers of the molecule

field keep_original_orientation: bool = False

Whether to use the original orientation of the conformer. If keep_original_orientation=False but generate_orientations() is called without specifying specific reorientations, rotations, or translations, this is ignored and the original conformer geometry is used.

field multiplicity: Optional[int] = None

Multiplicity to apply to the molecule. If multiplicity=None, the multiplicity is taken to be the molecular_multiplicity on the QCElemental molecule

field optimize_geometry: bool = False

Whether to optimize the geometry of conformers

field qcmol: qcel.models.Molecule [Required]
field reorientations: List[Tuple[int, int, int]] [Optional]

Specific rigid-body reorientations to generate. Eachnumber in the tuple represents an atom. The first atomin the tuple becomes the new origin; the second definesthe x-axis; and the third defines the xy plane. This isindexed from 0.

field rotations: List[Tuple[int, int, int]] [Optional]

Specific rigid-body rotations to generate. Eachnumber in the tuple represents an atom. The first andsecond atoms in the tuple define a vector parallel to thex-axis, and the third atom defines a plane parallel to thexy plane. This is indexed from 0.

field stage_1_restrained_charges: Optional[ndarray] = None

Stage 1 restrained charges. These are typically assigned from a psiresp.job.Job.

Validated by:
field stage_1_unrestrained_charges: Optional[ndarray] = None

Stage 1 unrestrained charges. These are typically assigned from a psiresp.job.Job.

Validated by:
field stage_2_restrained_charges: Optional[ndarray] = None

Stage 2 restrained charges. These are typically assigned from a psiresp.job.Job.

Validated by:
field stage_2_unrestrained_charges: Optional[ndarray] = None

Stage 2 unrestrained charges. These are typically assigned from a psiresp.job.Job.

Validated by:
field translations: List[Tuple[float, float, float]] [Optional]

Specific translations to generate. Each item is a tuple of (x, y, z) coordinates. The entire molecule is translated by these coordinates.

add_conformer(conformer=None, **kwargs)[source]
add_conformer_with_coordinates(coordinates, units='angstrom')[source]

Add a new conformer with specified coordinates.

No checking is done to ensure that the conformer does not already exist in the molecule.

classmethod from_rdkit(molecule, random_seed=- 1, **kwargs)[source]
classmethod from_smiles(smiles, order_by_map_number=False, **kwargs)[source]
Parameters:

order_by_map_number (bool) –

generate_atom_combinations(n_combinations=None)
generate_conformers()[source]

Generate conformers

generate_orientation_coordinates(coordinates=None)[source]

Generate coordinates for orientations in angstrom

Parameters:

coordinates (Optional[ndarray]) –

Return type:

ndarray

generate_orientations(clear_existing_orientations=False)[source]

Generate Orientation objects for each conformer.

Parameters:

clear_existing_orientations (bool) –

generate_transformations(n_rotations=0, n_reorientations=0, n_translations=0)[source]

Automatically generate the atom combinations for rotations and reorientations, as well as translation vectors.

Atom combinations are generated first by iterating over combinations of heavy atoms, and then incorporating hydrogens.

Parameters:
  • n_rotations (int) –

  • n_reorientations (int) –

  • n_translations (int) –

get_atoms(indices)[source]
Parameters:

indices (List[int]) –

get_atoms_from_smarts(smiles)[source]
get_hash()
get_smarts_matches(smiles)
get_sp3_ch_indices()[source]
Return type:

Dict[int, List[int]]

get_symmetric_atom_indices()[source]

Get atom indices that are symmetric to each other

Returns:

symmetric_atom_indices – Each item in the list is a tuple of integers, where each atom associated with the index is symmetric to the others

Return type:

List[Tuple[int, …]]

get_symmetric_atoms()[source]

Get atoms that are symmetric to each other

Returns:

symmetric_atoms – Each item in the list is a list of atoms, where each atom is symmetric to the others

Return type:

List[List[Atom]]

qcmol_with_coordinates(coordinates, units='angstrom')
to_mdanalysis()[source]
to_rdkit()[source]
to_smiles(mapped=True)
validator validate_charges  »  stage_2_unrestrained_charges, stage_1_restrained_charges, stage_1_unrestrained_charges, stage_2_restrained_charges[source]
property atoms
property charges
property coordinates
property n_atoms
property n_conformers
property n_orientations

Number of orientations in the molecule.

property n_transformations

Number of transformations

property rdmol
property transformations

All transformations