qiime 本身不提供聚类的算法,它只是对其他聚otu软件的封装
根据聚类软件的算法,分成了3个方向:
de novo:                   pick_de_novo_otus.py 
closed-reference:      pick_closed_reference_otus.py
open-reference OTU: pick_open_reference_otus.py
 
 不同算法的优缺点:
de novo:    pick_de_novo_otus.py 
优点: 所有的reads 都会聚类
缺点:不支持并行,计算速度慢,当reads > 10M 时就会非常慢
使用场景: 研究不常见的marker 基因
 
closed-reference: pick_closed_reference_otus.py
和数据库比对,比对不上数据库的reasd 直接丢掉,数据库中reads 带有taxonpmy 注释, 可以方便的进行taxonomy 注释
优点:完全并行, 速度快;tree 或者taxonomy 注释更好, 数据库中的otu分类效果都很好
缺点: 不能检测数据库中没有的物种
Because reads that don’t hit the reference sequence collection are discarded, your analyses only focus on the diversity that you “already know about”
 
open-reference OTU: pick_open_reference_otus.py
首先和数据库比对,没有比对上的reads 在使用denovo的聚类策略进行聚otu
open-reference OTU 是推荐的聚otu策略
优点: 所有reads都会聚类,部分并行,速度较快
缺点: 当新物种较多时,速度会很慢
 
我们最常用的是open-reference OTU聚类, 对应的脚本是 pick_open_reference_otus.py  
可以看做一个pipieline, 共有6个步骤,其中前4步为OTU 聚类,后2步为产生OTU table 和 聚类的tree
 
Step 1) Prefiltering and picking closed reference OTUs
The first step is an optional prefiltering of the input fasta file to remove
sequences that do not hit the reference database with a given sequence
identity (PREFILTER_PERCENT_ID). This step can take a very long time, so is
disabled by default. The prefilter parameters can be changed with the options:
--prefilter_refseqs_fp
--prefilter_percent_id
This filtering is accomplished by picking closed reference OTUs at the specified
prefilter percent id to produce:
prefilter_otus/seqs_otus.log
prefilter_otus/seqs_otus.txt
prefilter_otus/seqs_failures.txt
prefilter_otus/seqs_clusters.uc
Next, the seqs_failures.txt file is used to remove these failed sequences from
the original input fasta file to produce:
prefilter_otus/prefiltered_seqs.fna
This prefiltered_seqs.fna file is then considered to contain the reads
of the marker gene of interest, rather than spurious reads such as host
genomic sequence or sequencing artifacts
 
首先对序列进行一个预处理,给定一个比对相似度 ,采用close-reference OTU 方法删除输入序列中不能比对上数据库的序列,这一步是可选的
如果执行了预处理,会产生 prefilter_otus/prefiltered_seqs.fna 文件,如果不执行,直接拿 input.fasta 去进行下一步的处理
 
If prefiltering is applied, this step progresses with the prefiltered_seqs.fna.
Otherwise it progresses with the input file. The Step 1 closed reference OTU
picking is done against the supplied reference database. This command produces:
step1_otus/_clusters.uc
step1_otus/_failures.txt
step1_otus/_otus.log
step1_otus/_otus.txt
 
然后采用close-reference OTU的方式聚OTU
 
The representative sequence for each of the Step 1 picked OTUs are selected to
produce:
step1_otus/step1_rep_set.fna
 
Next, the sequences that failed to hit the reference database in Step 1 are
filtered from the Step 1 input fasta file to produce:
step1_otus/failures.fasta
 
Then the failures.fasta file is randomly subsampled to PERCENT_SUBSAMPLE of
the sequences to produce:
step1_otus/subsampled_failures.fna.
Modifying PERCENT_SUBSAMPLE can have a big effect on run time for this workflow,
but will not alter the final OTUs.
 
对于没能比对上数据库的read, 会生成 step1_otus/failures.fasta 文件,同时随机抽取一部分reads, 产生step1_otus/subsampled_failures.fna 文件
修改 PERCENT_SUBSAMPLE 参数,可以加速运行时间
 
 
 
Step 2) The subsampled_failures.fna are next clustered de novo, and each cluster
centroid is then chosen as a "new reference sequence" for use as the reference
database in Step 3, to produce:
step2_otus/subsampled_seqs_clusters.uc
step2_otus/subsampled_seqs_otus.log
step2_otus/subsampled_seqs_otus.txt
step2_otus/step2_rep_set.fna
 
对于第一步产生的step1_otus/subsampled_failures.fna 文件,使用denovo 聚类的方式对这部分序列聚类,产生新的参考序列
 
Step 3) Pick Closed Reference OTUs against Step 2 de novo OTUs
Closed reference OTU picking is performed using the failures.fasta file created
in Step 1 against the 'reference' de novo database created in Step 2 to produce:
step3_otus/failures_seqs_clusters.uc
step3_otus/failures_seqs_failures.txt
step3_otus/failures_seqs_otus.log
step3_otus/failures_seqs_otus.txt
 
用step1_otus/failures.fasta 比对step2_otus/step2_rep_set.fna 进行比对
 
