-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.r
174 lines (136 loc) · 3.91 KB
/
app.r
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
# Main ARMAP application
#
# Author: Nicholas Garcia
# Version 1.0.0
# Date: 2019-05-27
#
#Set path to data folders (folder structure: data/ and src/ folders in root ARMAP folder)
# src folder shall contain all source files
# data folder shall contain folders
# genomes/
# index/
# reads/
# alignments/
# annotations/
# counts/
assign("my_path", paste0(getwd(), '/data/'), envir = .GlobalEnv)
#debug messages
print(my_path)
print(paste0(my_path, 'reads'))
print(list.files(paste0(my_path, 'reads')))
#source files containing logic and per page shiny content panels
source('src/outputLogic.R')
source('src/pipelinePage.R')
source('src/countsPage.R')
source('src/mappingPage.R')
source('src/manualPage.R')
source('src/welcomePage.R')
source('src/utilities.R')
source('src/qc_page_logic.R')
#' Checks for presence of required packages, quits and prints message if not installed
checkDependencies <- function() {
if(1 == 0) {
warning("Dependencies not installed, check manual page")
stop()
}
}
#' Loads required libraries
loadLibraries <- function() {
library(shiny)
library(doParallel)
library(Rqc)
library(Rsubread)
}
loadLibraries()
#' Debug page with several text outputs which allow easy debug prints
debugPage <- function() {
fluidRow(
column(
3,
helpText("I am a debug message"),
hr(),
textOutput("text3")
),
column(
4,
textOutput("text1"),
hr(),
textOutput("text4")
),
column(
3,
textOutput("text2"),
hr(),
textOutput("text5")
)
)
}
#' Defines a Shiny NavListPanel which allows navigation of various pages
navList <- function() {
navlistPanel(
id='nav',
widths=c(3, 9),
#link to documentation pages
"Documentation",
tabPanel("Welcome Page", welcomePage()),
tabPanel("Manual", manualPage()),
tabPanel("Debug", debugPage()),
#link to pipeline page
"Automated Workflow",
tabPanel("Automated Pipeline", pipelinePage()),
#link to individual tool pages
"Tools",
tabPanel("Map Reads", mappingPage()),
tabPanel("Count Features", countsPage())
)
}
#' Define UI for application
ui <- fluidPage(
navList()
)
#'Define server logic for output
#'
#' @param input List of input objects
#' @param output List of output objects
#' @param session Session object for progress bars
server <- function(input, output, session)
{
#degbug page outputs
output$text1 <- renderText({
paste0('Text1: ', input$file_location_counting)#getFileInfo('fasta/psuedo_assembly.fasta'))
})
output$text2 <- renderText({
paste0('Text2: ', input$annotation_counts)
})
output$text3 <- renderText({
paste0('Text3: ', input$nav)
})
output$text4 <- renderText({
paste0('Alignment File: ', input$alignment_file_counts)
})
output$text5 <- renderText({
paste0('Text5: ', input$annotation_local_pipeline$name)
})
#defines logic for generating qc graphs for pipeline
pipeline_page_qc(input, output, session)
#defines logic for generating full RQC report
pipeline_page_full_qc(input, output, session)
#defines logic for automated pipeline processing (index, alignment, counting)
run_pipeline(input, output, session)
#defines logic for downloading files from pipeline page
pipeline_page_download(input, output, session)
#defines logic for generating counts
counts_page_count(input, output, session)
#defines logic for downloading files from counts page
counts_page_download(input, output, session)
#defines logic for generating qc graphs for mapping page
mapping_page_qc(input, output, session)
#defines logic for generating full RQC report for mapping page
mapping_page_full_qc(input, output, session)
#defines logic for running aligner
mapping_page_run(input, output, session)
#defines logic for downloading mapping page data
mapping_page_download(input, output, session)
}
#' Run the application
shinyApp(ui = ui, server = server)