How to use the lightdock.scoring.functions.ModelAdapter.load_reference_points 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 / sipper / driver.py View on Github external
for atom_index, atom in enumerate(atoms):
            res_id = "%s.%s.%s" % (atom.chain_id, atom.residue_name, str(atom.residue_number))
            if restraints and res_id in restraints:
                try:
                    parsed_restraints[res_id].append(atom_index)
                except:
                    parsed_restraints[res_id] = [atom_index]

        oda_values = SIPPERAdapter._read_oda_values(molecule)
        if oda_values:
            oda_values = np.array(oda_values)
        else:
            # Dummy value, for performance
            oda_values = np.array([0.0 for _ in range(len(molecule.residues))])

        reference_points = ModelAdapter.load_reference_points(molecule)

        try:
            return SIPPERModel(atoms, coordinates, parsed_restraints, energy, indexes, atoms_per_residue, oda_values,
                               reference_points=reference_points, n_modes=molecule.n_modes.copy())
        except AttributeError:
            return SIPPERModel(atoms, coordinates, parsed_restraints, energy, indexes, atoms_per_residue, oda_values,
                               reference_points=reference_points)
github brianjimenez / lightdock / lightdock / scoring / sd / driver.py View on Github external
parsed_restraints[res_id].append(atom_index)
                except:
                    parsed_restraints[res_id] = [atom_index]
            atom_id = "%s-%s" % (res_name, atom.name)
            atom.amber_type = amber_types[atom_id]
            atom.charge = charges[atom_id]
            atom.mass = masses[atom.amber_type]
            atom.vdw_energy = vdw.vdw_energy[atom.amber_type]
            atom.vdw_radius = vdw.vdw_radii[atom.amber_type]

        # Prepare common model information
        elec_charges = np.array([atom.charge for atom in atoms])
        vdw_energies = np.array([atom.vdw_energy for atom in atoms])
        vdw_radii = np.array([atom.vdw_radius for atom in atoms])
        coordinates = molecule.copy_coordinates()
        reference_points = ModelAdapter.load_reference_points(molecule)
        try:
            return SDModel(atoms, coordinates, parsed_restraints, elec_charges, vdw_energies, vdw_radii,
                           reference_points=reference_points, n_modes=molecule.n_modes.copy())
        except AttributeError:
            return SDModel(atoms, coordinates, parsed_restraints, elec_charges, vdw_energies, vdw_radii,
                           reference_points=reference_points)
github brianjimenez / lightdock / lightdock / scoring / cpydock / driver.py View on Github external
des_radii_no_H.append(des_radii[i])
        structure.setRadii(list(des_radii_no_H))
        sasa_result = freesasa.calc(structure)
        sasa = []
        j = 0
        for i, atom in enumerate(atoms):
            if not atom.is_hydrogen():
                sasa.append(sasa_result.atomArea(j))
                j += 1
            else:
                sasa.append(-1.0)
        sasa = np.array(sasa)
        hydrogens = np.array([0 if atom.is_hydrogen() else 1 for atom in atoms])
        log.info('Done.')

        reference_points = ModelAdapter.load_reference_points(molecule)
        try:
            return CPyDockModel(atoms, coordinates, parsed_restraints, elec_charges, vdw_energies, vdw_radii, des_energy, des_radii,
                                sasa, hydrogens, reference_points=reference_points, n_modes=molecule.n_modes.copy())
        except AttributeError:
            return CPyDockModel(atoms, coordinates, parsed_restraints, elec_charges, vdw_energies, vdw_radii, des_energy, des_radii,
                                sasa, hydrogens, reference_points=reference_points)
github brianjimenez / lightdock / lightdock / scoring / vdw / driver.py View on Github external
parsed_restraints[res_id].append(atom_index)
                except:
                    parsed_restraints[res_id] = [atom_index]
            atom_id = "%s-%s" % (res_name, atom_name)
            atom.amber_type = amber.amber_types[atom_id]
            atom.charge = amber.charges[atom_id]
            atom.mass = amber.masses[atom.amber_type]
            atom.vdw_energy = vdw.vdw_energy[atom.amber_type]
            atom.vdw_radius = vdw.vdw_radii[atom.amber_type]

        # Prepare common model information
        vdw_energies = np.array([atom.vdw_energy for atom in atoms])
        vdw_radii = np.array([atom.vdw_radius for atom in atoms])
        coordinates = molecule.copy_coordinates()

        reference_points = ModelAdapter.load_reference_points(molecule)

        try:
            return VdWModel(atoms, coordinates, parsed_restraints, vdw_energies, vdw_radii,
                            reference_points=reference_points, n_modes=molecule.n_modes.copy())
        except AttributeError:
            return VdWModel(atoms, coordinates, parsed_restraints, vdw_energies, vdw_radii, 
                            reference_points=reference_points)
github brianjimenez / lightdock / lightdock / scoring / dna / driver.py View on Github external
try:
                atom.charge = amber.charges[atom_id]
            except:
                # Go for N-terminal
                atom.charge = amber.nt_charges[atom_id]
            atom.mass = amber.masses[atom.amber_type]
            atom.vdw_energy = vdw.vdw_energy[atom.amber_type]
            atom.vdw_radius = vdw.vdw_radii[atom.amber_type]

        # Prepare common model information
        elec_charges = np.array([atom.charge for atom in atoms])
        vdw_energies = np.array([atom.vdw_energy for atom in atoms])
        vdw_radii = np.array([atom.vdw_radius for atom in atoms])
        coordinates = molecule.copy_coordinates()

        reference_points = ModelAdapter.load_reference_points(molecule)

        try:
            return DNAModel(atoms, coordinates, parsed_restraints, elec_charges, vdw_energies, vdw_radii,
                                    reference_points=reference_points, n_modes=molecule.n_modes.copy())
        except AttributeError:
            return DNAModel(atoms, coordinates, parsed_restraints, elec_charges, vdw_energies, vdw_radii,
                                    reference_points=reference_points)