molsysmt.thirds.tleap package#

Submodules#

molsysmt.thirds.tleap.tleap module#

class molsysmt.thirds.tleap.tleap.TLeap[source]#

Bases: object

Programmatic interface to write and run AmberTools’ tLEaP scripts. To avoid problems with special characters in file paths, the class run the tleap script in a temporary folder with hardcoded names for files and then copy the output files in their respective folders. .. attribute:: script

add_commands(*args)[source]#

Append commands to the script :param args: Individual commands to add to the script written in full as strings.

Newline characters are added after each command

add_ions(unit_name, ion, num_ions=0, replace_solvent=False)[source]#

Add ions to a unit in LEaP This adds to the script :param unit_name: Name of the existing LEaP unit which Ions will be added into :type unit_name: str :param ion: LEaP recognized name of ion to add :type ion: str :param num_ions: Number of ions of type ion to add to unit_name. If 0, the unit

is neutralized (default is 0).

Parameters:

replace_solvent (bool, optional) – If True, ions will replace solvent molecules rather than being added.

check_unit(unit_name)[source]#

Checking for internal inconsistencies in a Unit such as: long or short bonds, non-integral total charge, missing atoms, unwanted steric clashes between atoms. :param unit_name: Name of the unit as it should be represented in LEaP :type unit_name: str

combine(unit_name, *args)[source]#

Combine units in LEaP This adds to the script :param unit_name: Name of LEaP unit to assign the combination to :type unit_name: str :param args: Name of LEaP units to combine into a single unit called leap_name :type args: iterable of strings

export_script(file_path)[source]#

Write script to file :param file_path: Full file path with extension of the script to save :type file_path: str

get_total_charge(unit_name)[source]#

Getting the total charge of a Unit :param unit_name: Name of the unit as it should be represented in LEaP :type unit_name: str

load_parameters(*args)[source]#

Load the LEaP parameters into the working TLEaP script if not already loaded This adds to the script Uses loadAmberParams for frcmod.* files Uses loadOff for *.off and *.lib files Uses source for other files. :param args: File names for each type of leap file that can be loaded.

Method to load them is automatically determined from file extension or base name

load_unit(unit_name, file_path)[source]#

Load a Unit into LEaP, this is typically a molecule or small complex. This adds to the script Accepts *.mol2 or *.pdb files :param unit_name: Name of the unit as it should be represented in LEaP :type unit_name: str :param file_path: Full file path with extension of the file to read into LEaP as a new unit :type file_path: str

make_sequence(unit_name, sequence)[source]#

Define a Unit with a sequence of residue names :param unit_name: Name of the unit as it should be represented in LEaP :type unit_name: str :param file_path: Space separated equence of residue names (3-letters code) :type file_path: str

new_section(comment)[source]#

Adds a comment line to the script

run(working_directory=None, verbose=False)[source]#

Run script and return warning messages in leap log file.

save_unit(unit_name, output_path)[source]#

Write a LEaP unit to file. Accepts either *.prmtop, *.inpcrd, or *.pdb files This adds to the script :param unit_name: Name of the unit to save :type unit_name: str :param output_path: Full file path with extension to save.

Outputs with multiple files (e.g. Amber Parameters) have their names derived from this instead

property script#

Complete and return the finalized script string Adds a quit command to the end of the script.

set_global_parameter(**kwargs)[source]#

Set global parameter value with command ‘set default’. See the Amber manual: ‘set’ subsection of section ‘Commands’ in Leap chapter. :param OldPrmtopFormat: “on” or “off” (default) to write the prmtop file in Amber 6 and earlier format :type OldPrmtopFormat: str :param Dielectric: “constant” or “distance” (default) for constant or distance dependent dielectric :type Dielectric: str :param PdbWriteCharges: “on” or “off” (default) to write withe savePDB the atom charges in the B-factors

columnt

Parameters:
  • PBRadii (str) – “bondi”, “mbondi” (default), “mbondi2”, “mbondi3” or “amber6” to choose the set of atomic radii for generalized Born or Poisson-Boltzmann calculations.

  • nocenter (str) – “on” or “off” (default) to deactivate recentering coordinates.

  • reorder_residues (str) – “on” (default) or “off” to place non-solvent residues before sovent residues

solvate(unit_name, solvent_model, clearance, box_geometry='cubic')[source]#

Solvate a unit in LEaP isometrically This adds to the script :param unit_name: Name of the existing LEaP unit which will be solvated :type unit_name: str :param solvent_model: LEaP recognized name of the solvent model to use, e.g. “TIP3PBOX” :type solvent_model: str :param clearance: Add solvent up to clearance distance away (units of length) from the unit_name (radial) :type clearance: unit.Quantity :param box_geometry: Shape of the box to be solvated (Default is “cubic”). :type box_geometry: “cubic” or “truncated octahedral”

transform(unit_name, transformation)[source]#

Transformation is an array-like representing the affine transformation matrix.

Module contents#