<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>生信菜鸟团 &#187; htseq-counts</title>
	<atom:link href="http://www.bio-info-trainee.com/tag/htseq-counts/feed" rel="self" type="application/rss+xml" />
	<link>http://www.bio-info-trainee.com</link>
	<description>欢迎去论坛biotrainee.com留言参与讨论，或者关注同名微信公众号biotrainee</description>
	<lastBuildDate>Sat, 28 Jun 2025 14:30:13 +0000</lastBuildDate>
	<language>zh-CN</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.1.33</generator>
	<item>
		<title>htseq-counts跟bedtools的区别</title>
		<link>http://www.bio-info-trainee.com/2022.html</link>
		<comments>http://www.bio-info-trainee.com/2022.html#comments</comments>
		<pubDate>Tue, 15 Nov 2016 03:55:21 +0000</pubDate>
		<dc:creator><![CDATA[ulwvfje]]></dc:creator>
				<category><![CDATA[转录组软件]]></category>
		<category><![CDATA[bedtools]]></category>
		<category><![CDATA[htseq-counts]]></category>
		<category><![CDATA[转录组]]></category>

		<guid isPermaLink="false">http://www.bio-info-trainee.com/?p=2022</guid>
		<description><![CDATA[我以前写过bedtools和htseq-counts的教程，它们都可以用来对比对 &#8230; <a href="http://www.bio-info-trainee.com/2022.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>我以前写过bedtools和htseq-counts的教程，它们都可以用来对比对好的bam文件进行计数，正好群里有小伙伴问我它们的区别，我就简单做了一个比较，大家可以先看看我以前写的软件教程。写的有的挫：</p>
<p><a title="详细阅读 使用Bedtools对RNA-seq进行基因计数" href="http://www.bio-info-trainee.com/745.html" rel="bookmark">使用Bedtools对RNA-seq进行基因计数</a> ，</p>
<p><a title="详细阅读 转录组HTseq对基因表达量进行计数" href="http://www.bio-info-trainee.com/244.html" rel="bookmark">转录组HTseq对基因表达量进行计数</a></p>
<p>言归正传，我这里没精力去探究它们的具体原理，只是看看它们数一个read是否属于某个基因的时候，区别在哪里，大家看下图：<span id="more-2022"></span></p>
<p><a href="http://www.bio-info-trainee.com/wp-content/uploads/2016/11/bedtoos-vs-htseq.png"><img class="alignnone size-full wp-image-2023" src="http://www.bio-info-trainee.com/wp-content/uploads/2016/11/bedtoos-vs-htseq.png" alt="bedtoos-vs-htseq" width="707" height="485" /></a></p>
<div>很明显，bedtools不管三七二十一，只要你的reads比对到基因组的坐标跟目的基因坐标有交叉，就算你一个reads，不需要管你是不是multiple mapping的。</div>
<div>但是htseq就谨慎很多，而且还可以挑选model，一般来说，它会把multiple mapping的reads归类到 not unique aligned里面。</div>
<div>而且，大家做完分析，一定要再三检查，很明显人家hisat告诉你的mapping rate高达90%以上，即使除去那15%左右的multiple mapping，你counts表达量的时候，至少也可以counts 百分之五六十吧！！！</div>
<div></div>
<div>如果出现大数量级的no_feature，你自己就应该明白有问题了！</div>
<div></div>
<div>最后htseq-counts使用的时候有一些参数尤其需要注意：</div>
<div>软件官网说明书： <a href="http://www-huber.embl.de/HTSeq/doc/count.html">http://www-huber.embl.de/HTSeq/doc/count.html</a></div>
<div>参考gtf文件可以是gencode或者是ensembl数据库的，但是尤其要注释chr的问题，而且版本问题，gtf/gff格式无所谓。比对后的文件一定要进行sort，推荐一定要sort -n，根据reads的name来sort</div>
<div>-f sam/bam 这个一定要搞清楚，如果对bam文件进行counts，必须保证你服务器的python安装了正确的pysam模块</div>
<div>-r name/pos， 一般情况下我们的bam都是按照参考基因组的pos来sort的，但是这个软件默认却是reads的name，很坑，一般建议重新把bam文件sort一下，而不是选择 -r pos，因为-r pos实在是太消耗内存了。</div>
<div>-s yes/no/reverse, 这也是巨坑的参数，默认是yes，一般人拿到的数据都是no，所以千万要注意！！！</div>
<div>-t 选择gff/gtf文件的第3列，一般是exon，也可以是gene，transcript ，这个很少调整的。</div>
<div>-i 这个需要修改，不然默认是ensembl的基因ID，一般人看不懂，可以改为gene_name，前提是你的gff文件里面有gene_name这个属性。</div>
<div>其余的就不需要修改了。</div>
<div>我的代码如下：</div>
<blockquote>
<div>nohup samtools view control.Nsort.bam | ~/.local/bin/htseq-count -f sam -s no -i gene_name - ~/reference/gtf/gencode/gencode.v25lift37.annotation.gtf 1&gt;control.geneCounts 2&gt;control.HTseq.log &amp;</div>
<div>nohup samtools view G34V.Nsort.bam | ~/.local/bin/htseq-count -f sam -s no -i gene_name - ~/reference/gtf/gencode/gencode.v25lift37.annotation.gtf 1&gt;G34V.geneCounts 2&gt;G34V.HTseq.log &amp;</div>
<div>nohup samtools view K27M.Nsort.bam | ~/.local/bin/htseq-count -f sam -s no -i gene_name - ~/reference/gtf/gencode/gencode.v25lift37.annotation.gtf 1&gt;K27M.geneCounts 2&gt;K27M.HTseq.log &amp;</div>
<div>nohup samtools view WT.Nsort.bam | ~/.local/bin/htseq-count -f sam -s no -i gene_name - ~/reference/gtf/gencode/gencode.v25lift37.annotation.gtf 1&gt;WT.geneCounts 2&gt;WT.HTseq.log &amp;</div>
<div></div>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.bio-info-trainee.com/2022.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
