forked from jminnier/STARTapp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
helpers.R
93 lines (84 loc) · 3.02 KB
/
helpers.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
## ==================================================================================== ##
# START Shiny App for analysis and visualization of transcriptome data.
# Copyright (C) 2016 Jessica Minnier
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# You may contact the author of this code, Jessica Minnier, at <[email protected]>
## ==================================================================================== ##
library(shiny) #devtools::install_github("rstudio/shiny"); devtools::install_github("rstudio/shinyapps")
library(reshape2)
library(ggplot2)
library(ggthemes)
#library(shinyIncubator) #devtools::install_github("rstudio/shinyIncubator")
library(gplots)
#library(rjson)
#library(base64enc)
library(ggvis)
library(dplyr)
library(tidyr)
library(DT) #devtools::install_github('ramnathv/htmlwidgets'); devtools::install_github('rstudio/DT')
library(limma)
#library(DESeq2)
library(edgeR)
library(RColorBrewer)
library(pheatmap)
library(shinyBS)
library(plotly)
library(markdown)
library(NMF)
library(scales)
library(heatmaply)
##================================================================================##
source("fun-dotplot.R")
source("fun-heatmap.r")
source("fun-analyzecounts.R")
source("fun-analysisres.R")
source("fun-groupplots.R")
#troubleshooting
if(FALSE) {
seqdata <- read.csv("data/mousecounts_example.csv",stringsAsFactors = FALSE)
load('data/mousecounts_example_analysis_results.RData')
load('data/mousecounts_example_analyzed.RData') #example_data_results
data_analyzed = list('group_names'=group_names,'sampledata'=sampledata,
"results"=results,"data_long"=data_long, "geneids"=geneids,
"expr_data"=expr_data,"data_results_table"=example_data_results)
data_results = data_analyzed$results
test_sel = "group2/group1"
sel_test = test_sel
fdrcut = 0.05
absFCcut = 1
group_sel = c("group1","group2")
valuename = "log2cpm"
yname="log2cpm"
maxgenes = 200
view_group=NULL
filter_by_go=FALSE
filter_fdr=FALSE
filter_maxgene=TRUE
filter_cpm=FALSE
filter_fc=FALSE
fold_change_range=NULL
fold_change_groups=NULL
group_filter_range =NULL
fixed_genes_list=NULL
orderby="variance"
tmpdat = heatmap_subdat(data_analyzed,yname,orderby="variance",maxgenes=100)
heatmap_render(data_analyzed,yname,orderby="variance",maxgenes=100)
mydat = heatmap_ggvis_data(
data_analyzed = data_analyzed,
yname = yname,
orderby = "variance",
maxgenes=100)
}