Skip to content

安装教程

AmberTools 因其只能在Linux下运行,所以可以使用纯linux服务器安装,或WSL、虚拟机等方式在Windows平台安装,这里介绍虚拟机安装的方法。

安装配置虚拟机

推荐使用VMware Workstation Pro程序操作Windows下的虚拟机,并为其安装Ubuntu操作系统。

安装conda

AmberTools 可以通过 Conda 或 源码编译安装,这里最推荐使用conda安装,关于conda的介绍和安装方法可以参考站内相关博客。

安装AmberTools

AmberTools官网在此处,输入以下命令创建一个名为AmberTools24的conda环境,版本号与本机版本一致:

conda create --name AmberTools24 python=3.12

激活该环境:

conda activate AmberTools24

若出现报错,需要激活conda:

CondaError: Run 'conda init' before 'conda activate'

激活conda:

conda init

随后重启命令行界面,重新激活该环境,即可看到前缀由base变成AmberTools24

退出该环境:

conda deactivate

conda下载安装AmberTools24包:

conda install -c conda-forge ambertools=24

激活环境后输入下列命令,加载amber配置文件:

source $CONDA_PREFIX/amber.sh

最后,输入antechamber,检测安装完成(在conda环境中,即标头显示AmberTools24):

(AmberTools24) aether@aether-VMware-Virtual-Platform:~/桌面$ antechamber


Usage: antechamber -i     input file name
                   -fi    input file format
                   -o     output file name
                   -fo    output file format
                   -c     charge method
                   -cf    charge file name
                   -nc    net molecular charge (int)
                   -a     additional file name
                   -fa    additional file format
                   -ao    additional file operation
                          crd   : only read in coordinate
                          crg   : only read in charge
                          radius: only read in radius
                          name  : only read in atom name
                          type  : only read in atom type
                          bond  : only read in bond type 
                   -m     multiplicity (2S+1), default is 1

安装acpype

acpype是一个用于生成化合物拓扑文件的工具,主要用于分子模拟。它是一个基于Python的脚本,能够调用AmberTools中的Antechamber生成Amber格式的拓扑文件,并将其转换为GROMACS格式。

输入下列命令安装acpype:

conda install -c conda-forge acpype

安装完成后,输入acpype,若输入下列内容,即说明安装成功:

============================================================================    
| ACPYPE: AnteChamber PYthon Parser interfacE v. 2023.10.27 (c) 2025 AWSdS |    
============================================================================    
usage:                                                                          
    acpype -i _file_ | _SMILES_string_ [-c _string_] [-n _int_] [-m _int_] [-a _string_] [-f] etc. or                                                           
    acpype -p _prmtop_ -x _inpcrd_ [-d | -w]

简单测试

测试 tleap(拓扑生成)

新建一个文件夹,使用下列创建一个测试的tleap输入文件:

cat << EOF > test_tleap.in
source leaprc.protein.ff14SB  # 加载蛋白质力场
mol = sequence { ACE ALA NME } # 构建一个简单的三肽
saveamberparm mol test.prmtop test.inpcrd
quit
EOF

运行tleap命令:

tleap -f test_tleap.in

生成 test.prmtop(拓扑文件)和 ·(坐标文件),且无报错,则证明运行成功

测试 cpptraj(轨迹分析)

创建一个测试的cpptraj输入文件:

cat << EOF > test_cpptraj.in
parm test.prmtop
trajin test.inpcrd
rms first
trajout test.nc netcdf
run
EOF

运行cpptraj命令:

cpptraj -i test_cpptraj.in

生成 test.nc(NetCDF格式轨迹),输出中显示 ACTION COMPLETE,则证明运行成功