AAI计算
EzAAI
EzAAI可用于批量计算细菌基因组之间的氨基酸一致性amino acid identity(AAI)。软件地址:github.com/endixk/ezaai
EzAAI安装
conda install -c bioconda -y ezaai
ezaai -h
准备输入文件
将准备的基因组fasta放置于seq文件夹中,运行如下脚本将其转化为msd文件,存放于DBs目录
#!/bin/bash
# 创建DBs目录,如果它不存在的话
mkdir -p DBs
# 遍历seq目录中的所有.fasta文件
for fasta_file in seq/*.fasta; do
echo "Processing: $fasta_file"
# 使用basename获取不带路径的文件名
base_name=$(basename "$fasta_file" .fasta)
# 构建输出文件名
output_file="DBs/${base_name}.msd"
# 运行EzAAI程序,并添加错误处理
if ezaai extract -i "$fasta_file" -o "$output_file" -l "$fasta_file"; then
echo "Successfully processed $fasta_file"
else
echo "Error occurred while processing $fasta_file"
fi
done
echo "Done processing all files."
计算AAI值
多对多计算:ezaai calculate -i DBs -j DBs -o AAI.tsv
一对多计算:ezaai calculate -i DBs/D3.msd -j DBs -o AAI.tsv 将-i参数后面替换为相应的菌株msd文件即可
进化树构建: ezaai cluster -i AAI.tsv -o tree.nwk 仅在多对多模式下可以构建进化树
项目整体文件结构
.
├── AAI.tsv
├── DBs
│ ├── D3.msd
│ ├── GCA_000282115.1.msd
│ ├── GCA_000520835.1.msd
│ ├── GCA_000708615.2.msd
│ ├── GCA_007474535.1.msd
│ ├── GCA_900142445.1.msd
│ ├── GCA_902728305.1.msd
│ ├── GCA_902729325.1.msd
│ └── GCA_905175375.1.msd
├── aai_extract.sh
└── seq
├── D3.fasta
├── GCA_000282115.1.fasta
├── GCA_000520835.1.fasta
├── GCA_000708615.2.fasta
├── GCA_007474535.1.fasta
├── GCA_900142445.1.fasta
├── GCA_902728305.1.fasta
├── GCA_902729325.1.fasta
└── GCA_905175375.1.fasta