<?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; sqlite</title>
	<atom:link href="http://www.bio-info-trainee.com/tag/sqlite/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>在R里面操作SQLite</title>
		<link>http://www.bio-info-trainee.com/1421.html</link>
		<comments>http://www.bio-info-trainee.com/1421.html#comments</comments>
		<pubDate>Sun, 28 Feb 2016 03:20:53 +0000</pubDate>
		<dc:creator><![CDATA[ulwvfje]]></dc:creator>
				<category><![CDATA[基础数据库]]></category>
		<category><![CDATA[bioconductor]]></category>
		<category><![CDATA[R]]></category>
		<category><![CDATA[sqlite]]></category>

		<guid isPermaLink="false">http://www.bio-info-trainee.com/?p=1421</guid>
		<description><![CDATA[我前面写到过如何把数据库写到mysql，但是发现其实msyql并不方便，需要连接 &#8230; <a href="http://www.bio-info-trainee.com/1421.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<div>
<div>我前面写到过如何把数据库写到mysql，但是发现其实msyql并不方便，需要连接数据库什么的，如果发布一个离线小网页，这时候sqlite的优点就显示出来了！</div>
<div>基础代码很简单：</div>
<div>
<div><span style="font-family: Times;">library(RSQLite)</span></div>
<div><span style="font-family: Times;">sqlite    &lt;- dbDriver("SQLite")</span></div>
<div><span style="font-family: Times;">con &lt;- dbConnect(sqlite,"hg19_bioconductor.sqlite") # makes a new file</span></div>
<div><span style="font-family: Times;">suppressMessages(library(org.Hs.eg.db))</span></div>
<div><span style="font-family: Times;">kegg2ID=toTable(org.Hs.egPATH)</span></div>
<div><span style="font-family: Times;">#[1] "gene_id" "path_id"</span></div>
<div><span style="font-family: Times;">dbWriteTable(con,'keggID2geneID',kegg2ID,row.name=F,overwrite=T)</span></div>
<div>具体代码，可以看我的github主页：https://github.com/jmzeng1314/my-R/blob/master/3-get-hg19-gene-mapping/get-hg19-gene-mapping-bioconductor.R</div>
<div>做出来的数据，如下，就是几个table存储在文件里面！</div>
</div>
</div>
<div> <a href="http://www.bio-info-trainee.com/wp-content/uploads/2016/02/22.png"><img class="alignnone size-full wp-image-1423" src="http://www.bio-info-trainee.com/wp-content/uploads/2016/02/22.png" alt="2" width="743" height="527" /></a></div>
<div>最后这些数据都保存在了当前工作目录下的hg19_bioconductor.sqlite文件里面！</div>
<div>在其它程序里面就可以直接调用这个文件，而不需要加载一大堆的包了！<br />
<a href="http://www.bio-info-trainee.com/wp-content/uploads/2016/02/11.png"><img class="alignnone size-full wp-image-1422" src="http://www.bio-info-trainee.com/wp-content/uploads/2016/02/11.png" alt="1" width="477" height="378" /></a></div>
<div>
<div><span style="font-family: Times;">library(KEGG.db)</span></div>
<div><span style="font-family: Times;">library(GO.db)</span></div>
<p>library(org.Hs.eg.db )</p></div>
<div>
<div>一个R语言package：<a href="https://cran.r-project.org/web/packages/RSQLite/RSQLite.pdf">https://cran.r-project.org/web/packages/RSQLite/RSQLite.pdf</a></div>
<div>参考：<a href="https://scottishsnow.wordpress.com/2014/08/14/writing-to-a-database-r-and-sqlite/">https://scottishsnow.wordpress.com/2014/08/14/writing-to-a-database-r-and-sqlite/</a></div>
<div>很好用，跟mysql一样！</div>
<div>示例代码：<a href="http://faculty.washington.edu/kenrice/sisg-adv/exampleSQLite.R">http://faculty.washington.edu/kenrice/sisg-adv/exampleSQLite.R</a></div>
</div>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bio-info-trainee.com/1421.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