Assuming the user has NOT passed the --suppress_step4 flag:
The sequences which failed to hit the reference database in Step 3 are removed
from the Step 3 input fasta file to produce:
step3_otus/failures_failures.fasta
 
没有比对上的序列会产生step3_otus/failures_failures.fasta 文件
 
 
Step 4) Additional de novo OTU picking
It is assumed by this point that the majority of sequences have been assigned
to an OTU, and thus the sequence count of failures_failures.fasta is small
enough that de novo OTU picking is computationally feasible. However, depending
on the sequences being used, it might be that the failures_failures.fasta file
is still prohibitively large for de novo clustering, and the jobs might take
too long to finish. In this case it is likely that the user would want to pass
the --suppress_step4 flag to avoid this additional de novo step.
 
A final round of de novo OTU picking is done on the failures_failures.fasta file
to produce:
step4_otus/failures_failures_cluster.uc
step4_otus/failures_failures_otus.log
step4_otus/failures_failures_otus.txt
 
用第三步产生failures_failures.fasta 文件再次聚OTU
 
Step 5) Produce the final OTU map and rep set
If Step 4 is completed, the OTU maps from Step 1, Step 3, and Step 4 are
concatenated to produce:
final_otu_map.txt
 
如果第四步执行了的话,将1,3,4 产生的map 文件合并起来,产生final_otu_map.txt 文件
 
If Step 4 was not completed, the OTU maps from Steps 1 and Step 3 are
concatenated together to produce:
final_otu_map.txt
 
如果第四步没有执行,将1,3产生的map 文件合并起来,产生final_otu_map.txt 文件
 
Next, the minimum specified OTU size required to keep an OTU is specified with
the --min_otu_size flag. For example, if the user left the --min_otu_size as the
default value of 2, requiring each OTU to contain at least 2 sequences, the any
OTUs which failed to meet this criteria would be removed from the
final_otu_map.txt to produce:
final_otu_map_mc2.txt
 
If --min_otu_size 10 was passed, it would produce:
final_otu_map_mc10.txt
 
The final_otu_map_mc2.txt is used to build the final representative set:
rep_set.fna
 
-min_otu_size 对OTU进行过滤,产生final_otu_map_mc2.txt 文件已经对应的代表序列 rep_set.fna
 
Step 6) Making the OTU tables and trees
An OTU table is built using the final_otu_map_mc2.txt file to produce:
otu_table_mc2.biom
 
由final_otu_map_mc2.txt 产生 otu_table_mc2.biom OTU table
 
As long as the --suppress_taxonomy_assignment flag is NOT passed,
then taxonomy will be assigned to each of the representative sequences
in the final rep_set produced in Step 5, producing:
rep_set_tax_assignments.log
rep_set_tax_assignments.txt
This taxonomic metadata is then added to the otu_table_mc2.biom to produce:
otu_table_mc_w_tax.biom
 
对otu 代表序列进行 taxonomy 注释, 产生 otu_table_mc_w_tax.biom 文件
 
As long as the --suppress_align_and_tree is NOT passed, then the rep_set.fna
file will be used to align the sequences and build the phylogenetic tree,
which includes the de novo OTUs. Any sequences that fail to align are
omitted from the OTU table and tree to produce:
otu_table_mc_no_pynast_failures.biom
rep_set.tre
 
对otu代表序列进行多序列比对,构建进化树, 产生 rep_set.tre 文件
 
If both --suppress_taxonomy_assignment and --suppress_align_and_tree are
NOT passed, the script will produce:
otu_table_mc_w_tax_no_pynast_failures.biom
 
It is important to remember that with a large workflow script like this that
the user can jump into intermediate steps. For example, imagine that for some
reason the script was interrupted on Step 2, and the user did not want to go
through the process of re-picking OTUs as was done in Step 1. They can simply
rerun the script and pass in the:
--step_1_otu_map_fp
--step1_failures_fasta_fp
parameters, and the script will continue with Steps 2 - 4.
 
对于大型的脚本,要求可以在大致的步骤之间跳转,不执行前面的步骤
 
**Note:** If most or all of your sequences are failing to hit the reference
during the prefiltering or closed-reference OTU picking steps, your sequences
may be in the reverse orientation with respect to your reference database. To
address this, you should add the following line to your parameters file
(creating one, if necessary) and pass this file as -p:
 
pick_otus:enable_rev_strand_match True
 
Be aware that this doubles the amount of memory used in these steps of the
workflow.
 
如果原始序列中有很大一部分序列,没有比对上数据库中的序列,可能的原因是输入序列与数据库中的是反向互补的,可以添加 pick_otus:enable_rev_strand_match True 参数
但是这个参数会导致内存加倍
 
基本用法:
pick_open_reference_otus.py -i $PWD/seqs1.fna -r $PWD/refseqs.fna -o $PWD/ucrss_sortmerna_sumaclust/ -p $PWD/ucrss_smr_suma_params.txt -m sortmerna_sumaclust
 
