CD-HIT的使用

继续我的生信笔记系列。从某网站的附带文献中读到该工具,搜索了一下,发现网上的大佬们都在讲如何用它去冗余,相对官方页面的介绍而言很是片面,于是刚好有聚类的需求的我准备对其全体功能做做实验,学习一下由李伟忠博士在伯纳姆研究所(现为桑福德伯纳姆医学研究所)亚当·戈兹克博士的实验室开发的牛工具。据说Uniprot的UniRef数据集就是由CD-HIT创建的。

首先是官方介绍:

CD-HIT是一个非常广泛使用的程序,用于蛋白质或核苷酸序列的聚类和比较。最初由李伟忠博士在伯纳姆研究所(现为桑福德伯纳姆医学研究所)亚当·戈兹克博士的实验室开发,CD-HIT速度非常快,可以处理非常大的数据库。有助于显著减少许多序列分析任务中的计算和手动工作,并有助于理解数据结构和纠正数据集中的偏差。CD-HIT包有CD-HIT、CD-HIT-2D、CD-HIT-EST、CD-HIT-EST-2D、CD-HIT-454、CD-HIT-PARA、PSI-CD-HIT、CD-HIT-OTU、CD-HIT-LAP、CD-HIT-DUP和十几个脚本。
CD-HIT(CD-HIT-EST)将相似的蛋白质(dna)聚集成满足用户定义的相似性阈值的簇。

CD-HIT-2D(CD-HIT-EST-2D)比较2个数据集,并确定db2中与阈值以上的db1相似的序列。

CD-HIT-454从焦磷酸测序读取中识别自然和人工复制品。

CD-HIT-OTU将rRNA标签聚集到OTU中

CD-HIT-DUP从单个或成对的Illumina读取中识别重复项

CD-HIT-LAP识别重叠读取

