Alphafold2的官方目前只支持OpenMM==7.5.1
, 但是目前OpenMM的最新版本已经更新到了7.7.0,如果你使用的是最新版本的OpenMM,则由于最新版本的OpenMM取消了simtk包名前缀,故导致了该问题,所以如果你想继续使用OpenMM==7.7.0
,则你可能需要对alphafold2的代码进行部分的修改
# alphafold/alphafold/relax/utils.py
import io
from alphafold.common import residue_constants
from Bio import PDB
import numpy as np
from simtk.openmm import app as openmm_app --> from openmm import app as openmm_app
from simtk.openmm.app.internal.pdbstructure import PdbStructure --> from openmm.app.internal.pdbstructure import PdbStructure
# alphafold/alphafold/relax/amber_minimize.py
import io
import time
from typing import Collection, Optional, Sequence
from absl import logging
from alphafold.common import protein
from alphafold.common import residue_constants
from alphafold.model import folding
from alphafold.relax import cleanup
from alphafold.relax import utils
import ml_collections
import numpy as np
from simtk import openmm --> import openmm
from simtk import unit --> from openmm import unit
from simtk.openmm import app as openmm_app --> from openmm import app as openmm_app
from simtk.openmm.app.internal.pdbstructure import PdbStructure --> from openmm.app.internal.pdbstructure import PdbStructure
只需要修改上述两个py文件中的代码即可
如果使用Docker方式的话,不仅需要修改上述两个文件的代码,并且还需要删除 alphafold/docker/openmm.patch
这个文件,然后删除或者更新alphafold/docker/Dockerfile
中的OpenMM版本即可。