<?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; shell</title>
	<atom:link href="http://www.bio-info-trainee.com/tag/shell/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>没必要学shell进阶语法</title>
		<link>http://www.bio-info-trainee.com/1410.html</link>
		<comments>http://www.bio-info-trainee.com/1410.html#comments</comments>
		<pubDate>Mon, 22 Feb 2016 12:29:07 +0000</pubDate>
		<dc:creator><![CDATA[ulwvfje]]></dc:creator>
				<category><![CDATA[杂谈-随笔]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[脚本]]></category>
		<category><![CDATA[自动化]]></category>

		<guid isPermaLink="false">http://www.bio-info-trainee.com/?p=1410</guid>
		<description><![CDATA[因为大部分生物信息学软件都是linux版本的，所以生物信息学数据分析工作者必备技 &#8230; <a href="http://www.bio-info-trainee.com/1410.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>因为大部分生物信息学软件都是linux版本的，所以生物信息学数据分析工作者必备技能就是linux，但是大部分人只是拿他当个中转站，我以前也是，直到接触了大批量的任务，自动化流程，才明白这里面的水太深了，不过无所谓，凭我个人的观点，其实shell的进阶语法真的不必要！</p>
<div>当然，只是我一家之言！</div>
<div>我实在是不想去背诵大括号，小括号，中括号以及双重括号到底区别是什么！</div>
<div>
<div><a href="http://www.bio-info-trainee.com/?p=1018">http://www.bio-info-trainee.com/?p=1018</a>  [],[[]],(),(()),{},{{}},以及在前面加上$的区别，以及它们互相杂交组合的区别！！！</div>
<p>我也不想去搞明白操作符两边是否加空格的区别是什么了。</p>
</div>
<div>if((i%5==0)) 来判断变量是否被一个数整除</div>
<div>i=$((i+1))来表示变量自增。</div>
<div>这些东西真的很诡异！</div>
<div>如果你有qsub，condor等任务提交系统，那么你只需要熟悉他们就可以了，但大部分散兵游勇的生物信息学家并没有集群，所以压根不会接触任务提交系统，就需要些自动化脚本了！</div>
<div>
<div><a href="http://www.bio-info-trainee.com/?p=382">http://www.bio-info-trainee.com/?p=382</a></div>
</div>
<div>受限制与机器的cpu以及内存数，需要判断提交了多少任务，等待多久再执行，所以会把一个简单的自动化脚本写的很复杂！</div>
<div>比如下面这个脚本：cat &gt;download_hg38_from_UCSC.sh</p>
<div><span style="color: #ff0000;">for i in $(seq 1 22) X Y M;</span></div>
<div><span style="color: #ff0000;">do echo $i;</span></div>
<div><span style="color: #ff0000;">wget<span class="Apple-converted-space"> </span><a href="ftp://hgdownload.cse.ucsc.edu/goldenPath/hg38/chromosomes/chr$%7Bi%7D.fa.gz">ftp://hgdownload.cse.ucsc.edu/goldenPath/hg38/chromosomes/chr${i}.fa.gz</a>;</span></div>
<div><span style="color: #ff0000;">done</span></div>
<div><span style="color: #ff0000;">gunzip *.gz</span></div>
<div><span style="color: #ff0000;">for i in $(seq 1 22) X Y M;</span></div>
<div><span style="color: #ff0000;">do cat chr${i}.fa &gt;&gt; hg38.fa;</span></div>
<div><span style="color: #ff0000;">done</span></div>
<div><span style="color: #ff0000;">rm -fr chr*.fa</span></div>
<div>可以下载hg38基因组的fasta文件，但是是分染色体一个个下载的！</div>
<div>再比如下面这个，批量做GSEA分析的脚本：</div>
<div>
<div>while read id</div>
<div>do</div>
<div>echo $id</div>
<div>gene=`echo $id |awk '{print $1}'`</div>
<div>probe=`echo $id |awk '{print $2}'`</div>
<div></div>
<div>echo $i</div>
<div>do_GSEA $probe $gene; ##这里是我自己定义的一个function，就不贴出来了</div>
<div>if((i%5==0))</div>
<div>then</div>
<div>sleep 10  ##重点就在这里，每次提交的任务有限制，所以需要休息，不然机器的cpu负载太高！</div>
<div>fi</div>
<div>i=$((i+1))</div>
<div>done &lt;$1</div>
<p>如果，还有其它功能需要实现，我们可以把脚本写的更负载，纯粹的用shell，需要搜索更多的shell技巧。</p>
</div>
<div>但是事实上并没有这个必要，我们现在有了更方便的脚本语言，比如我所擅长的perl</div>
<div>我写一个nohup提交任务的脚本！</div>
<div>
<div>## perl<span class="Apple-converted-space"> </span><a href="http://nohup.pl/">nohup.pl</a><span class="Apple-converted-space"> </span>  deep_count.sh  0</div>
<div>## perl<span class="Apple-converted-space"> </span><a href="http://nohup.pl/">nohup.pl</a><span class="Apple-converted-space"> </span>  deep_count.sh  1</div>
<div>## perl<span class="Apple-converted-space"> </span><a href="http://nohup.pl/">nohup.pl</a><span class="Apple-converted-space"> </span>  deep_count.sh  2</div>
<p>[perl]<br />
## perl nohup.pl   deep_count.sh  0<br />
## perl nohup.pl   deep_count.sh  1<br />
## perl nohup.pl   deep_count.sh  2<br />
$i=1;<br />
open FH,$ARGV[0];<br />
while(&lt;FH&gt;){<br />
    chomp;<br />
    next unless $.%3==$ARGV[1];<br />
    $cmd=&quot;nohup  $_  &amp;&quot;;<br />
    print &quot;$cmd\n&quot;;<br />
    system($cmd);<br />
    sleep(10800) if $i%5==4;<br />
    $i++;<br />
    #exit;<br />
}<br />
[/perl]</p>
</div>
<div>我尝试过用shell，写了很久，总是报错，但是用perl，一分钟我就写完了，所以，最好是用自己熟悉的一种语法最好！</div>
<div></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.bio-info-trainee.com/1410.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Shell里面的各种括号的区别</title>
		<link>http://www.bio-info-trainee.com/1018.html</link>
		<comments>http://www.bio-info-trainee.com/1018.html#comments</comments>
		<pubDate>Fri, 25 Sep 2015 14:42:30 +0000</pubDate>
		<dc:creator><![CDATA[ulwvfje]]></dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[脚本]]></category>

		<guid isPermaLink="false">http://www.bio-info-trainee.com/?p=1018</guid>
		<description><![CDATA[[],[[]],(),(()),{},{{}},以及在前面加上$的区别，以及它们 &#8230; <a href="http://www.bio-info-trainee.com/1018.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<h1>[],[[]],(),(()),{},{{}},以及在前面加上$的区别，以及它们互相杂交组合的区别！！！</h1>
<p>[[ ]] double brackets</p>
<p>(())<em>Double parentheses</em></p>
<p>{{}}<em>double curly brackets</em></p>
<p>我们必须要记住的是下面</p>
<p>[] 相当于test，作逻辑判断</p>
<p>$( ) 与` ` (反引号) 都是用来做命令替换用</p>
<p>${ } 吧... 它其实就是用来作变量替换用的啦</p>
<p>(())就是用来计算的，相当于expr函数。</p>
<p>参考：<a href="http://sayle.net/book/basics.htm">http://sayle.net/book/</a></p>
<p><a href="http://tldp.org/LDP/abs/html/index.html">http://tldp.org/LDP/abs/html/index.html</a></p>
<p>&nbsp;</p>
<p>我们首先看看一对的括号</p>
<p>首先[]是用来逻辑判断的，必须有空格</p>
<p>if [ -f binom.py ]</p>
<p>then</p>
<p>echo 'binom.py exists'</p>
<p>fi</p>
<p>或者</p>
<p>nub=$((i%4))</p>
<p>#echo $nub</p>
<p>if [ $nub == 0 ];then</p>
<p>echo "we need to sleep 4 hours"</p>
<p>sleep 14000</p>
<p>fi</p>
<p>这个[]操作符等价于test函数</p>
<p>if test $1 -gt 0<br />
then<br />
echo "$1 number is positive"<br />
fi</p>
<p>但是都必须有空格！！！</p>
<p>参考：<a href="http://www.freeos.com/guides/lsst/ch03sec02.html">http://www.freeos.com/guides/lsst/ch03sec02.html</a></p>
<p>关于shell的test操作符还有很多<a href="http://tldp.org/LDP/abs/html/fto.html">http://tldp.org/LDP/abs/html/fto.html</a></p>
<p>( ) 将command group 置于 sub-shell 去执行，也称 nested sub-shell。</p>
<p>{ } 则是在同一个 shell 内完成，也称为non-named command group。</p>
<p>补充一个: {} 还可以做变量扩展 {5..9}  或者 {abcd}e， 自己运行一下就知道效果啦</p>
<p>这两个差异很小，而且一般用不着，就不讲了。</p>
<p>那么这一对的括号加上了$符号后又变成了上面鬼东西呢？</p>
<p><b>当然，只有</b><b>：</b><b>$( ) </b><b>与</b><b>${ }</b><b>才是合法的。</b></p>
<p>在 bash shell 中，$( ) 与` ` (反引号) 都是用来做命令替换用(command substitution)的。</p>
<p>在操作上，用$( ) 或` ` 都无所谓，用$( )的优点是：</p>
<p>1, ` ` 很容易与' ' ( 单引号)搞混乱，尤其对初学者来说</p>
<p>2, 在多层次的复合替换中，` ` 须要额外的跳脱( \` )处理，而$( ) 则比较直观</p>
<p>再让我们看${ } 吧... 它其实就是用来作变量替换用的啦。</p>
<p>一般情况下，$var 与${var} 并没有啥不一样。</p>
<p>但是用${ } 会比较精确的界定变量名称的范围，比方说：</p>
<p>[code][/code]</p>
<p>$ A=B</p>
<p>$ echo $AB</p>
<p>还可以用来截取变量，这个就很多花样啦</p>
<p># 是去掉左边(在鉴盘上# 在$ 之左边)</p>
<p>% 是去掉右边(在鉴盘上% 在$ 之右边)</p>
<p>单一符号是最小匹配﹔两个符号是最大匹配</p>
<p>&nbsp;</p>
<p>然后我们看看两对的括号：</p>
<p>nub=$((i%4)) 等价于$nub=`expr $i % 1` ;</p>
<p>((i++)) 等价于$i=`expr $i + 1` ;</p>
<p>所以(())就是用来计算的，而且里面的变量不需要$来标记啦</p>
<p>（在 $(( )) 中的变量名称，可于其前面加$ 符号来替换，也可以不用）</p>
<p>在(())前面加上$只是为了把计算结果给保存而已。</p>
<p><b>而两个中括号和两个大括号都是不合法的！</b></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bio-info-trainee.com/1018.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux服务器基础知识</title>
		<link>http://www.bio-info-trainee.com/416.html</link>
		<comments>http://www.bio-info-trainee.com/416.html#comments</comments>
		<pubDate>Sat, 21 Mar 2015 11:00:19 +0000</pubDate>
		<dc:creator><![CDATA[ulwvfje]]></dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[ftp]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[xshell]]></category>

		<guid isPermaLink="false">http://www.bio-info-trainee.com/?p=416</guid>
		<description><![CDATA[想了想，既然是菜鸟教程，那就索性再介绍点更基础的东西，基本上只要是大学毕业的都能 &#8230; <a href="http://www.bio-info-trainee.com/416.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>想了想，既然是菜鸟教程，那就索性再介绍点更基础的东西，基本上只要是大学毕业的都能看懂，不需要懂计算机了。首先讲讲linux服务器吧，因为生物信息也算是半个大数据分析，所以我们平常的办公电脑一般都是不能满足需求的，大部分实验室及公司都会自己配置好服务器给菜鸟们用，菜鸟们首先要拿到服务器的IP和高手给你的用户名和密码。</p>
<p>一般我们讲服务器，大多是linux系统，而我这里所讲的linux系统呢，特指ubuntu，其余的我懒得管了，大家也不要耗费无谓的时间纠结那些名词的不同！</p>
<p>登录到服务器有两种方法，一种是ssh，传输你的命令给服务器执行，另一种是ftp，和服务器交换文件。而ssh我们通常用putty，xshell等等。ftp呢，我们可以用winscp，xshell，所以我一直都用xshell，因为它两者都能搞定！</p>
<p>Xshell软件自行搜索下载，打开之后新建一个连接，然后登陆即可。</p>
<p><a href="http://www.bio-info-trainee.com/wp-content/uploads/2015/03/Linux服务器基础知识405.png"><img class="alignnone size-full wp-image-417" src="http://www.bio-info-trainee.com/wp-content/uploads/2015/03/Linux服务器基础知识405.png" alt="Linux服务器基础知识405" width="554" height="310" /></a></p>
<p>然后输入以下命令，可以查看服务器配置，包括cpu。内存，还有硬盘</p>
<p>cat /proc/cpuinfo |grep pro|wc -l</p>
<p>free -g</p>
<p>df -h</p>
<p><a href="http://www.bio-info-trainee.com/wp-content/uploads/2015/03/Linux服务器基础知识488.png"><img class="alignnone size-full wp-image-418" src="http://www.bio-info-trainee.com/wp-content/uploads/2015/03/Linux服务器基础知识488.png" alt="Linux服务器基础知识488" width="554" height="282" /></a></p>
<p>&nbsp;</p>
<p>这个服务器配置好一点，有80个cpu，内存256G，硬盘有2个11T的，是比较成熟的配置。</p>
<p><a href="http://www.bio-info-trainee.com/wp-content/uploads/2015/03/Linux服务器基础知识536.png"><img class="alignnone size-full wp-image-419" src="http://www.bio-info-trainee.com/wp-content/uploads/2015/03/Linux服务器基础知识536.png" alt="Linux服务器基础知识536" width="527" height="244" /></a></p>
<p>&nbsp;</p>
<p>这个是一个小型服务器。也就24个核，64G的内存，但是存储量有点小呀，其实可以随便花几百块钱买个1T的硬盘挂载上去的。</p>
<p>然后linux的其它命令大家就得自己去搜索一个个使用，然后熟悉，记牢，然后创新啦！</p>
<p>我随便敲几个我常用的吧： ls cd mkdir rm cp cat head tail more less diff grep awk sed grep perl 等等！</p>
<p>呀，突然间发现我才介绍了ssh的方法登陆服务器并且发送命令在服务器上面运行，下面贴图如何传输文件。一般xshell的菜单里面有绿的文件夹形式的标签就是打开ftp文件传输，这种可视化的软件，大家慢慢摸索吧！</p>
<p><a href="http://www.bio-info-trainee.com/wp-content/uploads/2015/03/Linux服务器基础知识830.png"><img class="alignnone size-full wp-image-420" src="http://www.bio-info-trainee.com/wp-content/uploads/2015/03/Linux服务器基础知识830.png" alt="Linux服务器基础知识830" width="447" height="163" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bio-info-trainee.com/416.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux基础之shell脚本的批处理</title>
		<link>http://www.bio-info-trainee.com/382.html</link>
		<comments>http://www.bio-info-trainee.com/382.html#comments</comments>
		<pubDate>Thu, 19 Mar 2015 14:55:48 +0000</pubDate>
		<dc:creator><![CDATA[ulwvfje]]></dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[批处理]]></category>
		<category><![CDATA[脚本]]></category>

		<guid isPermaLink="false">http://www.bio-info-trainee.com/?p=382</guid>
		<description><![CDATA[脚本类似于下面的样子，大家可以读懂之后就仿写 for i in *sra do  &#8230; <a href="http://www.bio-info-trainee.com/382.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>脚本类似于下面的样子，大家可以读懂之后就仿写</p>
<p>for i in *sra</p>
<p>do</p>
<p>echo $i</p>
<p>/home/jmzeng/bio-soft/sratoolkit.2.3.5-2-ubuntu64/bin/fastq-dump --split-3 $i</p>
<p>Done</p>
<p>这个脚本是把当前目录下所有的NCBI下载的sra文件都加压开来成测序fastq格式文件</p>
<p>有这些数据，分布在不同的目录，如果是写命令一个个文件处理，很麻烦，如果有几百个那就更麻烦了，所以需要用shell脚本</p>
<p><a href="http://www.bio-info-trainee.com/wp-content/uploads/2015/03/Linux基础之shell脚本的批处理254.png"><img class="alignnone size-full wp-image-383" src="http://www.bio-info-trainee.com/wp-content/uploads/2015/03/Linux基础之shell脚本的批处理254.png" alt="Linux基础之shell脚本的批处理254" width="177" height="158" /></a></p>
<p>这样只需要bash这个脚本即可一次性处理所有的数据</p>
<p><a href="http://www.bio-info-trainee.com/wp-content/uploads/2015/03/Linux基础之shell脚本的批处理282.png"><img class="alignnone size-full wp-image-384" src="http://www.bio-info-trainee.com/wp-content/uploads/2015/03/Linux基础之shell脚本的批处理282.png" alt="Linux基础之shell脚本的批处理282" width="550" height="380" /></a></p>
<p>还有很多类似的脚本，非常简单的</p>
<p>for i in *fq</p>
<p>do</p>
<p>echo $i</p>
<p>bowtie2 -p 13 -x ../../RNA.fa -U $i -S  $i.sam</p>
<p>done</p>
<p>&nbsp;</p>
<p>for i in */accepted_hits.bam</p>
<p>do</p>
<p>echo $i</p>
<p>out=`echo $i |cut -d'/' -f 1`_clout</p>
<p>samtools mpileup -guSDf  /home/immune/refer_genome/hg19/hg19.fa $i  | bcftools view -cvNg - &gt;snp-vcf/$out.vcf</p>
<p>done</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>while read id</p>
<p>do</p>
<p>echo $id</p>
<p>out=`echo $id |cut -d'/' -f 2`</p>
<p>reads=`echo $id |cut -d'/' -f 3|sed 's/\r//g'`</p>
<p>tophat2 -p 13 -o $out /home/immune/refer_genome/hg19/hg19 $reads</p>
<p>done &lt;$1</p>
<p>&nbsp;</p>
<p>等等</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bio-info-trainee.com/382.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SRA工具sratoolkit把原始测序数据转为fastq格式</title>
		<link>http://www.bio-info-trainee.com/338.html</link>
		<comments>http://www.bio-info-trainee.com/338.html#comments</comments>
		<pubDate>Thu, 19 Mar 2015 01:32:04 +0000</pubDate>
		<dc:creator><![CDATA[ulwvfje]]></dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[基础数据库]]></category>
		<category><![CDATA[基础软件]]></category>
		<category><![CDATA[reads]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[sratoolkit]]></category>
		<category><![CDATA[原始数据]]></category>

		<guid isPermaLink="false">http://www.bio-info-trainee.com/?p=338</guid>
		<description><![CDATA[一，下载该软件 wget http://ftp-trace.ncbi.nlm.n &#8230; <a href="http://www.bio-info-trainee.com/338.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>一，下载该软件</p>
<p>wget http://ftp-trace.ncbi.nlm.nih.gov/sra/sdk/current/sratoolkit.current-ubuntu64.tar.gz</p>
<p>tar xzf sratoolkit.current-centos_linux64.tar.gz</p>
<p>解压直接使用即可，里面有一大堆的软件，针对不同的测序仪，不同的数据<span id="more-338"></span></p>
<p><a href="http://www.bio-info-trainee.com/wp-content/uploads/2015/03/SRA工具sratoolkit把原始测序数据转为fastq格式448.png"><img class="alignnone size-full wp-image-339" src="http://www.bio-info-trainee.com/wp-content/uploads/2015/03/SRA工具sratoolkit把原始测序数据转为fastq格式448.png" alt="SRA工具sratoolkit把原始测序数据转为fastq格式448" width="600" height="277" /></a></p>
<p>我一般只用/home/jmzeng/down_software/sratoolkit.2.3.5-2-ubuntu64/bin/fastq-dump</p>
<p>/home/jmzeng/down_software/sratoolkit.2.3.5-2-ubuntu64/bin/fastq-dump --split-3 SRR1793917.sra</p>
<p>二：下载数据</p>
<p>首先去NCBI里面搜索并找到你想要的数据的SRA地址，然后写脚本批量下载。</p>
<p><a href="http://www.bio-info-trainee.com/wp-content/uploads/2015/03/SRA工具sratoolkit把原始测序数据转为fastq格式826.png"><img class="alignnone size-full wp-image-340" src="http://www.bio-info-trainee.com/wp-content/uploads/2015/03/SRA工具sratoolkit把原始测序数据转为fastq格式826.png" alt="SRA工具sratoolkit把原始测序数据转为fastq格式826" width="644" height="187" /></a></p>
<p>如果文献里面的SRA号，那么可以直接打开NCBI里面的搜索界面下载</p>
<p>如果文献里面是SRP号，那么该SRP会涉及到好几个SRA数据，得一个个开网站下载</p>
<p>三：用命令解压数据</p>
<p>下载之后的数据是</p>
<p><a href="http://www.bio-info-trainee.com/wp-content/uploads/2015/03/SRA工具sratoolkit把原始测序数据转为fastq格式1008.png"><img class="alignnone size-full wp-image-341" src="http://www.bio-info-trainee.com/wp-content/uploads/2015/03/SRA工具sratoolkit把原始测序数据转为fastq格式1008.png" alt="SRA工具sratoolkit把原始测序数据转为fastq格式1008" width="366" height="171" /></a></p>
<p>非常简单的命令，就可以把当前文件夹下的所有sra都解压开来！</p>
<p>[shell]</p>
<p>for i in *sra<br />
do<br />
echo $i<br />
/home/jmzeng/bio-soft/sratoolkit.2.3.5-2-ubuntu64/bin/fastq-dump --split-3 $i<br />
done</p>
<p>[/shell]</p>
<p>解压的同时它也会显示每个SRA文件的数据量</p>
<p><a href="http://www.bio-info-trainee.com/wp-content/uploads/2015/03/SRA工具sratoolkit把原始测序数据转为fastq格式1064.png"><img class="alignnone size-full wp-image-342" src="http://www.bio-info-trainee.com/wp-content/uploads/2015/03/SRA工具sratoolkit把原始测序数据转为fastq格式1064.png" alt="SRA工具sratoolkit把原始测序数据转为fastq格式1064" width="405" height="432" /></a></p>
<p>&nbsp;</p>
<p>四：结果文件解读</p>
<p><a href="http://www.bio-info-trainee.com/wp-content/uploads/2015/03/SRA工具sratoolkit把原始测序数据转为fastq格式1235.png"><img class="alignnone size-full wp-image-343" src="http://www.bio-info-trainee.com/wp-content/uploads/2015/03/SRA工具sratoolkit把原始测序数据转为fastq格式1235.png" alt="SRA工具sratoolkit把原始测序数据转为fastq格式1235" width="417" height="486" /></a></p>
<p>可以看到，每个SRA文件都产生了两个reads，分别是左右两端测序，说明这个SRA文件是双端测序策略。</p>
<p>随便打开一个fastq文件可以看到，它的读长是300bp</p>
<p><a href="http://www.bio-info-trainee.com/wp-content/uploads/2015/03/SRA工具sratoolkit把原始测序数据转为fastq格式1479.png"><img class="alignnone size-full wp-image-344" src="http://www.bio-info-trainee.com/wp-content/uploads/2015/03/SRA工具sratoolkit把原始测序数据转为fastq格式1479.png" alt="SRA工具sratoolkit把原始测序数据转为fastq格式1479" width="645" height="170" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bio-info-trainee.com/338.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
