部署ShinyApp

<生信交流与合作请关注公众号@生信探索>

需求:更新网页中的gitlab仓库网址和邮箱

克隆

git clone https://gitlab.com/BioQuest/CESA.git
tree CESA
# CESA
# ├── LICENSE
# ├── README.md
# ├── rsconnect
# │   └── shinyapps.io
# │       └── bioquest
# │           └── cesa.dcf
# ├── server.R
# ├── ui.R
# └── www
#     └── source.R

# 5 directories, 6 files

UI

library(shiny)
library(readr)
options(encoding="UTF-8")
# Define UI for application that draws a histogram
source('www/source.R')
shinyUI(fluidPage(
    tags$style("@import url(https://use.fontawesome.com/releases/v6.0.0/css/all.css);"),
    tags$style(
        ".p1,.p2,.p3 {
      color: #3b6089;
    }"

    ),
    # Sidebar 
    sidebarLayout(
        sidebarPanel(
            
            p(class = "p1","Please paste your data below, which contains one dataframe of three colums, ",tags$b('days,'),tags$b('group1,'),tags$b('group2.')),
            tags$br(),
            p(class = "p2","You can use customed header, and the second column name will be the file name of download."),
            p(class = "p3","You may run the sample file as shown in text box."),
            actionButton(inputId = "Run",label = "Run",width="90%",icon=icon("person-running",verify_fa = FALSE)),
            tags$br(),
            tags$br(),
            downloadButton("downspss",label='Download SPSS',width="30%"),
            downloadButton("downtable",label='Download Table',width="30%"),
            downloadButton("downplot",label='Download Plot',width="30%"),
            tags$br(),
            textAreaInput("file5""", value=Text,width="90%",height = "400px",
                          cols=3,rows = 100,resize = "both",placeholder=Text),
            tags$div(
                tags$h5('Author: Victor'),
                tags$h5("Email: Victor@BioQuest.cn"),
                tags$a(href="https://BioQuest.cn""Website: BioQuest.cn"),
                tags$a(href="https://gitlab.com/BioQuest/CESA""Source Code"))
        ),
        mainPanel(
            tags$h1(tags$em("Caenorhabditis elegans"),"survival analysis"),
            tags$hr(),
            tableOutput(outputId='table1'),
            tags$p(tags$b('meanse:'),"mean ± SEM, ", tags$b('pv:'),"p-value, ", tags$b('PLC:'),"percent life span change, ", tags$b('N:'),"number of each group"),
            plotOutput("plot1",
                       width = "50%",
                       height = "500px"),
            hr(),
))))

部署

获取token和密钥

alt
alt
install.packages("rsconnect")
library(rsconnect)
rsconnect::setAccountInfo(name='bioquest', token='XXXXXX', secret='XXXXXX/XXXXXX')
deployApp()
# Preparing to deploy application...Update application currently deployed at
# https://bioquest.shinyapps.io/cesa/? [Y/n] Y
# DONE
# Preparing to deploy application...DONE
# Uploading bundle for application: 8612139...DONE
# Deploying bundle: 6980026 for application: 8612139 ...
# Waiting for task: 1283408108
#   building: Building image: 8278782
#   building: Fetching packages
#   building: Installing packages
#   building: Installing files
#   building: Pushing image: 8278782
#   deploying: Starting instances
#   success: Stopping old instances
# Application successfully deployed to https://bioquest.shinyapps.io/cesa/

https://bioquest.shinyapps.io/cesa/ 可以访问了

alt

本文由 mdnice 多平台发布

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值