ForceField module

class ForceField.ForceField(device='cpu')

Bases: Module

__init__(device='cpu')

It initializes the force field object

Parameters:

device (str) – device on which the object should be created. Example: “cpu” for CPU calculation, “cuda” for GPU calculation, “cuda:0” to use GPU 0. Refer to pytorch devices semantic for more information default = ‘cpu’

forward(coordinates, info_tensors, verbose=False)

function that calculates the actual energy of the protein(s) or complex(es)

Parameters:
  • coordinates (torch.Tensor) – shape: (Batch, nAtoms, 3) coordinates of the proteins. It can be generated using the madrax.utils.parsePDB function

  • info_tensors (tuple) – a set of precalculated information tensors required by the forcefield. It can be created out of the box with the function madrax.dataStructures.create_info_tensors starting from the atom names (that can be obtained, along with the coordinates, by the madrax.utils.parsePDB function)

  • verbose (bool) – if you wanna see a lot of text everywhere in your terminal

Returns:

  • final_energy (torch.Tensor)

  • shape (shape (Batch, nChains, nResi, nMutants, 10))

  • The Gibbs energy of the input proteins. The dimensions are organized as follow

  • The batch dimension refers to the protein number (same order of the one defined by the madrax.utils.parsePDB finction), chain refers to the chain index (sorted alphabetically), residue number refers to the residue position, nMutants refers to the mutants you might have implemented in the calculation (this dimension is 1 if no mutants have been added). The last dimension refers to the different types of energy

  • 0 (Disulfide bonds Energy)

  • 1 (Hydrogen Bonds Energy)

  • 2 (Electrostatics Energy)

  • 3 (Van der Waals Clashes)

  • 4 (Polar Solvation Energy)

  • 5 (Hydrophobic Solvation Energy)

  • 6 (Van der Waals Energy)

  • 7 (Backbone Entropy)

  • 8 (Side Chain Entropy)

  • 9 (Peptide Bond Violations)

  • 10 (Rotamer Violation)

getPairwiseRepresentation(coords, atom_number, atom_description, distance_threshold=7)
training: bool