其他程序和脚本的用法可以在CD-HIT用户指南中找到。CD-HIT目前由在J Craig Venter学院的李博士的团队维护(http://weizhongli-lab.org/)。

cd-hit聚类算法

是一种贪婪的增量聚类方法,首先对输入的序列根据序列的长短进行排序,并从最长到最短的顺序处理它们。将最长的序列自动的分为第一类并作为第一类的代表序列,然后将剩下的序列与在其之前发现的代表性序列进行比较,根据序列相似性将其归为其中的一类或成为新的一个聚类的代表序列,如此遍历所有序列完成聚类过程。 在默认方式中,序列仅和每一个聚类中的代表性序列(为这类中的最长序列)进行比较而不和这个类中的其他序列进行比对。 在准确模式下,序列会和每个聚类中的所有序列进行比较然后决定是成为新的一类还是归为其中的一类中。

下载地址

https://github.com/weizhongli/cdhit

安装

wget https://github.com/weizhongli/cdhit/releases/download/V4.6.8/cd-hit-v4.6.8-2017-1208-source.tar.gz    #下载cd-hit
tar -zxvf cd-hit-v4.6.8-2017-1208-source.tar.gz  #解压
cd cd-hit-v4.6.8-2017-1208
make  #编译
cd cd-hit-auxtools
make #编译

#如果编译失败,可以下载二进制版本,解压就可以使用不用编译
wget https://github.com/weizhongli/cdhit/releases/download/V4.6.7/cd-hit-v4.6.7-2017-0501-Linux-binary.tar.gz  #解压即用,不用编译

各包说明

* cd-hit 		Cluster peptide sequences
* cd-hit-est 		Cluster nucleotide sequences
* cd-hit-2d 		Compare 2 peptide databases
* cd-hit-est-2d 	Compare 2 nucleotide databases
* psi-cd-hit 		Cluster proteins at <40% cutoff
* cd-hit-lap 		Identify overlapping reads
* cd-hit-dup 		Identify duplicates from single or paired Illumina reads
* cd-hit-454 		Identify duplicates from 454 reads
* cd-hit-otu 		Cluster rRNA tags
* cd-hit-para 		Cluster sequences in parallel on a computer cluster
* h-cd-hit 		Hierarchical clustering

cd-hit 的基本用法

cd-hit -i db -o db90 -c 0.9 -n 5 -M 16000 –d 0 -T 8

参数说明

-i 输入文件,fasta格式的序列

-o 输出文件路径和名字

-c 相似性(clustering threshold),0.9表示相似性大于等于90%的为一类

-n 两两序列进行序列比对时选择的 word size

-d 0表示使用 fasta 标题中第一个空格前的字段作为序列名字

-M 16000,16GB RAM

-T 使用的线程数

Choose of word size:

-n 5 for thresholds 0.7 ~ 1.0

-n 4 for thresholds 0.6 ~ 0.7

-n 3 for thresholds 0.5 ~ 0.6

-n 2 for thresholds 0.4 ~ 0.5

psi-cd-hit完成小于40%的蛋白质相似性聚类

psi-cd-hit.pl -i nr60 -o nr30 -c 0.3 # 在用psi-cd-hit完成30%的相似性聚类
cd-hit-2d -i db1 -i2 db2 -o db2novel -c 0.9 -n 5 -d 0 -M 16000 -T 8 # cd-hit-2d的使用

#用于比较两个数据库中的相似性序列,默认识别在 db2 中的序列和 db1 中的序列相似性高于某个阈值的序列,输入是两个 fasta 格式的文件,输出是 db2 中与 db1 不相似的蛋白质序列文件和列出 db1 和 db2 之间相似序列的文件,如果想要输出 db1 中和 db2 中不相似的序列,可以将输入文件 db1 和 db2 的前后位置进行交换。

cd-hit-est -i est_human -o est_human95 -c 0.95 -n 10 -d 0 -M 16000 - T 8 # cd-hit-est的使用,用于核酸序列聚类

#-n 10, 11 for thresholds 0.95 ~ 1.0
-n 8,9 for thresholds 0.90 ~ 0.95
-n 7 for thresholds 0.88 ~ 0.9
-n 6 for thresholds 0.85 ~ 0.88
-n 5 for thresholds 0.80 ~ 0.85
-n 4 for thresholds 0.75 ~ 0.8

cd-hit-est-2d -i db1 -i2 db2 -o db2novel -c 0.95 -n 10 -d 0 -M 16000 - T 8 # cd-hit-est-2d的使用

在线提供CD-HIT服务的Web服务器


CD-HIT套件,现在不提供。

UCSD的CD-HIT服务器也运行最新的CD-HIT包

Gclust服务器。Gclust是一种新的微生物基因组序列聚类工具,它可以处理很长的序列。上述服务去李博士的工具页面就可以点击了,地址不再赘述。

引用文献

如果你使用的话,请不要忘记——

References

The algorithms of CD-HIT and more detailed studies are available from the references below. In addition, if you find CD-HIT useful, please cite ref. #6,#3; if you use the CD-HIT web server, please cite ref. #4; and please cite ref. #5 for CD-HIT-454.

1. "Clustering of highly homologous sequences to reduce the size of large protein database", Weizhong Li, Lukasz Jaroszewski & Adam Godzik Bioinformatics, (2001) 17:282-283. PDF Pubmed Citations

2. "Tolerating some redundancy significantly speeds up clustering of large protein databases", Weizhong Li, Lukasz Jaroszewski & Adam Godzik Bioinformatics, (2002) 18:77-82. PDF Pubmed Citations

3. "Cd-hit: a fast program for clustering and comparing large sets of protein or nucleotide sequences", Weizhong Li & Adam Godzik Bioinformatics, (2006) 22:1658-9. Open access PDF Pubmed Citations

4. Ying Huang, Beifang Niu, Ying Gao, Limin Fu and Weizhong Li. CD-HIT Suite: a web server for clustering and comparing biological sequences. Bioinformatics, (2010). 26:680 PDF Pubmed Citations

5. Beifang Niu, Limin Fu, Shulei Sun and Weizhong Li, Artificial and natural duplicates in pyrosequencing reads of metagenomic data. BMC Bioinformatics, (2010), 11:187 PDF Pubmed Citations

6. Limin Fu, Beifang Niu, Zhengwei Zhu, Sitao Wu and Weizhong Li, CD-HIT: accelerated for clustering the next generation sequencing data. Bioinformatics, (2012), 28 (23): 3150-3152. doi: 10.1093/bioinformatics/bts565. PDF, pubmed.

 

 

 

你可能感兴趣的:(生物信息学,生物信息学)