安装教程
AmberTools 因其只能在Linux下运行,所以可以使用纯linux服务器安装,或WSL、虚拟机等方式在Windows平台安装,这里介绍虚拟机安装的方法。
安装配置虚拟机
推荐使用VMware Workstation Pro程序操作Windows下的虚拟机,并为其安装Ubuntu操作系统。
安装conda
AmberTools 可以通过 Conda 或 源码编译安装,这里最推荐使用conda安装。
输入下列命令,检测python版本:
python3 --version
输出以下内容则说明python安装正确(具体版本因人而异):
Python 3.12.9
根据电脑系统,下载miniconda文件,这里是Miniconda3-latest-Linux-x86_64.sh
文件,在该文件目录下打开终端,输入下列命令:
sudo ./Miniconda3-latest-Linux-x86_64.sh
此时会出现下列提示:
Welcome to Miniconda3 py312_25.1.1-2
In order to continue the installation process, please review the license
agreement.
Please, press ENTER to continue
按enter确认安装,出现下列阅读条款,一路回车下翻,阅读完该条款:
Please read these Terms of Service carefully before purchasing, using, accessing
, or downloading any Anaconda Offerings (the "Offerings"). These Anaconda Terms
of Service ("TOS") are between Anaconda, Inc. .........
最后出现下列提示,输入yes开始安装:
Do you accept the license terms? [yes|no]
>>>
Please answer 'yes' or 'no':'
根据提示选择安装路径,如果需要更改安装路径,输入目标路径后按回车:
Miniconda3 will now be installed into this location:
/root/miniconda3
- Press ENTER to confirm the location
- Press CTRL-C to abort the installation
- Or specify a different location below
例如安装在 /home/user/minconda3 路径下,输入后回车。安装完成后会显示下列内容:
If you'd prefer that conda's base environment not be activated on startup,
run the following command when conda is activated:
conda config --set auto_activate_base false
You can undo this by running `conda init --reverse $SHELL`? [yes|no]
输入yes,会自动初始化conda,并配置环境变量,随后输出以下内容:
==> For changes to take effect, close and re-open your current shell. <==
Thank you for installing Miniconda3!
若上一步保持保持默认,按回车后显示下列命令说明安装成功:
To install conda's shell functions for easier access, first activate, then:
conda init
Thank you for installing Miniconda3!
此时需要手动写入环境变量,输入以下命令安装vim
编辑器:
sudo apt install vim
输入下列命令。使用vim
编辑器修改配置文件,打开.bashrc
:
vim ~/.bashrc
将下列语句写入最后一行,这里的路径要和之前的保持一致:
export PATH="/home/user/miniconda3/bin:$PATH"
随后执行该命令,载入配置文件,若之前选择了yes,则直接执行此命令即可:
source ~/.bashrc
输入以下命令,手动激活conda:
source ~/miniconda3/bin/activate
重新打开命令行后,输入命令,查看conda安装情况:
conda info --envs
若出现下列内容,则说明安装成功(路径与上文一致):
# conda environments:
#
base * /home/user/miniconda3
安装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:
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,则证明运行成功