molecular_simulations.build.build_ligand module

class molecular_simulations.build.build_ligand.ComplexBuilder(path, pdb, lig, padding=10.0, lig_param_prefix=None, **kwargs)

Bases: ExplicitSolvent

Builds complexes consisting of a biomolecule pdb and small molecule ligand. Runs antechamber workflow to generate gaff2 parameters. Can optionally supply precomputed frcmod/lib files by their path + suffix in the lig_param_prefix argument (e.g. /path/to/lig.mol2 or /path/to/lig)

Parameters:
add_ion_to_pdb()
Return type:

None

assemble_system(dim, num_ions)

Slightly modified from the parent class, now we have to add the ligand parameters and assemble a complex rather than just placing a biomolecule in the water box.

Return type:

None

build()

Orchestrate the various things that need to happen in order to produce an explicit solvent system. This includes running pdb4amber, computing the periodic box size, number of ions needed and running tleap to make the final system.

Return type:

None

Returns:

None

process_ligand(lig, prefix=None)
Return type:

Union[str, Path]

Parameters:
class molecular_simulations.build.build_ligand.LigandBuilder(path, lig, lig_number=0, file_prefix='')

Bases: object

Parameterizes a ligand molecule and generates all relevant force field files for running tleap.

Parameters:
check_sqm()

Checks for evidence that antechamber calculations exited successfully. This is always on the second to last line, and if not present, indicates that we failed to produce sane parameters for this molecule. In that case, I wish you good luck.

Return type:

None

Returns:

None

convert_to_mol2()

Converts an sdf file to mol2 format using obabel.

Return type:

None

Returns:

None

move_antechamber_outputs()

Remove unneccessary outputs from antechamber. Keep the sqm.out file as proof that antechamber did not fail.

Return type:

None

Returns:

None

parameterize_ligand()

Ensures consistent treatment of all ligand sdf files, generating GAFF2 parameters in the form of .frcmod and .lib files. Produces a mol2 file for coordinates and connectivity and ensures that antechamber did not fail. Hydrogens are added in rdkit which generally does a good job of this.

Return type:

None

Returns:

None

process_pdb()

Ingests a PDB file of a small molecule, adds hydrogens and writes out to an SDF file.

Return type:

None

Returns:

None

process_sdf()

Add hydrogens in rdkit. Atom hybridization is taken from the input sdf file and if this is incorrect, hydrogens will be wrong too.

Return type:

None

Returns:

None

write_leap(inp)

Writes out a tleap input file and returns the path to the file.

Return type:

str

Parameters:

inp (str)

exception molecular_simulations.build.build_ligand.LigandError(message='This system contains ligands which we cannot model!')

Bases: Exception

Custom Ligand exception to catch parameterization errors.

class molecular_simulations.build.build_ligand.PLINDERBuilder(path, system_id, out, **kwargs)

Bases: ImplicitSolvent

Builds complexes consisting of a biomolecule pdb and small molecule ligand. Runs antechamber workflow to generate gaff2 parameters.

Parameters:
property anion_list: List[str]
assemble_system()

Slightly modified from the parent class, now we have to add the ligand parameters and assemble a complex rather than just placing a biomolecule in the water box.

Return type:

None

build()

Orchestrate the various things that need to happen in order to produce an explicit solvent system. This includes running pdb4amber, computing the periodic box size, number of ions needed and running tleap to make the final system.

Return type:

None

Returns:

None

property cation_list: List[str]
check_ligand(ligand)

Check ligand for ions and other weird stuff. We need to take care not to assume all species containing formal charges are ions, nor that all species containing atoms in the cation/anion lists are ions. Good example is the multitude of small molecule drugs containing bonded halogens.

Return type:

bool

Parameters:

ligand (str | Path)

check_ptms(sequence, chain_residues)

Check the full sequence (from fasta) against the potentially partial sequence from the structural model stored in chain_residues.

Return type:

List[str]

Parameters:
inject_fasta(chain_map)

Checks fasta against actual sequence. Modifies sequence so that it correctly matches in the case of non-canonical residues such as phosphorylations (i.e. SER -> SEP).

Return type:

List[Sequence]

Parameters:

chain_map (Dict[str, List[str]])

ligand_handler(ligs)
Return type:

List[Union[str, Path]]

Parameters:

ligs (List[str | Path])

migrate_files()
Return type:

List[str]

place_ions()

This is horrible and I apologize profusely if you find yourself having to go through the following. Good luck.

Return type:

None

prep_protein()
Return type:

None

triage_pdb(broken_pdb, repaired_pdb)

Runs PDBFixer to repair missing loops and ensure structure is in good shape. Runs a check against the sequence provided by PLINDER and ensures that any non-canonical residues are represented in the sequence properly.

Return type:

str

Parameters: