微生物16S的OTU聚类工具有很多,最常用的就是 usearch、cdhit-OTU、mothur。

这些工具大多都是针对二代测序平台的,usearch的64bit版本是收费的。

如果要跑PacBio的OTU聚类,目前就只能用 mothur 了。

mothur有着非常详细的说明文档!


以下转载一篇教程:原文链接:http://blog.sina.com.cn/s/blog_80572f5d0101ac2v.html

mothur 用来处理高通量测序结果或者克隆文库的序列处理,这里进行OTU分类,就是排除克隆测序结果的重复序列,以97%的 相似度进行分类,即cutoff=0.03

版本:mothur v.1.25.1  Last updated: 5/14/2012

mothur > unique.seqs(fasta=*.fasta)

Output File Names:
*.unique.fasta
*.names

mothur > align.seqs(candidate=*.unique.fasta,template=tmp.fasta,flip=T,processors=2)

Reading in the tmp.fasta template sequences...  DONE.
It took 0 to read  1 sequences.
Aligning sequences from *.unique.fasta ...

Reading in the tmp.fasta template sequences...  DONE.
It took 0 to read  1 sequences.
Some of your sequences generated alignments that eliminated too many bases, a list is provided in *.unique.flip.accnos. If the reverse compliment proved to be better it was reported.
It took 1 secs to align *** sequences.

Output File Names:
*.unique.align
*.unique.align.report
*.unique.flip.accnos

mothur > filter.seqs(fasta=*.unique.align)

Length of filtered alignment: ***

Number of columns removed: 0

Length of the original alignment: ***

Number of sequences used to construct filter: ***

Output File Names:
*.filter
*.unique.filter.fasta

mothur > dist.seqs(fasta=*.unique.filter.fasta,calc=onegap,countends=F,cutoff=0.03,output=lt)

Output File Name: g5gta.unique.filter.phylip.dist

It took 0 to calculate the distances for *** sequences.

mothur > cluster(phylip=*.unique.filter.phylip.dist,method=furthest,cutoff=0.03)

********************#****#****#****#****#****#****#****#****#****#****#
Reading matrix:  ||||||||||||||||||||||||||||||||||||||||||||||||||||
***********************************************************************
unique  2  124  2
0.01  3  89  15  3
0.02  5  69  7  10  0  3
0.03  8  60  7  7  3  1  0  0  2

Output File Names:
*.unique.filter.phylip.fn.sabund
*.unique.filter.phylip.fn.rabund
*.unique.filter.phylip.fn.list

It took 0 seconds to cluster

mothur > bin.seqs(fasta=*.fasta,name=*.names)

Using *.unique.filter.phylip.fn.list as input file for the list parameter.
unique
0.01
0.02
0.03

Output File Names:
*.unique.filter.phylip.fn.unique.fasta
*.unique.filter.phylip.fn.0.01.fasta
*.unique.filter.phylip.fn.0.02.fasta
*.unique.filter.phylip.fn.0.03.fasta

mothur > get.oturep(phylip=*.unique.filter.phylip.dist,fasta=*.fasta,list=*.unique.filter.phylip.fn.list,label=0.03)

********************#****#****#****#****#****#****#****#****#****#****#
Reading matrix:  ||||||||||||||||||||||||||||||||||||||||||||||||||||
***********************************************************************
0.03  80

Output File Names:
*.unique.filter.phylip.fn.0.03.rep.names
*.unique.filter.phylip.fn.0.03.rep.fasta

总结


mothur下载地址:http://www.mothur.org/wiki/Download_mothur
支持Mac,Windows以及Linux操作系统
首先要打开mothur -----cmd,进入命令行界面cd xxx 进入mothur.exe目录,输入mothur.exe 回车
假设该目录内fasta格式文件叫做 Great.fasta
那么使用如下命令处理:

1.mothur > unique.seqs(fasta=Great.fasta)
2.mothur > dist.seqs(fasta=Great.unique.fasta,calc=onegap,countends=F,cutoff=0.03,output=lt)
3.mothur > cluster(phylip=Great.unique.phylip.dist,method=furthest,cutoff=0.03)
4.mothur > bin.seqs(fasta=Great.fasta,name=Great.names)
5.mothur > get.oturep(phylip=Great.unique.phylip.dist,fasta=Great.unique.fasta,list=Great.unique.phylip.fn.list,label=0.03)

最后打开Great.phylip.fn.0.03.rep.fasta 查看各OTU 的数目即可,即每个序列名最后的数字。
另外,还可以看到有多少个OTUs
Great.unique.phylip.fn.0.03.rep.names 这个文件显示了每个OTU都有哪些序列,可以用记事本打开

Great.unique.phylip.fn.list 这个文件显示了unique_0.01_0.02_0.03 分别有哪些类型的OTU,每一组用空格或Tab隔开,每组OTU内的各序列用"," 隔开。

注意,cluster命令能读取phylip矩阵,也能读取column矩阵,如果读取的是column,还需要提供一个names文件。 另外,用unique.seqs命令,是为了生成names文件
如果在运行第1步的时候,提示[ERROR]:your sequences are not the same length, aborting.

那么需要运行一下命令:

先提供一个template fasta文件,以以上fasta文件中序列长度最普遍的某个为序列模板,新建一个fasta,命名为temp.fasta

a. mothur > unique.seqs(fasta=Great.fasta)
b. mothur > align.seqs(candidate=Great.unique.fasta,template=temp.fasta,flip=T,processors=2)
c. mothur > filter.seqs(fasta=Great.unique.align)

再把这里生成的Great.unique.filter.fasta文件更名为Great.fasta 进行以上5步处理。(尽量在一个新的mothur目录内,打开一个新的mothur窗口,以免文件名冲突)

命令详情


unique.seqs

identify the unique sequences in a collection and generate a names file

找出fasta文件中独一无二的序列,即去冗余,在二代中有很多一模一样的冗余序列,需要首先去掉,而在三代中这一步可以不跑。

这一步生成 All_Sample.unique.fasta 和 All_Sample.names

align.seqs

align sequences against a reference alignment 比对到ref上,等于是多重比对

The default threshold is 0.50, meaning if 50% of the bases are removed in the alignment process. The flip parameter is used to specify whether or not you want mothur to try the reverse complement of a sequence if the sequence falls below the threshold. The default is false. If the flip parameter is set to true the reverse complement of the sequence is aligned and the better alignment is reported.

template means ref

这一步生成 All_Sample.unique.align 、 All_Sample.unique.align.report 、 All_Sample.unique.flip.accnos

filter.seqs

filter positions out of an alignment 过滤

we can probably remove a lot of positions from the alignment to speed up our distance calculations.

加速距离计算

dist.seqs

generate a pairwise distance matrix,生成双序列比对距离矩阵

This approach is better than the commonly used DNADIST because the distances are not stored in RAM, rather they are printed directly to a file. Furthermore, it is possible to ignore "large" distances that one might not be interested in.

得到了序列两两之间的距离

cluster

clustering sequences into OTUs based on genetic distance 遗传距离

有多种聚类方法,选哪一种好呢?

The methods available in mothur include opticlust (opti), average neighbor (average), furthest neighbor (furthest), nearest neighbor (nearest), Vsearch agc (agc), Vsearch dgc (dgc). By default cluster() uses the opticlust algorithm.

bin.seqs

identify the OTU that each sequence belongs to

prints out a fasta-formatted file where sequences are ordered according to the OTU that they belong to. Such an output may be helpful for generating primers specific to an OTU or for classification of sequences.

get.oturep

identify a representative sequence from each OTU

While the bin.seqs command reports the OTU number for all sequences, the get.oturep command generates a fasta-formatted sequence file containing only a representative sequence for each OTU.

使用mothur进行OTU聚类的更多相关文章

  1. OTU(operational taxonomic units),即操作分类单元

    转自http://www.dxy.cn/bbs/topic/35655953 1.OTU是什么? OTU(operational taxonomic units),即操作分类单元.通过一定的距离度量方 ...

  2. QIIME1 聚OTU

    qiime 本身不提供聚类的算法,它只是对其他聚otu软件的封装 根据聚类软件的算法,分成了3个方向: de novo:                   pick_de_novo_otus.py  ...

  3. 扩增子分析QIIME2-4分析实战Moving Pictures

    本示例的的数据来自文章<Moving pictures of the human microbiome>,Genome Biology 2011,取样来自两个人身体四个部位五个时间点   ...

  4. 扩增子分析解读5物种注释 OTU表操作

    本节课程,需要先完成<扩增子分析解读>系列之前的操作 1质控 实验设计 双端序列合并 2提取barcode 质控及样品拆分 切除扩增引物 3格式转换 去冗余 聚类 4去嵌合体 非细菌序列 ...

  5. 扩增子分析解读4去嵌合体 非细菌序列 生成代表性序列和OTU表

    本节课程,需要先完成 扩增子分析解读1质控 实验设计 双端序列合并 2提取barcode 质控及样品拆分 切除扩增引物 3格式转换 去冗余 聚类   先看一下扩增子分析的整体流程,从下向上逐层分析 分 ...

  6. 扩增子图表解读3热图:差异菌、OTU及功能

    热图是使用颜色来展示数值矩阵的图形.通常还会结合行.列的聚类分析,以表达实验数据多方面的结果.  热图在生物学领域应用广泛,尤其在高通量测序的结果展示中很流行,如样品-基因表达,样品-OTU相对丰度矩 ...

  7. 用scikit-learn学习谱聚类

    在谱聚类(spectral clustering)原理总结中,我们对谱聚类的原理做了总结.这里我们就对scikit-learn中谱聚类的使用做一个总结. 1. scikit-learn谱聚类概述 在s ...

  8. 谱聚类(spectral clustering)原理总结

    谱聚类(spectral clustering)是广泛使用的聚类算法,比起传统的K-Means算法,谱聚类对数据分布的适应性更强,聚类效果也很优秀,同时聚类的计算量也小很多,更加难能可贵的是实现起来也 ...

  9. 用scikit-learn学习DBSCAN聚类

    在DBSCAN密度聚类算法中,我们对DBSCAN聚类算法的原理做了总结,本文就对如何用scikit-learn来学习DBSCAN聚类做一个总结,重点讲述参数的意义和需要调参的参数. 1. scikit ...

随机推荐

  1. VS2010/MFC编程入门之三十八(状态栏的使用详解)

    上一节中鸡啄米讲了工具栏的创建.停靠与使用,本节来讲解状态栏的知识. 状态栏简介 状态栏相信大家在很多窗口中都能见到,它总是用来显示各种状态.状态栏实际上也是一个窗口,一般分为几个窗格,每个窗格分别用 ...

  2. 20154312 曾林 ExpFinal CTF Writeup

    0.写在前面 1.不合理的验证方式 2.加密与解密的对抗 3.一个SQL引发的血案 4.管理员的诟病 5.备份信息的泄露 6.svn信息泄露 7.coding 8.平衡权限的威胁 9.文件上传的突破 ...

  3. mvn deploy 推送到私有仓库,注意当前日期

    由于更改了本机系统时间到过去的一个时间,导致mvn deploy推送到私有仓库后,该更新的jar包时间戳比较旧,客户端不能更新得到新的jar包.

  4. mariadb 10.1查看per connection内存消耗

    在mariadb 10.1版本中,在information_schema.processlist表中,新增了几个字段,其中有一个memory_used,其记录的是连接的内存消耗. 同时新增了一个状态变 ...

  5. JavaScript 实现省市二级联动

    JavaScript 实现省市二级联动 版权声明:未经授权,严禁转载! 案例代码 <style> .hide { display: none; } </style> <s ...

  6. laravel 对接支付宝

    使用的库 omnipay-alipay 申请支付宝支付 这个就不说了, 不明白如何下手的伙伴让运营去和支付宝客服联系吧 composer 安装git库 将以下代码添加到 composer.json { ...

  7. 20145337《网络对抗技术》MSF基础应用

    20145337<网络对抗技术>MSF基础应用 一.实验后回答问题 什么是exploit.payload.encode Metasploit这种模块化的设计,大大提高了代码的复用率.exp ...

  8. Linux命令中:rsync和cp之间的区别

    rsync:只拷贝那些更新的文件: cp -u:也可以实现类似效果: 两者都基本可以满足备份的需求: 只是一般情况下,用rsync做这类备份之类的事情,更多见: 在备份的操作中,拷贝,过期文件的删除是 ...

  9. POJ 2975 Nim(博弈)题解

    题意:已知异或和为0为必败态,异或和不为0为必胜态,问你有几种方法把开局从当前状态转为必败态. 思路:也就是说,我们要选一堆石头,然后从这堆石头拿走一些使剩下的石碓异或和为0.那么只要剩下石堆的异或和 ...

  10. BZOJ2563: 阿狸和桃子的游戏 贪心

    Description 阿狸和桃子正在玩一个游戏,游戏是在一个带权图G=(V, E)上进行的,设节点权值为w(v),边权为c(e).游戏规则是这样的: 1. 阿狸和桃子轮流将图中的顶点染色,阿狸会将顶 ...