<?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%e9%87%8f%e4%b8%8b%e8%bd%bd/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>用wget批量下载需要认证的网页或者ftp站点里面的pdf文档</title>
		<link>http://www.bio-info-trainee.com/1039.html</link>
		<comments>http://www.bio-info-trainee.com/1039.html#comments</comments>
		<pubDate>Wed, 14 Oct 2015 14:43:00 +0000</pubDate>
		<dc:creator><![CDATA[ulwvfje]]></dc:creator>
				<category><![CDATA[计算机基础]]></category>
		<category><![CDATA[批量下载]]></category>

		<guid isPermaLink="false">http://www.bio-info-trainee.com/?p=1039</guid>
		<description><![CDATA[这是一个终极命令，比写什么爬虫简单多了 wget -c -r -np -k -L &#8230; <a href="http://www.bio-info-trainee.com/1039.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<div>这是一个终极命令，比写什么爬虫简单多了</div>
<div>wget -c -r -np -k -L -p  -A.pdf --http-user=CS374-2011 --http-passwd=AlgorithmsInBiology <a href="http://ai.stanford.edu/">http://ai.stanford.edu/</a>~serafim/CS374_2011/papers/</div>
<div>我这里的例子是斯坦福大学的生物信息学算法课程里面推荐阅读的的所有pdf格式的paper</div>
<div>课程的网址是：<a href="http://ai.stanford.edu/">http://ai.stanford.edu/</a>~serafim/CS374_2011/</div>
<div></div>
<div>可以看到，这个网站推荐的文献分成8大类，本身这个网站打开就需要登录用户名和密码</div>
<div>--http-user=CS374-2011 --http-passwd=AlgorithmsInBiology</div>
<div>每一篇文献的单独地址是<a href="http://ai.stanford.edu/">http://ai.stanford.edu/</a>~serafim/CS374_2011/papers/Miscellaneous_topics/Self-assembly_of_DNA/self_healing_and_proofreading.pdf 类似的格式。</div>
<div>我这里简单解释一下这些参数的意思：</div>
<div>-c -r -np -k -L -p  -A.pdf</div>
<div>-c 断点续传<br />
-r 递归下载，下载指定网页某一目录下（包括子目录）的所有文件<br />
-nd 递归下载时不创建一层一层的目录，把所有的文件下载到当前目录（特殊要求会选择这个参数）<br />
-np 递归下载时不搜索上层目录，如wget -c -r <a href="http://www.xxx.org/pub/path/">www.xxx.org/pub/path/</a><br />
没有加参数-np，就会同时下载path的上一级目录pub下的其它文件 （所以一定要加上这个参数，不然会下载太多东西的）<br />
-k 将绝对链接转为相对链接，下载整个站点后脱机浏览网页，最好加上这个参数<br />
-L 递归时不进入其它主机，如wget -c -r <a href="http://www.xxx.org/">www.xxx.org/</a></div>
<div>-p 下载网页所需的所有文件，如图片等<br />
-A 指定要下载的文件样式列表，多个样式用逗号分隔</div>
<div>至于最后的--http-user=CS374-2011 --http-passwd=AlgorithmsInBiology 就是登录该课程网站需要的用户名和密码</div>
<div>完整的教程见：<a title="有道云笔记" href="http://note.youdao.com/share/?id=e23b57bd3274392c7a36b9eb498fc64d&amp;type=note">http://note.youdao.com/share/?id=e23b57bd3274392c7a36b9eb498fc64d&amp;type=note</a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.bio-info-trainee.com/1039.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>hpv病毒研究调研</title>
		<link>http://www.bio-info-trainee.com/934.html</link>
		<comments>http://www.bio-info-trainee.com/934.html#comments</comments>
		<pubDate>Thu, 06 Aug 2015 03:49:03 +0000</pubDate>
		<dc:creator><![CDATA[ulwvfje]]></dc:creator>
				<category><![CDATA[生信基础]]></category>
		<category><![CDATA[ape]]></category>
		<category><![CDATA[genebank]]></category>
		<category><![CDATA[hpv]]></category>
		<category><![CDATA[批量下载]]></category>

		<guid isPermaLink="false">http://www.bio-info-trainee.com/?p=934</guid>
		<description><![CDATA[最新文献 http://www.ncbi.nlm.nih.gov/pubmed/ &#8230; <a href="http://www.bio-info-trainee.com/934.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<h4>最新文献 <a href="http://www.ncbi.nlm.nih.gov/pubmed/26086163">http://www.ncbi.nlm.nih.gov/pubmed/26086163</a> 上面有提到了hpv的研究现状</h4>
<p>As of May 30, 2015, 201 different HPV types had been completely sequenced and officially recognized and divided into five PV-genera: Alpha-, Beta-, Gamma-, Mu-, and Nupapillomavirus.</p>
<p>根据文献，我找到了hpv所有已知测序种类的参考基因组网站：</p>
<p><a href="http://www.hpvcenter.se/html/refclones.html">http://www.hpvcenter.se/html/refclones.html</a></p>
<p>到目前（2015年7月31日15:17:59）已经有了205种，我爬取它们的genebank ID号，然后用python程序批量下载了它们的序列，能下载的序列共179条，都是8K左右的碱基序列。</p>
<p><a href="http://www.bio-info-trainee.com/wp-content/uploads/2015/08/image001.png"><img class="alignnone size-full wp-image-935" src="http://www.bio-info-trainee.com/wp-content/uploads/2015/08/image001.png" alt="image001" width="978" height="671" /></a></p>
<p>根据genebank ID或者其它ID号批量下载核酸序列的脚本如下：</p>
<p>[python]&lt;/pre&gt;<br />
import sys</p>
<p>import time</p>
<p>import random</p>
<p>from Bio import Entrez</p>
<p>ids=[]</p>
<p>infile=sys.argv[1]</p>
<p>for line in open(infile,'r'):</p>
<p>line=line.strip()</p>
<p>ids.append(line)</p>
<p>for i in range(1,len(ids)):</p>
<p>#       t = random.randrange(0,5)</p>
<p>handle =</p>
<p>Entrez.efetch(db=&quot;nucleotide&quot;, id=ids[i],rettype=&quot;fasta&quot;,email=&quot;jmzeng1314@163.com&quot;)</p>
<p>#       time.sleep(t)</p>
<p>print handle.read()</p>
<p>[/python]</p>
<p>脚本使用很简单，保持输入文件是一行一个ID号即可。</p>
<p>同时，根据文献我们也能得到hbv病毒提取方法</p>
<p>当然，我是看不懂的。</p>
<p><a href="http://www.bio-info-trainee.com/wp-content/uploads/2015/08/image003.png"><img class="alignnone size-full wp-image-936" src="http://www.bio-info-trainee.com/wp-content/uploads/2015/08/image003.png" alt="image003" width="712" height="484" /></a></p>
<p>同样的拿到下载的178条序列我们可以做一个进化树，当然，这个文章已经做好了，我就不做了，进化树其实蛮简单的。</p>
<p>下载179条hpv序列，每条序列都是8KB左右</p>
<p>我还用了R脚本批量下载</p>
<p>library(ape)</p>
<p>a=read.table("hpv_all.ID") #输入文件是一行一个ID号即可</p>
<p>for (i in 1:nrow(a)){</p>
<p>tmp=read.GenBank(a[i,1],seq.names = a[1,1],as.character = T)</p>
<p>write.dna(tmp,"tmp.fa",format="fasta", append=T,colsep = "")</p>
<p>}</p>
<p>然后用muscle做比对，参照我之前的笔记</p>
<p><a href="qq://txfile/">http://www.bio-info-trainee.com/?p=659</a><br />
<a href="qq://txfile/">http://www.bio-info-trainee.com/?p=660</a><br />
<a href="qq://txfile/">http://www.bio-info-trainee.com/?p=626</a></p>
<p>muscle -in mouse_J.pro -out mouse_J.pro.a</p>
<p>muscle -maketree -in mouse_J.pro.a -out mouse_J.phy</p>
<p>貌似时间有点长呀，最后还莫名其妙的挂掉了，可能是我的服务器配置有点低。</p>
<p><a href="http://www.bio-info-trainee.com/wp-content/uploads/2015/08/image005.png"><img class="alignnone size-full wp-image-937" src="http://www.bio-info-trainee.com/wp-content/uploads/2015/08/image005.png" alt="image005" width="559" height="178" /></a></p>
<p>进化树如下所示：</p>
<p><a href="http://www.bio-info-trainee.com/wp-content/uploads/2015/08/image006.png"><img class="alignnone size-full wp-image-938" src="http://www.bio-info-trainee.com/wp-content/uploads/2015/08/image006.png" alt="image006" width="706" height="775" /></a></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bio-info-trainee.com/934.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
