How to use the lightdock.constants.DEFAULT_CONTACT_RESTRAINTS_CUTOFF function in lightdock

To help you get started, we’ve selected a few lightdock examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github brianjimenez / lightdock / lightdock / scoring / dna / driver.py View on Github external
def __call__(self, receptor, receptor_coordinates, ligand, ligand_coordinates):
        """Computes the pyDockDNA scoring energy using receptor and ligand which are
        instances of DockingModel.
        """
        elec, vdw, interface_receptor, interface_ligand = cdna.calculate_energy(receptor_coordinates, ligand_coordinates,
                                                                                receptor.charges, ligand.charges,
                                                                                receptor.vdw_energy, ligand.vdw_energy,
                                                                                receptor.vdw_radii, ligand.vdw_radii,
                                                                                DEFAULT_CONTACT_RESTRAINTS_CUTOFF)
        energy = (elec + parameters.scoring_vdw_weight * vdw)*-1.
        perc_receptor_restraints = ScoringFunction.restraints_satisfied(receptor.restraints, set(interface_receptor))
        perc_ligand_restraints = ScoringFunction.restraints_satisfied(ligand.restraints, set(interface_ligand))
        return energy + perc_receptor_restraints * energy + perc_ligand_restraints * energy
github brianjimenez / lightdock / lightdock / scoring / dfire / driver.py View on Github external
def __init__(self, weight=1.0):
        super(DFIRE, self).__init__(weight)
        self.potential = DFIREPotential()
        self.cutoff = DEFAULT_CONTACT_RESTRAINTS_CUTOFF
github brianjimenez / lightdock / lightdock / scoring / pisa / driver.py View on Github external
def __call__(self, receptor, receptor_coordinates, ligand, ligand_coordinates):
        energy, interface_receptor, interface_ligand = calculate_pisa(receptor, receptor_coordinates, 
                                                                      ligand, ligand_coordinates, 
                                                                      self.potential.pisa_energy,
                                                                      DEFAULT_CONTACT_RESTRAINTS_CUTOFF)
        perc_receptor_restraints = ScoringFunction.restraints_satisfied(receptor.restraints, interface_receptor)
        perc_ligand_restraints = ScoringFunction.restraints_satisfied(ligand.restraints, interface_ligand)
        return energy + perc_receptor_restraints * energy + perc_ligand_restraints * energy
github brianjimenez / lightdock / lightdock / scoring / vdw / driver.py View on Github external
def __call__(self, receptor, receptor_coordinates, ligand, ligand_coordinates):
        """Computes the truncated VdW energy using receptor and ligand which are
        instances of the DockingModel class"""
        vdw_energy, interface_receptor, interface_ligand = cvdw.calculate_vdw(receptor_coordinates, ligand_coordinates,
                                                                              receptor.vdw_energy, ligand.vdw_energy, 
                                                                              receptor.vdw_radii, ligand.vdw_radii,
                                                                              DEFAULT_CONTACT_RESTRAINTS_CUTOFF)
        energy = vdw_energy * -1.0 * self.weight
        perc_receptor_restraints = ScoringFunction.restraints_satisfied(receptor.restraints, set(interface_receptor))
        perc_ligand_restraints = ScoringFunction.restraints_satisfied(ligand.restraints, set(interface_ligand))
        return energy + perc_receptor_restraints * energy + perc_ligand_restraints * energy
github brianjimenez / lightdock / lightdock / scoring / fastdfire / driver.py View on Github external
def __call__(self, receptor, receptor_coordinates, ligand, ligand_coordinates):
        energy, interface_receptor, interface_ligand = calculate_dfire(receptor, ligand, 
                                                                       self.potential.dfire_energy, 
                                                                       receptor_coordinates, ligand_coordinates,
                                                                       DEFAULT_CONTACT_RESTRAINTS_CUTOFF)
        interface_receptor = set(interface_receptor)
        interface_ligand = set(interface_ligand)

        # Code to consider contacts in the interface
        perc_receptor_restraints = ScoringFunction.restraints_satisfied(receptor.restraints, interface_receptor)
        perc_ligand_restraints = ScoringFunction.restraints_satisfied(ligand.restraints, interface_ligand)

        # Calculate membrane interaction
        # TODO: refactor restraints_satisfied
        membrane_intersection = ScoringFunction.restraints_satisfied(receptor.membrane, interface_receptor)
        membrane_penalty = 0.
        if membrane_intersection > 0.:
            membrane_penalty = 999.0 * membrane_intersection
        return energy + perc_receptor_restraints * energy + perc_ligand_restraints * energy - membrane_penalty
