Commit 1edfb432 authored by Kunst, Jonathan's avatar Kunst, Jonathan
Browse files

Changed IBD page to include more options for estimate_IBD function. importing...

Changed IBD page to include more options for estimate_IBD function. importing .rds file possible but not yet function, needs a switch of some sort
parent 1f233b58
......@@ -10,6 +10,7 @@ library(readr)
library(shiny)
library(shinybusy)
library(polyqtlR)
library(parallel)
# UI ----
# Define page layout, fluidPage automatically adjusts to user border dimensions
......@@ -57,33 +58,60 @@ ui <- fluidPage(
)
),
navbarMenu(# IBD page ----
'IBD', # change to IBD with import + compute
tabPanel('Heuristic',
tabPanel(# IBD page ----
'IBD',
sidebarLayout(
sidebarPanel(
h3('Estimation settings'),
h3('Estimation'),
# method of estimation
selectInput(inputId = 'IBD_method',
label = 'Estimation Method',
choices = c('Heuristic'= 'heur',
'HMM' = 'hmm')),
# mapping function
selectInput(inputId = 'IBD_map',
label = 'Mapping Function',
choices = c('Haldane' = 'haldane',
'Kosambi' = 'kosambi')),
# Ploidy level indicator
numericInput(inputId = 'ploidy',
label = 'Ploidy level',
value = 4),
min = 2,
value = 4,
step = 2),
# cores selection
numericInput(inputId = 'IBD_core',
label = 'Numbers of processing cores',
min = 1,
value = 1,
max = detectCores() - 2),
# Estimate starter
actionButton('heu_estimate',
label = 'Estimate IBD')
label = 'Estimate IBD'),
hr(),
h3('Import'),
# IBD input
fileInput(inputId = 'i_IBD',
label = 'Phenotype file')
),
mainPanel(
h3('Output heuristic method'),
h3('Output'),
plotOutput('plot_haplo')
)
)
),
tabPanel('HMM'),
tabPanel('Import')
),
tabPanel('QTL visualisation'),
......@@ -168,26 +196,21 @@ server <- function(input, output, session) {
# table for linkage map file(s)
output$table_link_map <- DT::renderDataTable(link_map()[[rv$linkage_select()]])
# test text
output$text_link_map <- eventReactive(input$map_choice,
{rvname <- rv$linkage_select()
print(rvname)
print(link_map()[[rvname]])
})
# table for SNP dosage
output$table_dosage <- DT::renderDataTable(dosage())
# table for IBD probability
output$table_IBD <- DT::renderDataTable(IBD())
# IBD imputation ----
# Heuristic IBD estimation
heu_IBD <- eventReactive(input$heu_estimate, {
# IBD estimationputation ----
# IBD estimation
IBD <- eventReactive(input$heu_estimate, {
estimate_IBD(phased_maplist = link_map(),
genotypes = as.matrix(dosage()),
method = input$IBD_method,
map_function = input$IBD_map,
ploidy = input$ploidy,
ncores = 2)
ncores = input$IBD_core)
})
# Modal window to prevent interaction
......@@ -197,7 +220,7 @@ server <- function(input, output, session) {
})
# show table heuristic IBDs
output$plot_haplo <- renderPlot(visualiseHaplo(IBD_list = heu_IBD(),
output$plot_haplo <- renderPlot(visualiseHaplo(IBD_list = IBD(),
display_by = "name",
linkage_group = 1,
select_offspring = colnames(dosage())[3:11],
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment