<?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; idxstats</title>
	<atom:link href="http://www.bio-info-trainee.com/tag/idxstats/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>用samtools idxstats来对de novo的转录组数据计算表达量</title>
		<link>http://www.bio-info-trainee.com/1974.html</link>
		<comments>http://www.bio-info-trainee.com/1974.html#comments</comments>
		<pubDate>Mon, 31 Oct 2016 09:16:48 +0000</pubDate>
		<dc:creator><![CDATA[ulwvfje]]></dc:creator>
				<category><![CDATA[基础软件]]></category>
		<category><![CDATA[de novo]]></category>
		<category><![CDATA[idxstats]]></category>
		<category><![CDATA[samtools]]></category>
		<category><![CDATA[转录组]]></category>

		<guid isPermaLink="false">http://www.bio-info-trainee.com/?p=1974</guid>
		<description><![CDATA[de novo的转录组数据，比对的时候一般用的是自己组装好的trinity.fa &#8230; <a href="http://www.bio-info-trainee.com/1974.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>de novo的转录组数据，比对的时候一般用的是自己组装好的trinity.fasta序列(挑选最长蛋白的转录本序列)来做参考，用bowtie2等工具直接将原始序列比对即可。所以比对 sam/bam文件本身就包含了参考序列的每一条转录本序列ID，直接对 sam/bam文件进行counts就知道每一个基因的表达量啦！</p>
<p>本来我是准备自己写脚本对sam文件进行counts就好，但是发现了samtools自带这样的工具：<a href="http://www.htslib.org/doc/samtools.html " target="_blank">http://www.htslib.org/doc/samtools.html </a></p>
<p>如果是针对基因组序列，那么这个功能用处不大，但是针对转录本序列，统计出来的就是我们想要的转录本表达量。<span id="more-1974"></span></p>
<blockquote><p><span style="color: #ff0000;"><strong>samtools idxstats</strong></span> tmp.bowtie2.sorted.bam |head<br />
TR3|c0_g1_i1 1276 418 0<br />
TR6|c0_g1_i1 1271 10 0<br />
TR6|c0_g1_i2 944 5 0<br />
TR6|c0_g1_i3 1281 4 0<br />
TR6|c0_g1_i4 1224 53 0<br />
TR6|c0_g1_i5 855 16 0<br />
TR19|c0_g1_i2 1428 19 0<br />
TR19|c0_g1_i3 2536 624 0<br />
TR19|c0_g1_i4 3072 105 0<br />
TR19|c0_g1_i5 1685 0 0</p></blockquote>
<p>软件官网说明书，说的很清楚：</p>
<p>samtools idxstats <em>in.sam</em>|<em>in.bam</em>|<em>in.cram</em></p>
<p>Retrieve and print stats in the index file corresponding to the input file. Before calling idxstats, the input BAM file must be indexed by samtools index.</p>
<p>The output is TAB-delimited with each line consisting of reference sequence name, sequence length, # mapped reads and # unmapped reads. It is written to stdout.</p>
<p>第三列，就是我们想要的表达量数据啦，比对到每个转录本序列的reads数量。</p>
<p><span style="color: #ff0000;">大家从我的转录本序列ID上面如果可以看出些什么问题，欢迎跟我交流，直接给我email就好了，jmzeng1314@163.com </span></p>
<p>现在知道了每个转录本的表达量，把每个样本都做一下，就知道表达矩阵了，做差异分析就很简单了。但是得到的是差异转录本列表，不明白这些ID背后的意义，需要取注释，才能做下一步分析。</p>
<blockquote><p>ls *sorted.bam |while read id<br />
do<br />
echo $id ${id%%.*}.t.counts<br />
nohup samtools idxstats $id 1&gt;${id%%.*}.t.counts 2&gt;/dev/null  &amp;<br />
done</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.bio-info-trainee.com/1974.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
