Skip to content

Commit

Permalink
Using the neater .to_openmm() in the new openff-toolkit
Browse files Browse the repository at this point in the history
  • Loading branch information
bieniekmateusz committed Aug 1, 2023
1 parent 99d04d6 commit bcd4e10
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions fegrow/receptor.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
from copy import deepcopy
from typing import List, Tuple

import parmed
import numpy
from openmmforcefields.generators import SystemGenerator
from pdbfixer import PDBFixer
import parmed
from rdkit import Chem
from rdkit.Geometry.rdGeometry import Point3D
from tqdm import tqdm
from typing_extensions import Literal
from tqdm import tqdm

from .package import RMol
from openmmml import MLPotential

import numpy
from .package import RMol


# fix for new openmm versions
try:
from openmm import app, openmm, unit, Platform
except (ImportError, ModuleNotFoundError):
Expand Down Expand Up @@ -201,10 +201,8 @@ def optimise_in_receptor(
for i, conformer in enumerate(
tqdm(openff_mol.conformers, desc="Optimising conformer: ", ncols=80)
):
# make the ligand coords
lig_vec = unit.Quantity([c.m.tolist() for c in conformer], unit=unit.angstrom)
complex_coords = numpy.concatenate([receptor_coords, conformer.to_openmm()])

complex_coords = receptor_coords + lig_vec
# set the initial positions
simulation.context.setPositions(complex_coords)
# now minimize the energy
Expand Down

0 comments on commit bcd4e10

Please sign in to comment.