<?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; shiny</title>
	<atom:link href="http://www.bio-info-trainee.com/tag/shiny/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的shiny 服务器管理-入门</title>
		<link>http://www.bio-info-trainee.com/1683.html</link>
		<comments>http://www.bio-info-trainee.com/1683.html#comments</comments>
		<pubDate>Sat, 04 Jun 2016 01:14:09 +0000</pubDate>
		<dc:creator><![CDATA[ulwvfje]]></dc:creator>
				<category><![CDATA[R]]></category>
		<category><![CDATA[生信基础]]></category>
		<category><![CDATA[shiny]]></category>
		<category><![CDATA[shiny服务器]]></category>

		<guid isPermaLink="false">http://www.bio-info-trainee.com/?p=1683</guid>
		<description><![CDATA[如果你已经安装好了shiny 服务器，(安装教程)要开始使用了，掌握一些基础知识 &#8230; <a href="http://www.bio-info-trainee.com/1683.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>如果你已经安装好了shiny 服务器，(<a href="http://www.bio-info-trainee.com/1677.html">安装教程</a>)要开始使用了，掌握一些基础知识是必须的。这里我简单学习了一些入门资料，分享给大家，慢慢的我会写一个进阶资料。安装成功之后，系统会增加4个目录，是一定要掌握的：</p>
<blockquote>
<div><span style="color: #ff0000;">1、这个目录只存放关键配置文件：/etc/shiny-server/shiny-server.conf   初始状态只有一个文件，记录着非常多的默认信息，默认的网站目录是根目录下的srv的shiny-server目录，端口是3838<br />
</span></div>
<div>2、网站运行log日子存放：/var/log/shiny-server  初始状态下该目录为空</div>
<div>3、程序存放目录是：/srv/shiny-server 初始状态，有一个测试程序：</div>
</blockquote>
<div>
<blockquote>
<div>4、最后是/opt/shiny-server/ 目录，这里面也有一个配置文件：/opt/shiny-server/config/default.config</div>
</blockquote>
</div>
<p><span id="more-1683"></span></p>
<div>还有一个比较重要的文件，取决于linux系统的种类</div>
<div><strong>/etc/systemd/system/shiny-server.service 我的是 (RedHat 7, Ubuntu 15.04+, SLES 12+)</strong></div>
<div>如果是其它一些旧的系统会是/etc/init/shiny-server.conf  (Ubuntu 12.04 through 14.10 and RedHat 6)</div>
<div><span style="font-family: Monaco,Consolas,Courier,Lucida Console,monospace;">或者更旧的系统 </span>/etc/init.d/shiny-server   (RedHat 5, SLES 11)</div>
<div></div>
<div></div>
<div>关于shiny 服务器常见的需要控制的命令,基于我的linux系统版本<strong>(RedHat 7, Ubuntu 15.04+, SLES 12+)</strong></div>
<div>
<div>sudo systemctl start shiny-server</div>
<div>sudo systemctl stop shiny-server</div>
<div>sudo systemctl restart shiny-server</div>
<div>sudo systemctl kill -s HUP --kill-who=main shiny-server</div>
<div>sudo systemctl status shiny-server  ## 查看状态</div>
<div>sudo systemctl enable shiny-server  ## 开机启动</div>
<div>sudo systemctl disable shiny-server ## 关闭开机启动</div>
<div>## 如果是其它linux版本，请参照shiny官网的服务器维护指南：<a href="http://rstudio.github.io/shiny-server/latest/">http://rstudio.github.io/shiny-server/latest/</a></div>
<div></div>
<div>
<div>关于shiny 服务器配置，虽然默认根目录下的/srv的shiny-server目录，端口是3838</div>
<div>
<pre><code>server {
  listen 3838;location / {</code></pre>
<pre>    site_dir /srv/shiny-server;</pre>
<pre><code>log_dir /var/log/shiny-server;directory_index on;
  }
}</code></pre>
<pre><code>可以设置多个端口监听</code></pre>
<pre><code>server {
  listen 4949;location / {</code></pre>
<pre>    site_dir /srv/shiny-server;</pre>
<pre><code>log_dir /var/log/shiny-server;directory_index on; } }</code></pre>
<p>因为我们是以shiny这个用户来运行这些shiny的web app的，所以要给予一定的目录一些适当的权限给shiny用户。</p></div>
<div>首先是需要写的目录</div>
<div>
<ul>
<li><code>/var/lib/shiny-server/</code> (or whatever custom <code>SHINY_DATA_DIR</code> setting you're using)</li>
<li><code>/var/log/shiny-server/</code> (and/or whatever other directories you use for logging)</li>
</ul>
</div>
<div>然后是需要读取的目录</div>
<div>
<ul>
<li><code>/srv/shiny-server/</code> (and/or whatever other directories you're using to host Shiny applications)</li>
<li><code>/opt/shiny-server/</code></li>
<li><code>/etc/shiny-server/</code> (Note that you should enable <strong>only</strong> read access on this directory, as you likely don't want to allow your Shiny applications (which also run as <code>shiny</code>) to be able to write to your configuration or password file.)</li>
</ul>
</div>
<div>还有，如果<code>/tmp/shiny-server/目录存在的话，也需要设置好相应的权限。</code></div>
<div><code> </code></div>
<div></div>
<div>然后就可以把shiny官网的例子克隆到自己的服务器里面，开始在shiny的世界里面遨游啦！</div>
<div>
<div>git clone <a href="https://github.com/rstudio/shiny-examples.git">https://github.com/rstudio/shiny-examples.git</a></div>
</div>
<div>还有 <a href="https://github.com/ua-snap/shiny-apps">https://github.com/ua-snap/shiny-apps</a></div>
<div></div>
<div>
<div><span style="font-family: Monaco,Consolas,Courier,Lucida Console,monospace;">网页运行里面会经常需要Rmarkdown</span></div>
<div>
<div>sudo su - -c "R -e \"install.packages('rmarkdown',repos='<a href="http://mirror.bjtu.edu.cn/cran/">http://mirror.bjtu.edu.cn/cran/</a>')\""</div>
</div>
</div>
<div>收费版本还有很多其它功能:</div>
<div>The <code>app_session_timeout</code> setting can be used to automatically disconnect idle Shiny connections.</div>
<div>Shiny Server is capable of automatically inserting the necessary JavaScript code to enable Google Analytics tracking globally or for a particular <code>server</code> or <code>location</code>.</div>
<div>Memory limits will be added in a coming version of Shiny Server Professional.</div>
<div>Shiny Server can use a wide variety of techniques to keep the data in the web browser synchronized. The preferred technique, and the one most widely used, is the use of WebSockets.</div>
<div>Shiny Server Professional offers the ability to authenticate individual users. By specifying authentication requirements on particular <code>server</code>s or <code>location</code>s, the administrator can control the set of applications particular users are allowed to access.(<code> session$user  和 </code><code>session$groups</code>)</div>
<div>Regardless of which authentication mechanism is used, the duration of authentication can be configured using the <code>auth_duration</code> setting.</div>
<div>Shiny Server Pro supports the ability to rely on Google for the management of your users using the <code>auth_google</code> setting.</div>
<div>In Shiny Server Professional, SSL encryption is available for any configured <code>server</code> and in the <code>admin</code> interface. SSL is a means of encrypting traffic between web clients and servers and should be used for any application that will accept or transmit sensitive information such as passwords.</div>
</div>
<div></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.bio-info-trainee.com/1683.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>
		<item>
		<title>用R的shiny包写一个基因的ID转换小程序</title>
		<link>http://www.bio-info-trainee.com/1425.html</link>
		<comments>http://www.bio-info-trainee.com/1425.html#comments</comments>
		<pubDate>Sun, 28 Feb 2016 04:05:22 +0000</pubDate>
		<dc:creator><![CDATA[ulwvfje]]></dc:creator>
				<category><![CDATA[R]]></category>
		<category><![CDATA[shiny]]></category>
		<category><![CDATA[转换]]></category>

		<guid isPermaLink="false">http://www.bio-info-trainee.com/?p=1425</guid>
		<description><![CDATA[基因的ID现在可能有一千多种，但是我们一般只用NCBI的entrez ID，和H &#8230; <a href="http://www.bio-info-trainee.com/1425.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<div>基因的ID现在可能有一千多种，但是我们一般只用NCBI的entrez ID，和HUGO组装规定的gene symbol和gene name</div>
<div>再者有人会用ensembl的ID，至于UCSC的ID很少人用了，更别说剩余的一大堆稀奇古怪的ID了。</div>
<div><a href="http://www.bio-info-trainee.com/wp-content/uploads/2016/02/ID_example.png"><img class="alignnone size-full wp-image-1428" src="http://www.bio-info-trainee.com/wp-content/uploads/2016/02/ID_example.png" alt="ID_example" width="724" height="352" /></a></div>
<div>
<div><a href="http://www.genecards.org/cgi-bin/carddisp.pl?gene=TP53">http://www.genecards.org/cgi-bin/carddisp.pl?gene=TP53</a></div>
</div>
<div>其实没必要自己写一个软件来转换，因为非常多的现成软件都可以做到!</div>
<div>不过可以拿这个简单的任务来练手！</div>
<div>首先自己做好数据库文件：</div>
<div>
<div>我是把数据写到了一个sqlite文件里面了！结构很简单</div>
<div>然后设计软件的界面，俗称UI端，也是很容易，在shiny里面，记住几个控件的函数即可！</div>
<div><a href="http://www.bio-info-trainee.com/wp-content/uploads/2016/02/UI_1.png"><img class="alignnone size-full wp-image-1426" src="http://www.bio-info-trainee.com/wp-content/uploads/2016/02/UI_1.png" alt="UI_1" width="1356" height="585" /></a> <a href="http://www.bio-info-trainee.com/wp-content/uploads/2016/02/UI_2.png"><img class="alignnone size-full wp-image-1427" src="http://www.bio-info-trainee.com/wp-content/uploads/2016/02/UI_2.png" alt="UI_2" width="1208" height="635" /></a></div>
<div></div>
<div>具体代码见我的github代码：https://github.com/jmzeng1314/my-R/tree/master/4-ID-convert-using-shiny</div>
<div></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.bio-info-trainee.com/1425.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
