cd-hit 是用于蛋白质序列或核酸序列聚类的工具,根据序列的相似度对序列进行聚类以去除冗余的序列,一般用于构建非冗余的数据集用于后续的实验分析。
通常来说,根据序列相似度对序列进行聚类,首先想到的可能是通过计算两两序列之间的相似度对序列进行聚类,这样需要进行all by all的比较,相对来说比较费时,而 cd-hit 软件可以避开all by all比较的问题,大大缩短了运行时间。
cd-hit 是一种贪婪的增量聚类方法,首先对输入的序列根据序列的长短进行排序,并从最长到最短的顺序处理它们。将最长的序列自动的分为第一类并作为第一类的代表序列,然后将剩下的序列与在其之前发现的代表性序列进行比较,根据序列相似性将其归为其中的一类或成为新的一个聚类的代表序列,如此遍历所有序列完成聚类过程。 在默认方式中,序列仅和每一个聚类中的代表性序列(为这类中的最长序列)进行比较而不和这个类中的其他序列进行比对。 在准确模式下,序列会和每个聚类中的所有序列进行比较然后决定是成为新的一类还是归为其中的一类中。
主页:http://weizhong-lab.ucsd.edu/cd-hit/

下载二进制版本:
https://github.com/weizhongli/cdhit/releases
使用:
route="/your_route/Result/script/cd-hit-v4.6.7-2017-0501"
$route/cd-hit \
-i 01_contig/all_contigs_gene.fna \
-o 02_geneset/gene_set \
-c 0.9 \
-n 5 \
-M 50000 \
–d 0 \
-T 8
#-c 0.95 -aS 0.9 -M 0 -d 0 -g 1
#-o uniq.gene.fa -c 0.95 -aS 0.9 -M 0 -d 0 -g 1 -T 30
-i: 预测好的基因
-o:结果路径和前缀
-c: 序列一致性
-aS: 序列覆盖度
-M:内存
-d: 聚类树结果描述
-g: 0聚到第一个,1聚到最相似
## 参数
-i input filename in fasta format
-o output filename
-c sequence identity threshold, default 0.9
-d length of description in .clstr file, default 20
if set to 0, it takes the fasta defline and stops at first space
-M memory limit (in MB) for the program, default 800; 0 for unlimitted;
-T number of threads, default 1; with 0, all CPUs will be used
-n word_length, default 5, see user's guide for choosing it
-aS alignment coverage for the shorter sequence, default 0.0
if set to 0.9, the alignment must covers 90% of the sequence
-g 1 or 0, default 0
by cd-hit's default algorithm, a sequence is clustered to the first
cluster that meet the threshold (fast cluster). If set to 1, the program
will cluster it into the most similar cluster that meet the threshold
(accurate but slow mode)
结果
uniq_gene_samples_uniq.fna.clstr
uniq_gene_samples_uniq.fna
fna是代表性序列文件,fna.clstr是聚类结果树文件,如下,
>Cluster 0
0 2448nt, >k119_200825_3... at +/96.98%
1 2913nt, >k119_1126241_1... at +/99.38%
68 1431nt, >k119_985904_1... at +/99.72%
69 5346nt, >k119_996936_1... at +/99.33%
70 34011nt, >k119_2002789_3... at +/99.57%
71 14445nt, >k119_1149172_3... at +/99.63%
72 48432nt, >k119_1885030_4... *
73 924nt, >k119_874008_1... at +/99.78%
74 360nt, >k119_504652_1... at +/99.44%
>Cluster 1
0 36726nt, >k119_1951693_31... *
1 642nt, >k119_18785_1... at +/99.84%
2 441nt, >k119_108999_1... at +/100.00%
3 546nt, >k119_109225_1... at +/99.82%
4 345nt, >k119_198999_1... at +/100.00%
5 129nt, >k119_78265_1... at -/100.00%
6 402nt, >k119_186177_1... at +/99.75%
7 456nt, >k119_186382_1... at +/100.00%
这里*标记的序列就是代表性序列。
更多:
CD-hit安装及使用
网友评论