Given a file with aligned sequencing reads and a list of genomic features, a common task is to count how many reads map to each feature.

加入某个样有以下bam文件:

RCS48-1_CTTGTA_L003.sorted.rmp.bam

RCS48-2_CCGTCC_L005.sorted.rmp.bam

RCS48-2_CCGTCC_L007.sorted.rmp.bam

RCS48-3_GTCCGC_L006.sorted.rmp.bam

RCS48-3_GTCCGC_L007.sorted.rmp.bam

先将属于这个样的bam文件merge:

命令:

samtools merge RCS48.merged.bam RCS48-1_CTTGTA_L003.sorted.rmp.bam RCS48-2_CCGTCC_L005.sorted.rmp.bam RCS48-2_CCGTCC_L007.sorted.rmp.bam RCS48-3_GTCCGC_L006.sorted.rmp.bam RCS48-3_GTCCGC_L007.sorted.rmp.bam

merge后得到RCS48.merged.bam文件,

对合并好的bam文件重新进行sort, 按照read name 而不是coordinate,

命令:

samtools sort -n RCS48.merged.bam RCS48.merged.namesorted

sort之后得到RCS48.merged.namesorted.bam

如果你是老版本的htseq-count, 要将上面的bam文件转化为sam文件:

命令:

samtools view -h RCS48.merged.namesorted.bam > RCS48.merged.namesorted.sam

最后执行htseq-count

命令:

htseq-count -s no RCS48.merged.namesorted.sam ../../refseq/Osativa_204.gtf > RCS48_count

由于我的bam经过了remove duplicate步骤,所以会出现以下warning:

Warning: Read HWI-D00258:40:C2D73ACXX:2:2316:20611:80446 claims to have an aligned mate which could not be found. (Is the SAM file properly sorted?)
33638504 sam line pairs processed.

更详细阅读:

http://www-huber.embl.de/users/anders/HTSeq/doc/count.html

by freemao

FAFU.

free_mao@qq.com

htseq-count 的使用的更多相关文章

  1. nodejs api 中文文档

    文档首页 英文版文档 本作品采用知识共享署名-非商业性使用 3.0 未本地化版本许可协议进行许可. Node.js v0.10.18 手册 & 文档 索引 | 在单一页面中浏览 | JSON格 ...

  2. C#中Length和Count的区别(个人观点)

    这篇文章将会很短...短到比你的JJ还短,当然开玩笑了.网上有说过Length和count的区别,都是很含糊的,我没有发现有 文章说得比较透彻的,所以,虽然这篇文章很短,我还是希望能留在首页,听听大家 ...

  3. [PHP源码阅读]count函数

    在PHP编程中,在遍历数组的时候经常需要先计算数组的长度作为循环结束的判断条件,而在PHP里面对数组的操作是很频繁的,因此count也算是一个常用函数,下面研究一下count函数的具体实现. 我在gi ...

  4. EntityFramework.Extended 实现 update count+=1

    在使用 EF 的时候,EntityFramework.Extended 的作用:使IQueryable<T>转换为update table set ...,这样使我们在修改实体对象的时候, ...

  5. 学习笔记 MYSQL报错注入(count()、rand()、group by)

    首先看下常见的攻击载荷,如下: select count(*),(floor(rand(0)*2))x from table group by x; 然后对于攻击载荷进行解释, floor(rand( ...

  6. count(*) 与count (字段名)的区别

    count(*) 查出来的是:结果集的总条数 count(字段名) 查出来的是: 结果集中'字段名'不为空的记录的总条数

  7. BZOJ 2588: Spoj 10628. Count on a tree [树上主席树]

    2588: Spoj 10628. Count on a tree Time Limit: 12 Sec  Memory Limit: 128 MBSubmit: 5217  Solved: 1233 ...

  8. [LeetCode] Count Numbers with Unique Digits 计算各位不相同的数字个数

    Given a non-negative integer n, count all numbers with unique digits, x, where 0 ≤ x < 10n. Examp ...

  9. [LeetCode] Count of Range Sum 区间和计数

    Given an integer array nums, return the number of range sums that lie in [lower, upper] inclusive.Ra ...

  10. [LeetCode] Count of Smaller Numbers After Self 计算后面较小数字的个数

    You are given an integer array nums and you have to return a new counts array. The counts array has ...

随机推荐

  1. ruby学习网站

    Ruby官方中文网(推荐): https://www.ruby-lang.org/zh_cn/ 国内非常不错的Ruby学习教程网站(推荐): http://www.yiibai.com/ruby Ru ...

  2. 最新版Intel HD4000 桌面右键菜单去除方法

    网上找了一圈都提示找不到指定模块,后来发现它换dll了 regsvr32 /u igfxDTCM.dll

  3. 读懂diff

    作者: 阮一峰 日期: 2012年8月29日 diff是Unix系统的一个很重要的工具程序. 它用来比较两个文本文件的差异,是代码版本管理的基石之一.你在命令行下,输入: $ diff <变动前 ...

  4. 2015.11.16JQuery 隐藏,显示按钮.

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  5. Windows XP PRO SP3 - Full ROP calc shellcode

    /*     Shellcode: Windows XP PRO SP3 - Full ROP calc shellcode     Author: b33f (http://www.fuzzysec ...

  6. js获取URL地址中的GET参数

    var $_GET = (function(){ var url = window.document.location.href.toString(); var u = url.split(" ...

  7. Android 查看webview里面的图片

    今天介绍一下怎么查看WebView里面的图片,首先要设置WebView能够支持JavaScript,然后实现JavaScript的监听接口: mWebView.getSettings().setJav ...

  8. C/C++中函数参数传递详解(二)

    昨天看了内存管理的有关内容,有一点了解,但不是很深入,发现之前写代码时有很多细节问题没有注意到,只知道这样做可以实现功能,却不知道为什么可以这样,对于采用自己的方法造成的隐患也未知,更不晓得还有其他方 ...

  9. Android studio 环境搭建

    环境变量: CLASSPATH:.;%JAVA_HOME%\lib;%JAVA_HOME%\lib\tools.jar;%JAVA_HOME%\lib\dt.jar JAVA_HOME:F:\Prog ...

  10. jquery的is用法

    JQuery 中 is(':visible') 解析及用法 javascript代码$(document).ready(function() {           $('#faq').find('d ...