conda安装
#由一个多序列fasta文件系统抽样产生多个fasta文件fas = {}id = None#culledpdb.fasta.txt是从dunbrack lab的pisces工具拉出来的对uniprot进行去冗余后的一个fasta文件#sorted_id_len.txt也是,但只包含了序列长度和id号,用excel对序列排序了一遍with open('culledpdb.fasta.txt', 'r') as fh,open('sorted_id_len.txt','r')as fi:for line in fh:if line[0] == '>':header = line[1:].rstrip()id = header.split()[0]fas[id] = ['>'+id+'\n']else:fas[id].append(line)for id, seq in fas.items():fas[id] = ''.join(seq)#print(fas['3H05A'])lines = fi.readlines()for i in range(57,len(lines),115):with open ('%s.fasta' % lines[i].split()[0],'w' ) as fws:fws.write(fas[lines[i].split()[0]])#以下是安装hhblits,前提保证自己的家目录里面已安装conda#创建并切换到软件安装目录mkdir ~/software/hhsuitecd ~/software/hhsuite#创建一个新环境‘hhblits’,并安装hhsuiteconda create -n hhblits -c conda-forge -c bioconda hhsuite#下载数据库,以BFD为例,很大所以-b放后台,-c断点续传mkdir ~/software/hhsuite/databasescd ~/software/hhsuite/databaseswget -b -c -O bfd.tar.gz https://bfd.mmseqs.com/bfd_metaclust_clu_complete_id30_c90_final_seq.sorted_opt.tar.gz#解压数据库,nohup连用&放后台解压,标准输出到tar.lognohup tar -xzvf bfd.tar.gz >tar.log 2>&1 &#完成后,运行hhblits,使用单一序列.fasta搜索出其MSAconda activate hhblitshhblits -i query.fasta -o3am query.a3m -d ~/software/hhsuite/databases/bfd#若是有多个单一序列fasta文件需要运行可使用如下shell,database改成自己的,test100里放了100个fasta(base) [YangSY@mgt ~]$ vim test.sh#! /bin/shfor x in $(ls ~/test100)dohhblits -i ~/test100/$x -o ~/hh_output/"$x".hhr -d ~/databases/scop40done#或者写成一行命令for x in $(ls ~/test100); do hhblits -i ~/test100/$x -o ~/hh_output/"$x".hhr -d ~software/hhsuite/databases/scop40; done#运行sh并查看时间,输出到time.txt/usr/bin/time -o time.txt test.sh
源代码编译
首先:github下载原代码,尽量新的,放到服务器解压,cd到解压后的目录
mkdir build && cd build# 这一步需要加载mpi module,学校hpc的话可以 module add mpi/openmpi/4.0.1/gnu/8.3.0cmake -DCMAKE_INSTALL_PREFIX=. ..make -j 4 && make installexport PATH="$(pwd)/bin:$(pwd)/scripts:$PATH" #只保证在当前终端有效,并没有写进文件# 不写环境路径的话,可以cd到build下使用,将命令的hhblits换成./bin/hhblits,后面接 -i -o什么的
参照
hh-suite user guide 链接
hh-suite github 链接
hh-suite issues 链接
