-
-
Save freshbiostats/4e5e618431a59abe692b to your computer and use it in GitHub Desktop.
SNP association shiny app
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(shiny) | |
library(SNPassoc) | |
data(SNPs) | |
SNPs <- SNPs[,1:15] | |
dataset <- setupSNP(data = SNPs, colSNPs = 6:15,sep = "") | |
shinyServer(function(input, output) { | |
datasetInput <- reactive({ | |
switch(input$dataset, | |
"snp10001" = dataset$snp10001, | |
"snp10002" = dataset$snp10002, | |
"snp10003" = dataset$snp10003, | |
"snp10004" = dataset$snp10004, | |
"snp10005" = dataset$snp10005, | |
"snp10006" = dataset$snp10006, | |
"snp10007" = dataset$snp10007, | |
"snp10008" = dataset$snp10008, | |
"snp10009" = dataset$snp10009, | |
"snp100010" = dataset$snp100010) | |
}) | |
output$summary <- renderPrint({ | |
summary(dataset) | |
}) | |
output$summary <- renderPrint({ | |
summary(dataset) | |
}) | |
output$snp_association <-renderPrint({ | |
SNP <- datasetInput() | |
assoc <- association(casco~SNP, data=dataset) | |
print(assoc) | |
}) | |
output$snpPlot<-renderPlot({ | |
SNP <- datasetInput() | |
SNP_plot <- plot(SNP) | |
print(SNP_plot) | |
}) | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(shiny) | |
shinyUI(pageWithSidebar( | |
headerPanel("SNP association analysis"), | |
sidebarPanel( | |
selectInput("dataset", "Choose a SNP:", | |
choices = c("snp10001", "snp10002", "snp10003", | |
"snp10004", "snp10005", "snp10006", | |
"snp10007", "snp10008", "snp10009", | |
"snp100010"))), | |
mainPanel( | |
h3("Dataset summary"), | |
verbatimTextOutput("summary"), | |
h3("Single SNP summary"), | |
plotOutput("snpPlot"), | |
h3("Single SNP association results"), | |
verbatimTextOutput("snp_association") | |
) | |
)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment