6.8. Scanning Interface

class pharmaforge.interfaces.scanning.Scan(interface)[source]

Bases: object

This is a class for performing cans on a molecule using a calculator of your choice.

Parameters:

calculator (object) – The calculator to use for the calculations. This should be an instance of a class that inherits from AbstractIO.

calculator

The calculator to use for the calculations. This should be an instance of a class that inherits from AbstractIO.

Type:

object

torsion_angles

A list of torsion angles for the scan.

Type:

list

energies

A list of energies for the scan.

Type:

list

forces

A list of forces for the scan.

Type:

list

coordinates

A list of coordinates for the scan.

Type:

list

dihedrals

A list of dihedrals for the scan.

Type:

list

unit

The unit of the dihedral angle. Default is None.

Type:

str

initial_structure

The initial structure of the molecule.

Type:

ase.Atoms

atom_types

A list of atom types in the molecule.

Type:

list

mask

A list of atom indices that should be rotated.

Type:

list

See also

ase.neighborlist.NeighborList

The ASE neighbor list object used to determine connectivity.

MDAnalysis

The MDAnalysis library used for molecular dynamics analysis.

multiprocessing

The multiprocessing library used for parallel processing.

Methods

add_initial_coordinates(structure)

Add the initial coordinates of the molecule to the torsional scan.

plot_scan([save])

Plot the scan results.

scan([atoms, scan_range, mask, verbose, ...])

Perform a scan on the molecule.

write_xyz([filename])

Write the scan results to an XYZ file.

process_angle_scan

process_bond_scan

process_structure

add_initial_coordinates(structure)[source]

Add the initial coordinates of the molecule to the torsional scan.

Parameters:

structure (ase.Atoms) – The ASE atoms object containing the initial coordinates of the molecule.

plot_scan(save=None)[source]

Plot the scan results.

Parameters:

save (str) – The filename to save the plot. If None, the plot will be shown but not saved.

static process_angle_scan(args)[source]
static process_bond_scan(args)[source]
static process_structure(args)[source]
scan(atoms=None, scan_range=(0, 10, 1), mask=None, verbose=False, num_workers=1, charge=0, schedule=None, constrain=None, optimize=True)[source]

Perform a scan on the molecule.

Parameters:
  • atoms (list) – A list of atoms indices to scan. Must be length 2, 3, or 4.

  • scan_range (tuple) – A tuple containing the start, end, and step size of the scan. Default is (0,10,1).

  • mask (list) – A list of atom indices that should be rotated. If None, the function will automatically select the mask.

  • verbose (bool) – If True, print the dihedral angle being scanned.

  • num_workers (int) – The number of workers to use for parallel processing. Default is 1.

  • charge (int) – The net charge of the system. Default is 0.

  • schedule (str) – The schedule for the scan. Can be “linear” or “iterative”. Default is None, which means no schedule is applied.

Returns:

  • energies (list) – A list of energies for each scan point.

  • forces (list) – A list of forces for each scan point.

  • coordinates (list) – A list of coordinates for each scan point.

Raises:

ValueError – If the number of atoms is not 2, 3, or 4.

write_xyz(filename='scan.xyz')[source]

Write the scan results to an XYZ file.

Parameters:

filename (str) – The filename to save the XYZ file. Default is “scan.xyz”.