转载:https://mp.weixin.qq.com/s?__biz=MzI1MjU5MjMzNA==&mid=2247484731&idx=1&sn=b15fbee5910b36341bf366860ee5df53&scene=21#wechat_redirect

这次给大家带来的是ENCODE project的御用比对软件STAR,ENCODE项目是一个由美国国家人类基因组研究所(NHGRI)在2003年9月发起的一项公共联合研究项目,旨在找出人类基因组中所有功能组件[。这是既完成人类基因组计划后国家人类基因组研究所开始的最重要的项目之一。所有在该项目中产生的数据都会被迅速的在公共数据库中公开。
在我之前的那篇RNA-seq数据分析—-方法学文章的实战练习文章里关于比对软件的比较中STAR也展现了不俗的表现。所以在处理比对时我也考虑了将HISAT2与STAR共同使用,查看它们的表现情况,选取适合的比对工具。


STAR的安装

cd biosoft && mkdir STAR && cd STAR
wget https://github.com/alexdobin/STAR/archive/2.5.3a.tar.gz
tar -xzf 2.5.3a.tar.gz
cd STAR-2.5.3a # for easy use, add bin/ to your PATH

下载需要参考基因组并进行index构建

# downloading dna index fasta file
nohup wget -r -np -nH -nd -R index.html -L ftp://ftp.ensembl.org/pub/release-90/fasta/homo_sapiens/dna_index/ & # download gft annotation file
nohup wget ftp://ftp.ensembl.org/pub/release-90/gtf/homo_sapiens/Homo_sapiens.GRCh38.90.chr_patch_hapl_scaff.gtf.gz & mkdir STAR_index && cd STAR_index
STAR --runMode genomeGenerate --genomeDir ~/reference/STAR_index/ --genomeFastaFiles ~/reference/genome/hg38/Homo_sapiens.GRCh38.dna.toplevel.fa --sjdbGTFfile ~/reference/genome/hg38/Homo_sapiens.GRCh38.90.chr_patch_hapl_scaff.gtf --sjdbOverhang 199 # --sjdbOverhang 数值为reads长度-1
# Mode 为generate
# --genomeFastaFiles --sjdbGTFfile 分别对应fasta文件和GTF文件

STAR的使用

# STAR的manual里面给了最基本的比对参数示例
STAR
--runThreadN NumberOfThreads
--genomeDir /path/to/genomeDir
--readFilesIn /path/to/read1 [/path/to/read2 ] # 基本示例,
针对fastq.gz文件增加--readFilesCommand gunzip -c 参数/--readFilesCommand zcat参数,针对bzip2文件使用--readFilesCommand bunzip2 -c参数
STAR --runThreadN 20 --genomeDir ~/reference/STAR_index/ --readFilesCommand zcat --readFilesIn ~/RNA-seq/LiuPing_data/RNA-seq/SC_w2q20m35_N_1.fq.gz ~/RNA-seq/LiuPing_data/RNA-seq/SC_w2q20m35_N_2.fq.gz # 输出unsorted or sorted bam file
--outSAMtype BAM Unsorted 实际上就是-name 的sort,下游可以直接接HTSeq
--outSAMtype BAM SortedByCoordinate
--outSAMtype BAM Unsorted SortedByCoordinate 两者都输出

额外参数说明

# 单独指定注释文件,而不用在构建的时候使用
--sjdbGTFfile /path/to/ann.gtf
--sjdbFileChrStartEnd /path/to/sj.tab # ENCODE参数 # 减少伪junction的几率
--outFilterType BySJout # 最多允许一个reads被匹配到多少个地方
--outFilterMultimapNmax 20 # 在未有注释的junction区域,最低允许突出多少个bp的单链序列
--alignSJoverhangMin 8 # 在有注释的junction区域,最低允许突出多少个bp的单链序列
--alignSJDBoverhangMin 1 # 过滤掉每个paired read mismatch数目超过N的数据,999代表着忽略这个过滤
--outFilterMismatchNmax 999 # 相对paired read长度可以允许的mismatch数目,如果read长度为100,数值设定为0.04,则会过滤掉100*2*0.04=8个以上的数据
--outFilterMismatchNoverReadLmax 0.04 # 最小的intro长度
--alignIntronMin 20 # 最大的intro长度
--alignIntronMax 1000000 # maximum genomic distance between mates,翻译不出来,自行理解
--alignMatesGapMax 1000000

STAR的输出

STAR可以根据你的参数设定输出多个结果文件,包含各种信息,下面对默认参数情况下的输出文件做了一个详细的展示,有些不好翻译的地方我选择使用原汁原味的manual text

  • Aligned.out.sam
    Aligned.out.sam当然就是我们的比对结果啦!

E00516:168:H37WKCCXY:8:1101:6400:59130    99    1    92836373    255    20M1063N129M    =    92837548    4244    GGCTTGTCTATCCCTCACAGTACCAAACGATTCCCTGGTTATGATTCTGAAAGCAAGGAATTTAATGCAGAAGTACATCGGAAGCACATCATGGGCCAGAATGTTGCAGATTACATGCGCTACTTAATGGAAGAAGATGAAGATGCTTA    AAFFFJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJ    NH:i:1    HI:i:1    AS:i:289    nM:i:0

# 我截取了一条比对信息
我们来看一下最后面的 NH:i:1  HI:i:1  AS:i:289    nM:i:0
NH:i:后面的数值代表着此条read比对到几个loci,1代表着unique map,数值大于1代表着multi-mappers
HI:i:后面的数值attrbiutes enumerates multiple
alignments of a read starting with 1,下游分析接cufflinks or stringtie的时候需要使用参数--outSAMattrIHstart 0
AS:i:的数值代表着local alignment score (paired for paired-edn reads)
nM:i:的数值代表着the number of mismatches per (paired) alignment, not to be confused with NM, which is the number of mismatches in each mate
关于下游处理工具的兼容性还需要使用者自己仔细参考manual
  • Log.out文件
    Log.out文件记录了程序运行时的信息,可以用来回溯错误信息。

tail Log.out
Joined thread # 12
Completed: thread #13
Joined thread # 13
Joined thread # 14
Joined thread # 15
Joined thread # 16
Joined thread # 17
Joined thread # 18
Joined thread # 19
ALL DONE!
  • Log.progress.out文件
    Log.progress.out报告比对进程情况,1分钟记录一次

tail Log.progress.out
Sep 08 17:57:52     33.1    23115987      285    94.1%    284.0     0.2%     4.0%     0.1%     0.0%     1.8%     0.0%
Sep 08 17:58:53     34.0    24349711      285    94.1%    284.0     0.2%     4.0%     0.1%     0.0%     1.8%     0.0%
Sep 08 18:00:23     33.5    24789186      285    94.1%    284.1     0.2%     4.0%     0.1%     0.0%     1.8%     0.0%
Sep 08 18:01:51     33.3    25493588      285    94.1%    284.0     0.2%     4.0%     0.1%     0.0%     1.8%     0.0%
Sep 08 18:02:58     33.5    26284824      285    94.1%    284.1     0.2%     4.0%     0.1%     0.0%     1.8%     0.0%
Sep 08 18:04:23     33.7    27163519      285    94.1%    284.1     0.2%     4.0%     0.1%     0.0%     1.8%     0.0%
Sep 08 18:05:36     33.1    27428080      285    94.1%    284.1     0.2%     4.0%     0.1%     0.0%     1.8%     0.0%
Sep 08 18:06:54     33.8    28659661      285    94.1%    284.1     0.2%     4.0%     0.1%     0.0%     1.8%     0.0%
Sep 08 18:08:00     34.3    29741743      285    94.1%    283.9     0.2%     4.0%     0.1%     0.0%     1.8%     0.0%
ALL DONE!
  • Log.final.out文件
    Log.final.out包含了比对结束后比对统计的信息

head Log.progress.out
          Time    Speed        Read     Read   Mapped   Mapped   Mapped   Mapped Unmapped Unmapped Unmapped Unmapped
                   M/hr      number   length   unique   length   MMrate    multi   multi+       MM    short    other
Sep 08 17:17:47      2.9       88583      288    94.2%    287.4     0.1%     4.0%     0.1%     0.0%     1.7%     0.0%
Sep 08 17:18:53     14.5      711158      282    94.1%    281.9     0.2%     4.0%     0.1%     0.0%     1.8%     0.0%
Sep 08 18:08:00     34.3    29741743      285    94.1%    283.9     0.2%     4.0%     0.1%     0.0%     1.8%     0.0%
ALL DONE!
  • SJ.out.tab文件
    SJ.out.tab包含了剪切信息,其实目前我还没怎么看懂,等以后再来补坑。

head SJ.out.tab
1    14830    14969    2    2    0    1    9    69
1    14844    14969    2    2    0    0    2    30
1    15039    15795    2    2    1    2    7    53
1    15948    16606    2    2    1    1    1    41
1    16028    16606    2    2    0    0    1    57
1    16311    16606    2    2    0    2    0    67
1    16766    16853    2    2    0    2    0    43
1    16766    16857    2    2    1    17    108    73
1    16766    16875    2    2    0    0    1    61
1    16789    16875    2    2    0    0    1    53 # 参数释义
column 1: chromosome
column 2: first base of the intron (1-based)
column 3: last base of the intron (1-based)
column 4: strand (0: undened, 1: +, 2: -)
column 5: intron motif: 0: non-canonical; 1: GT/AG, 2: CT/AC, 3: GC/AG, 4: CT/GC, 5:AT/AC, 6: GT/AT
column 6: 0: unannotated, 1: annotated (only if splice junctions database is used)
column 7: number of uniquely mapping reads crossing the junction
column 8: number of multi-mapping reads crossing the junction
column 9: maximum spliced alignment overhang

写在最后

其实我探究STAR的最终目的实现利用STAR的Chimeric and circular alignments. 我自己处理的数据里面存在着fusion-protein,而其余的比对软件暂时还没发现有这个功能的

当使用—chimSegmentMin参数的时候,STAR可以把read拆分为两部分,分别进行比对

STAR-Fusion是一个package,可以承接STAR的chimeric output,点我看代码

当然STAR还可以做2-pass mapping,可以detect more splicesreads mapping to novel junctions

使用—quantMode GeneCounts参数还可以达到HTSeq的效果哦,可以帮你生成count matrix,省去你HTSeq的功夫, 有空回来做一个比对,看HTSeq和GeneCounts的效率。

11、比对软件STAR(https://github.com/alexdobin/STAR)的更多相关文章

  1. Vue 项目推荐,Github 过万 Star

    电鸭社区-远程工作-自由职业-兼职外包-自由从这开始 嗨,我是 Martin,也叫老王.不少小伙伴,说自己是转行.自学,没有项目,今天推荐一个 Vue 实战项目 还记得 Martin 仿写过在线 Ma ...

  2. 如何走上更高平台分享传递干货知识:(开通个人Github面向开源及私有软件项目的托管平台:https://github.com/zlslch/)(图文详解)(博主推荐)

    不多说,直接上干货! https://github.com/ 欢迎大家,加入我的微信公众号:大数据躺过的坑        人工智能躺过的坑       同时,大家可以关注我的个人博客:    http ...

  3. 好的commit应该长啥样 https://github.com/torvalds/linux/pull/17#issuecomment-5654674

    Git commits历史是如何做到如此清爽的? - 知乎 https://www.zhihu.com/question/61283395/answer/186122300 尤雨溪 前端开发.Java ...

  4. 转载请注明出处: https://github.com/qiu-deqing/FE-interview

    转载请注明出处: https://github.com/qiu-deqing/FE-interview Table of Contents generated with DocToc FE-inter ...

  5. 【软件使用】GitHub使用教程for VS2012

    一直以来都想使用Git来管理自己平时积累的小代码,就是除了工作之外的代码了.有时候自己搞个小代码,在公司写了,就要通过U盘或者网盘等等一系列工具进行Copy,然后回家才能继续在原来的基础上作业.Cop ...

  6. git clone https://github.com/istester/ido.git ,确提示“Failed to connect to 192.168.1.22 port 8080: Connection refused” 的解决办法 。

    不知道是否有同学遇到如下的问题: p.p1 { margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo } span.s1 { } git clone ...

  7. 人生第一个过万 Star 的 github 项目诞生

    写 Spring Boot 开源项目走入第三个年头,终于有一个开源项目要破万 Star 了,请各位读者大人批评指正. Spring Boot 文章 2016年,我开始学习 Spring Boot 的时 ...

  8. HIT2019春软件构造->Git&Github学习笔记

    由于软件构造课程需要,学习使用git,以下作为学习笔记. 一.Git初始化及仓库创建和操作  1.基本信息设置(设置签名)  命令        项目级别/仓库级别:仅在当前本地库范围内有效 git ...

  9. 袋鼠云研发手记 | 数栈·开源:Github上400+Star的硬核分布式同步工具FlinkX

    作为一家创新驱动的科技公司,袋鼠云每年研发投入达数千万,公司80%员工都是技术人员,袋鼠云产品家族包括企业级一站式数据中台PaaS数栈.交互式数据可视化大屏开发平台Easy[V]等产品也在迅速迭代.在 ...

随机推荐

  1. 【leetcode刷题笔记】Edit Distance

    Given two words word1 and word2, find the minimum number of steps required to convert word1 to word2 ...

  2. 【leetcode刷题笔记】Jump Game II

    Given an array of non-negative integers, you are initially positioned at the first index of the arra ...

  3. 20145210姚思羽《网络对抗》——shellcode注入& Return-to-libc攻击深入

    20145210姚思羽<网络对抗>shellcode注入&Return-to-libc攻击深入 shellcode基础知识 Shellcode是一段代码,作为数据发送给受攻击服务器 ...

  4. _CRT_SECURE_NO_WARNINGS

    在新版编程器的编译过程中我们常常会遇到一些过时或者不安全的函数 举一个简单的例子: 很多带"_s"后缀的函数是为了让原版函数更安全,传入一个和参数有关的大小值,避免引用到不存在的元 ...

  5. curl 监控web

    [root@rhel6 ~]# curl -I -s -w "%{http_code}\n" -o /dev/null http://127.0.0.1 [root@rhel6 ~ ...

  6. 句柄与MFC对象关系和相互获取

    Windows对象是以句柄来标识的,对应的MFC类就是这些句柄的C++包装.内存中的Windows对象一定有唯一的句柄来标识,但不一定有对应的MFC类对象在内存中.当需要获取Windows对象的对应M ...

  7. QT MVC 模型/视图

    1. 模型视图实例一, QFileSystemModel  QTreeView ,model/view示例. #include <QApplication> #include <QF ...

  8. 大话设计模式--外观模式 Facade -- C++实现实例

    1.  外观模式: 为子系统中的一组接口提供一个一致的界面,此模式定义了一个高层接口,这个接口使得这个子系统更加容易使用. 外观模式的使用场合: A: 设计初期阶段,应该要有意识的将不同的两个层分离. ...

  9. jquery树形菜单插件treeView

    Jquery的treeview很好用,如果是简单的树形菜单按照下面的源码实例模仿就可以. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Tr ...

  10. Tab支持的DHTML Window控件

    带有Tab标签支持的DHTML Window控件.它使用cookies来“记忆”窗体大小,位置,哪个Tab选项被选中,window堆叠顺序.​代码下载地址:http://www.huiyi8.com/ ...