mmseqs2进行pdb蛋白质序列聚类分析
mmseqs2
是一款用于搜索和聚类大规模蛋白质和核酸序列集的开源软件套件。
https://github.com/soedinglab/MMseqs2
本示例将运行mmseqs2对pdb数据库的蛋白质序列进行聚类分析。
1. 安装 MMseqs2
conda activate bioinfoconda install -c bioconda mmseqs2
2. 下载pdb序列数据到指定文件夹
wget https://files.rcsb.org/pub/pdb/derived_data/pdb_seqres.txt.gzgunzip pdb_seqres.txt.gz
3. 过滤只有蛋白质的序列
def extract_protein_sequences(input_file, output_file):"""从FASTA文件中提取蛋白质序列并保存到新文件中"""with open(input_file, 'r') as infile, open(output_file, 'w') as outfile:write_seq = False # 标记是否要写序列for line in infile:if line.startswith(">"):# 解析序列头部信息,检查是否是蛋白质if "mol:protein" in lin