<?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/%e7%bd%91%e9%a1%b5/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>mysql的table居然有最大列限制</title>
		<link>http://www.bio-info-trainee.com/1988.html</link>
		<comments>http://www.bio-info-trainee.com/1988.html#comments</comments>
		<pubDate>Mon, 07 Nov 2016 12:19:33 +0000</pubDate>
		<dc:creator><![CDATA[ulwvfje]]></dc:creator>
				<category><![CDATA[R]]></category>
		<category><![CDATA[基础软件]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[癌种]]></category>
		<category><![CDATA[网页]]></category>

		<guid isPermaLink="false">http://www.bio-info-trainee.com/?p=1988</guid>
		<description><![CDATA[想着把TCGA的RPKM值矩阵表格写入到mysql，然后做一个查询网页给生物学家 &#8230; <a href="http://www.bio-info-trainee.com/1988.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<div>想着把TCGA的RPKM值矩阵表格写入到mysql，然后做一个查询网页给生物学家，我下载的是<a href="http://www.bio-info-trainee.com/1274.html">所有TCGA收集的mRNA表达数据集数据集-GSE62944</a> ，共9264个癌症样本，和741个正常组织的表达数据。当我想写入癌症表达矩阵的时候，报错了：</div>
<div>Error in .local(conn, statement, ...) :</div>
<div>could not run statement: Too many columns</div>
<div>简单搜索了一下，发现是mysql有最大列的限制，但是我不是很懂计算机，所以没太看明白该如何调整参数使得mysql列限制扩充：<a href="http://dev.mysql.com/doc/refman/5.7/en/column-count-limit.html">http://dev.mysql.com/doc/refman/5.7/en/column-count-limit.html</a> 所以就把癌症表达矩阵根据癌症拆分了，癌种数量如下：</div>
<p><span id="more-1988"></span></p>
<div>table(tumorCancerType2amples$CancerType)</div>
<div></div>
<div>ACC BLCA BRCA CESC COAD DLBC GBM HNSC KICH KIRC KIRP LAML LGG LIHC LUAD LUSC OV PRAD READ SKCM STAD THCA UCEC UCS</div>
<div>79 414 1119 306 483 48 170 504 66 542 291 178 532 374 541 502 430 502 167 472 420 513 554 57</div>
<div></div>
<div>分开写入mysql，下面给出解决方案及代码：</div>
<div></div>
<blockquote>
<div>tumorRPKM=read.table('GSM1536837_06_01_15_TCGA_24.tumor_Rsubread_FPKM.txt.gz',sep = '\t',stringsAsFactors = F,header = T)</div>
<div>colnames(tumorRPKM)[1]='geneSymbol'</div>
<div>rownames(tumorRPKM)=tumorRPKM$geneSymbol</div>
<div>tumorRPKM=tumorRPKM[,-1]</div>
<div>tumorRPKM=round( as.matrix(tumorRPKM),3)</div>
<div>tumorRPKM=as.data.frame(tumorRPKM)</div>
<div>tumorRPKM$geneSymbol = rownames(tumorRPKM)</div>
<div>#load(file = 'tumorRPKM.rData')</div>
<div>tumorCancerType2amples=read.table('GSE62944_06_01_15_TCGA_24_CancerType_Samples.txt',sep = '\t',stringsAsFactors = F)</div>
<div>colnames(tumorCancerType2amples)=c('sampleID','CancerType')</div>
<div>lapply(unique((tumorCancerType2amples$CancerType)), function(x){</div>
<div>#x='PRAD';</div>
<div>sampleList=tumorCancerType2amples[tumorCancerType2amples$CancerType==x,1]</div>
<div>sampleList=gsub("-",".", sampleList)</div>
<div>tmpMatrix=tumorRPKM[,c('geneSymbol',sampleList)]</div>
<div>dbWriteTable(con, paste('tumor',x,'RPKM',sep='_'), tmpMatrix, append=F,row.names=F)</div>
<div></div>
<div>})</div>
</blockquote>
<div>dbWriteTable这个函数，需要加载RMySQL，而且还需要连接好mysql数据库，不然你根本就看不懂的！</div>
<div>写入数据库如下：</div>
<div><img src="file:///C:/Users/jimmy1314/AppData/Local/YNote/data/jmzeng1314@163.com/37a5e2c5545348da8dfb48c791b8be99/clipboard.png" alt="" data-media-type="image" data-attr-org-src-id="8BE4BAC459CA49CC97F3871348380CEC" /></div>
<div><a href="http://www.bio-info-trainee.com/wp-content/uploads/2016/11/tmp.png"><img class="alignnone size-full wp-image-1989" src="http://www.bio-info-trainee.com/wp-content/uploads/2016/11/tmp.png" alt="tmp" width="418" height="559" /></a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.bio-info-trainee.com/1988.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>安装自己的shiny服务器-实战指南</title>
		<link>http://www.bio-info-trainee.com/1677.html</link>
		<comments>http://www.bio-info-trainee.com/1677.html#comments</comments>
		<pubDate>Sat, 04 Jun 2016 01:07:29 +0000</pubDate>
		<dc:creator><![CDATA[ulwvfje]]></dc:creator>
				<category><![CDATA[R]]></category>
		<category><![CDATA[生信基础]]></category>
		<category><![CDATA[shiny服务器]]></category>
		<category><![CDATA[网页]]></category>

		<guid isPermaLink="false">http://www.bio-info-trainee.com/?p=1677</guid>
		<description><![CDATA[个人比较欣赏R shiny制作的网页，入门简单，上手极快，多看点例子，制作复杂逻 &#8230; <a href="http://www.bio-info-trainee.com/1677.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>个人比较欣赏R shiny制作的网页，入门简单，上手极快，多看点例子，制作复杂逻辑的网页也不是问题。这篇实战指南有四个步骤：</p>
<blockquote><p>至少需要root权限的linux系统  （我测试了阿里云）<br />
安装R   （一般安装最新版，）<br />
在R中安装shiny模块   （一般还可以多安装一些模块）<br />
下载并且安装shiny server安装包    （根据系统选择）</p></blockquote>
<p><span id="more-1677"></span></p>
<p>前面三个步骤没有什么好说的了，如果你需要继续看这篇指南，我就默认你已经会了。</p>
<div>那么重点，就是安装shiny server本身咯：</div>
<div>这里<a href="http://www.rstudio.com/products/shiny/download-server/">http://www.rstudio.com/products/shiny/download-server/</a> 提供了下载链接，需要提供邮箱才会出现下载页面，选择对应Linux发行版的Shiny Server进行下载。<strong>我这里是CentOS 6.5.</strong></div>
<div></div>
<blockquote>
<div><strong>64bit</strong><br />
Size:  44.6 MB<br />
MD5: 45160b08eed65c89e0a9d03c58eba595<br />
Version:  1.4.2.786<br />
Released:  2016-02-19</div>
<div>#直接下载安装包，所以非常简单，我的命令是：</div>
<div><code>sudo yum install R</code></div>
<div><code><code>$ wget https://download3.rstudio.org/centos5.9/x86_64/<span style="color: #ff0000;">shiny-server-1.4.2.786-rh5-x86_64.rpm</span><br />
$ sudo yum install --nogpgcheck <strong>shiny-server-1.4.2.786-rh5-x86_64.rpm</strong></code><br />
</code></div>
</blockquote>
<div>这里我也是学习的别人的方法，参考：</div>
<div><a href="http://ju.outofmemory.cn/entry/162254">http://ju.outofmemory.cn/entry/162254</a></div>
<div>
<div><a href="http://www.lai18.com/content/1733097.html">http://www.lai18.com/content/1733097.html</a></div>
<div><strong>如果系统很烂，缺少一堆的库文件，</strong>简单的<code>sudo yum install</code>还会各种报错，如果需要下载源码来安装，那会很麻烦，这里就不讨论了。</div>
<div></div>
<div>如果安装成功，就有下面的界面：</div>
<div><a href="http://www.bio-info-trainee.com/wp-content/uploads/2016/06/11.png"><img class="alignnone size-full wp-image-1678" src="http://www.bio-info-trainee.com/wp-content/uploads/2016/06/11.png" alt="1" width="440" height="472" /></a></div>
<div>成功之后就可以浏览shiny的网页了，程序自带测试例子，如果是在本地linux系统，而且自带浏览器的界面版linux，那么直接在浏览器中输入 localhost:3838 (或者对应IP地址， 如 <a href="http://192.168.1.100:3838/">http://192.168.1.100:3838/</a> 这个IP是假的 )就会出现。</div>
<div><a href="http://www.bio-info-trainee.com/wp-content/uploads/2016/06/4.png"><img class="alignnone size-full wp-image-1681" src="http://www.bio-info-trainee.com/wp-content/uploads/2016/06/4.png" alt="4" width="694" height="380" /></a></div>
<div></div>
<div>但是阿里云服务器访问一般通过外网链接，因为要通过你的真正IP来访问3838端口，<strong>所以需要设置防火墙规则，不然依然是不能访问，防火墙自己学习如何设置把。</strong></div>
<div><a href="http://www.bio-info-trainee.com/wp-content/uploads/2016/06/3.png"><img class="alignnone size-full wp-image-1680" src="http://www.bio-info-trainee.com/wp-content/uploads/2016/06/3.png" alt="3" width="593" height="264" /></a></div>
<div>安装成功了之后，还有一个更重要的事情就是维护，我下面简单介绍一些，然后会写一篇维护心得体会：</div>
<div>
<div>shiny官网上提供了详细的配置指导</div>
<div><a href="http://rstudio.github.io/shiny-server/latest/">http://rstudio.github.io/shiny-server/latest/</a></div>
<div>
<div>shiny-server 默认的安装目录是：/opt/shiny-server</div>
<div>目录内容：</div>
<div>
<div><a href="http://www.bio-info-trainee.com/wp-content/uploads/2016/06/21.png"><img class="alignnone size-full wp-image-1679" src="http://www.bio-info-trainee.com/wp-content/uploads/2016/06/21.png" alt="2" width="514" height="100" /></a></div>
<div></div>
<div>其中的默认配置文件是：/opt/shiny-server/config/default.config</div>
<div>内容是：</div>
<div></div>
</div>
<div><span style="font-family: Monaco,Consolas,Courier,Lucida Console,monospace;"># Instruct Shiny Server to run applications as the user “shiny”</span></div>
<div><span style="font-family: Monaco,Consolas,Courier,Lucida Console,monospace;">run_as shiny;</span></div>
<div><span style="font-family: Monaco,Consolas,Courier,Lucida Console,monospace;"> </span></div>
<div><span style="font-family: Monaco,Consolas,Courier,Lucida Console,monospace;"># Define a server that listens on port 3838</span></div>
<div><span style="font-family: Monaco,Consolas,Courier,Lucida Console,monospace;">server {</span></div>
<div><span style="font-family: Monaco,Consolas,Courier,Lucida Console,monospace;">  listen 3838;</span></div>
<div><span style="font-family: Monaco,Consolas,Courier,Lucida Console,monospace;"> </span></div>
<div><span style="font-family: Monaco,Consolas,Courier,Lucida Console,monospace;">  # Define a location at the base URL</span></div>
<div><span style="font-family: Monaco,Consolas,Courier,Lucida Console,monospace;">  location / {</span></div>
<div><span style="font-family: Monaco,Consolas,Courier,Lucida Console,monospace;"> </span></div>
<div><span style="font-family: Monaco,Consolas,Courier,Lucida Console,monospace;">    # Host the directory of Shiny Apps stored in this directory</span></div>
<div><span style="font-family: Monaco,Consolas,Courier,Lucida Console,monospace;">    site_dir /srv/shiny-server;</span></div>
<div><span style="font-family: Monaco,Consolas,Courier,Lucida Console,monospace;"> </span></div>
<div><span style="font-family: Monaco,Consolas,Courier,Lucida Console,monospace;">    # Log all Shiny output to files in this directory</span></div>
<div><span style="font-family: Monaco,Consolas,Courier,Lucida Console,monospace;">    log_dir /var/log/shiny-server;</span></div>
<div><span style="font-family: Monaco,Consolas,Courier,Lucida Console,monospace;"> </span></div>
<div><span style="font-family: Monaco,Consolas,Courier,Lucida Console,monospace;">    # When a user visits the base URL rather than a particular application,</span></div>
<div><span style="font-family: Monaco,Consolas,Courier,Lucida Console,monospace;">    # an index of the applications available in this directory will be shown.</span></div>
<div><span style="font-family: Monaco,Consolas,Courier,Lucida Console,monospace;">    directory_index on;</span></div>
<div><span style="font-family: Monaco,Consolas,Courier,Lucida Console,monospace;">  }</span></div>
<div><span style="font-family: Monaco,Consolas,Courier,Lucida Console,monospace;">}</span></div>
<div>
<div></div>
<div><span style="color: #ff0000;">这个文件和/etc/shiny-server/shiny-server.conf是一样的。</span></div>
<div><span style="color: #ff0000;">后面会具体讲解shiny server的配置细节。正如配置文件中所写，默认的网站目录是根目录下的srv的shiny-server目录，端口是3838，log目录是 /var/log/shiny-server。</span></div>
<div>
<div>默认程序存放在： <strong>/srv/shiny-server</strong></div>
<div>lrwxrwxrwx. 1 root root 38 Nov 25 00:02 index.html -&gt; /opt/shiny-server/samples/welcome.html</div>
<div>lrwxrwxrwx. 1 root root 37 Nov 25 00:02 sample-apps -&gt; /opt/shiny-server/samples/sample-apps</div>
<div>其实就是opt下对应的链接。</div>
</div>
</div>
</div>
</div>
<div></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.bio-info-trainee.com/1677.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>强烈推荐用shiny来制作交互式网页展现数据</title>
		<link>http://www.bio-info-trainee.com/1498.html</link>
		<comments>http://www.bio-info-trainee.com/1498.html#comments</comments>
		<pubDate>Wed, 23 Mar 2016 14:14:57 +0000</pubDate>
		<dc:creator><![CDATA[ulwvfje]]></dc:creator>
				<category><![CDATA[R]]></category>
		<category><![CDATA[shiny]]></category>
		<category><![CDATA[交互]]></category>
		<category><![CDATA[网页]]></category>

		<guid isPermaLink="false">http://www.bio-info-trainee.com/?p=1498</guid>
		<description><![CDATA[shiny是Rstudio公司推出的一个网页服务器，可以直接用R语言制作客户端和 &#8230; <a href="http://www.bio-info-trainee.com/1498.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>shiny是Rstudio公司推出的一个网页服务器，可以直接用R语言制作客户端和服务端程序来交互式的展现数据，而且有越来越丰富的扩展包可以借鉴使用，我觉得它的前途很光明，值得大家入坑！</p>
<p>虽然Rstudio公司吹嘘初学者无需具备html和css，js基础，但是个人认为还是多了解一下比较好，可以在<a href="http://www.w3school.com.cn/">w3cschool</a>里面在线学习！</p>
<p>新手安装好shiny包之后里面自带了12个app例子，一边调试一边学习，很快就可以入门了。推荐一个教程，<a href="http://yanping.me/shiny-tutorial/">用shiny构建网页中文教程</a>，想查看更详细的介绍和实例，请访问<a href="http://www.rstudio.com/shiny">Shiny的官方主页</a>。当然，你肯定需要要会R，这里有个R的<a href="https://cran.r-project.org/bin/windows/base/rw-FAQ.html#Introduction">FAQ教程。</a></p>
<p>如果你完全看完了上面那些，说明你已经真正入门了！</p>
<p>你现在可以去搜索一个shiny cheetsheet，然后背诵下来！！！！</p>
<p>然后你可以去shiny的github里面找到108个示例程序，一个个运行了解它们！！！</p>
<p>这时候你已经是高手啦！！！</p>
<p>接下来你应该取了解一个叫做dashboard的东西，熟练UI界面设计。</p>
<p>最后你再了解一些辅助包，帮助你用shiny更好的展示数据，主要是<a href="http://www.htmlwidgets.org/">JS绘图插件</a></p>
<p>里面最出名的就是DT包了，一定要学！！！</p>
<p>最后你可以了解一下在rstudio上面分享五个免费的shiny网页程序，需要你搜索一些。</p>
<p>如果你还感兴趣的话，就可以自己整一个虚拟机Ubuntu或者centos系统，试着安装shiny的server，这个比较考验技术。</p>
<p>总结：你可以需要200个小时左右来完全掌握shiny</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bio-info-trainee.com/1498.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