-i  : 输入的原始序列,fasta格式
-r : 数据库中的序列,fasta格式, 默认采用的是 greengene /usr/local/lib/python2.7/site-packages/qiime_default_r eference/gg_13_8_otus/rep_set/97_otus.fasta
-o : 输出结果的目录 
-p : 参数对应的文件
-m : 聚类的软件,可选的有'uclust', 'usearch61', 'sortmerna_sumaclust', 默认为 uclust

QIIME1 聚OTU的更多相关文章

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

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

  2. QIIME2使用方法

    激活qiime2的执行环境:source activate qiime2-2019.4如何查看conda已有的环境:conda info -e 以下分析流程参考:https://docs.qiime2 ...

  3. Oracle索引梳理系列(九)- 浅谈聚簇因子对索引使用的影响及优化方法

    版权声明:本文发布于http://www.cnblogs.com/yumiko/,版权由Yumiko_sunny所有,欢迎转载.转载时,请在文章明显位置注明原文链接.若在未经作者同意的情况下,将本文内 ...

  4. oracle的散列聚簇表

    在簇表中,Oracle使用存储在索引中的键值来定位表中的行, 而在散列聚簇表中,使用了散列函数代替了簇索引,先通过内部函数或者自定义的函数进行散列计算,然后再将计算得到的码值用于定位表中的行. 创建散 ...

  5. 机器学习实战5:k-means聚类:二分k均值聚类+地理位置聚簇实例

    k-均值聚类是非监督学习的一种,输入必须指定聚簇中心个数k.k均值是基于相似度的聚类,为没有标签的一簇实例分为一类. 一 经典的k-均值聚类 思路: 1 随机创建k个质心(k必须指定,二维的很容易确定 ...

  6. 聚簇(Cluster)和聚簇表(Cluster Table)

    聚簇(Cluster)和聚簇表(Cluster Table) 时间:2010-03-13 23:12来源:OralanDBA.CN 作者:AlanSawyer 点击:157次 1.创建聚簇 icmad ...

  7. MDCC为移动开发者服务:一看、一聊、一聚

    MDCC为移动开发者服务:一看.一聊.一聚-CSDN.NET     MDCC为移动开发者服务:一看.一聊.一聚    发表于2013-11-05 20:54| 2698次阅读| 来源CSDN| 6 ...

  8. 聚币网API[Python2版]

    聚币 现货 API [Python2版] 一.utils.py,基础类,包括HTTP 请求.签名等 # -*- coding: utf-8 -*- import hashlib import hmac ...

  9. 聚簇(或者叫做聚集,cluster)索引和非聚簇索引

    字典的拼音目录就是聚簇(cluster)索引,笔画目录就是非聚簇索引.这样查询“G到M的汉字”就非常快,而查询“6划到8划的字”则慢. 聚簇索引是一种特殊索引,它使数据按照索引的排序顺序存放表中.聚簇 ...

随机推荐

  1. 常用查找算法(Java)

    常用查找算法(Java) 2018-01-22 1 顺序查找 就是一个一个依次查找 2 二分查找 二分查找(Binary Search)也叫作折半查找. 二分查找有两个要求, 一个是数列有序, 另一个 ...

  2. C# 实现list=list.OrderBy(q=>q.字段名).ToList(); 按多个字段排序

    //倒序 list.OrderByDescending(i => i.a).ThenByDescending(i => i.b); //顺序 list.OrderBy(i => i. ...

  3. Android开发(六)——组件颜色Selector(Selector与Shape的基本用法 )

    andorid控件改变状态时改变颜色,使用selector. <?xml version="1.0" encoding="utf-8" ?> < ...

  4. How To Set Up SSH Keys

    How To Set Up SSH Keys.https://www.digitalocean.com/community/tutorials/how-to-set-up-ssh-keys--2

  5. C++中的new、operator new与placement new

    转:http://www.cnblogs.com/luxiaoxun/archive/2012/08/10/2631812.html new/delete与operator new/operator ...

  6. docker打开api remote接口设置

    前言  本文记录docker怎么打开api remote接口设置,docker的版本更新太快了,不同的版本之间,设置可能不同,本文是针对docker13.1 1. 查看配置文件位于哪里 systemc ...

  7. TCP 和 UDP 在socket编程中的区别(转)

    一.TCP与UDP的区别 基于连接与无连接  对系统资源的要求(TCP较多,UDP少)  UDP程序结构较简单  流模式与数据报模式  TCP保证数据正确性,UDP可能丢包  TCP保证数据顺序,UD ...

  8. 微信web开发者工具同时打开两个小程序项目

    在写小程序时,想要一边参考别人的Demo一边做,但是微信web开发者工具无法同时开两个实例,怎么办? 单个软件实例来回切换打开的项目太麻烦,一种办法是同时下载[微信web开发者工具]和[微信web开发 ...

  9. Virtools元素、类和面向对象设计

    无意中发现了在某个不存在的网站( https://sites.google.com )上,还存有09年写的一些半成品教材,下面这篇文章就是其中一部分. 概述 Virtools将元素(Element)组 ...

  10. linux异步IO--aio

    简述 linux下异步方式有两种:异步通知和异步IO(AIO),异步通知请参考:linux异步通知 Linux的I/O机制经历了一下几个阶段的演进: 1. 同步阻塞I/O: 用户进程进行I/O操作,一 ...