<?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; 批处理</title>
	<atom:link href="http://www.bio-info-trainee.com/tag/%e6%89%b9%e5%a4%84%e7%90%86/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>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>
	</channel>
</rss>