github brianjimenez / lightdock / lightdock / scoring / sd / driver.py View on Github external
def __call__(self, receptor, receptor_coordinates, ligand, ligand_coordinates):
        """Computes the SD scoring energy using receptor and ligand which are
        instances of DockingModel
        """
        energy, interface_receptor, interface_ligand = sd.calculate_energy(receptor_coordinates, ligand_coordinates,
                                                                           receptor.charges, ligand.charges,
                                                                           receptor.vdw_energy, ligand.vdw_energy,
                                                                           receptor.vdw_radii, ligand.vdw_radii, 
                                                                           DEFAULT_CONTACT_RESTRAINTS_CUTOFF)

        perc_receptor_restraints = ScoringFunction.restraints_satisfied(receptor.restraints, set(interface_receptor))
        perc_ligand_restraints = ScoringFunction.restraints_satisfied(ligand.restraints, set(interface_ligand))
        return energy + perc_receptor_restraints * energy + perc_ligand_restraints * energy
github brianjimenez / lightdock / lightdock / scoring / mj3h / driver.py View on Github external
def __init__(self, weight=1.0, penalization=3.0):
        super(MJ3h, self).__init__(weight)
        self.penalization = penalization
        self.potential = MJPotential()
        self.potentials = self.potential.potentials['MJ3h']
        self.cutoff = DEFAULT_CONTACT_RESTRAINTS_CUTOFF * DEFAULT_CONTACT_RESTRAINTS_CUTOFF
github brianjimenez / lightdock / lightdock / scoring / tobi / driver.py View on Github external
def __init__(self, weight=1.0):
        super(TOBI, self).__init__(weight)
        self.vdw_coef = 0.6
        self.penalty = 1.0
        self.function = self._default
        self.potential = TOBIPotential()
        self.cutoff = DEFAULT_CONTACT_RESTRAINTS_CUTOFF
github brianjimenez / lightdock / lightdock / scoring / dfire2 / driver.py View on Github external
def evaluate_energy(self, receptor, receptor_coordinates, ligand, ligand_coordinates):
        coordinates = np.append(receptor_coordinates.coordinates, ligand_coordinates.coordinates).reshape((-1, 3))
        energy, interface_receptor, interface_ligand = calculate_dfire2(self.res_index, 
                                                                        self.atom_index, 
                                                                        coordinates, 
                                                                        self.potential.energy,
                                                                        self.molecule_length, 
                                                                        DEFAULT_CONTACT_RESTRAINTS_CUTOFF)
        
        # Code to consider contacts in the interface
        perc_receptor_restraints = ScoringFunction.restraints_satisfied(receptor.restraints, set(interface_receptor))
        perc_ligand_restraints = ScoringFunction.restraints_satisfied(ligand.restraints, set(interface_ligand))
        return energy + perc_receptor_restraints * energy + perc_ligand_restraints * energy
github brianjimenez / lightdock / lightdock / scoring / cpydock / driver.py View on Github external
def __call__(self, receptor, receptor_coordinates, ligand, ligand_coordinates):
        """Computes the pyDock scoring energy using receptor and ligand which are
        instances of DockingModel.
        """
        elec, vdw, solv_rec, solv_lig, interface_receptor, interface_ligand = cpydock.calculate_energy(receptor_coordinates, ligand_coordinates,
                                                                              receptor.charges, ligand.charges,
                                                                              receptor.vdw_energy, ligand.vdw_energy,
                                                                              receptor.vdw_radii, ligand.vdw_radii,
                                                                              receptor.hydrogens, ligand.hydrogens,
                                                                              receptor.sasa, ligand.sasa,
                                                                              receptor.des_energy, ligand.des_energy, 
                                                                              DEFAULT_CONTACT_RESTRAINTS_CUTOFF)
        solv = -1*(solv_rec + solv_lig)
        energy = (elec + parameters.scoring_vdw_weight * vdw + solv)*-1.
        perc_receptor_restraints = ScoringFunction.restraints_satisfied(receptor.restraints, set(interface_receptor))
        perc_ligand_restraints = ScoringFunction.restraints_satisfied(ligand.restraints, set(interface_ligand))
        return energy + perc_receptor_restraints * energy + perc_ligand_restraints * energy