Skip to content

Commit

Permalink
Merge pull request #42 from Sage-Bionetworks/dev
Browse files Browse the repository at this point in the history
merge develop
  • Loading branch information
Kenneth Daily authored Nov 29, 2017
2 parents a02648d + beb2db3 commit c2ce1cb
Show file tree
Hide file tree
Showing 6 changed files with 447 additions and 412 deletions.
75 changes: 0 additions & 75 deletions global.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,78 +24,3 @@ flog.threshold(DEBUG, name='server')
flog.threshold(DEBUG, name='ui')
flog.threshold(DEBUG, name='global')
flog.threshold(INFO, name='synapse')

#login to synapse
synapseLogin()

flog.debug("Starting App", name="server")

#source the heatmap code
source("expression_heatmap.R")

#source generic heatmap functions
source("generic_annotation_functions.R")

#get the global functions
source("global_functions.R")

###############################
## Load precomputed data
###############################

source("loadPrecomputedData.R")

###############################
## Load synapse data
###############################


## This may break!
## Cache the data thats actually used
# save(list=c("combined_metadata", "eset.mRNA", "eset.miRNA", "eset.meth", "meth_to_gene", "miRNA_to_genes", "pathways_list"),
# file="cached_data.RData")
# f <- File("cached_data.RData", parentId="syn4108202")
# o <- synStore(f)

# Use only these metadata columns
metadataColsToUse <- c("Cell_Line_Type", "Reprogramming_Gene_Combination",
"Reprogramming_Vector_Type", "Tissue_of_Origin", "Diffname_short",
"Cell_Type_of_Origin", "Gender", "Originating_Lab_ID",
"Cell_Line_of_Origin", "Donor_ID", "Originating_Lab", "Cell_Type",
"Culture_Conditions")
# metadataColsToUse <- c("Cell_Line_Type")
metadataIdCol <- "UID"

# cacheId <- "syn4108151"
cacheId <- NA
# cacheId <- "local"

if (!is.na(cacheId)) {
## Caching for testing
if (cacheId == "local") {
load("cached_data.RData")
}
else {
o <- synGet(cacheId)
load(getFileLocation(o))
}
flog.debug("Using cached data loaded from Synapse", name="server")
} else {
#get the MSigDB data
source("msigdb_data_prep.R")

#get the mRNA expression data
source("mRNA_data_prep.R")

#get the miRNA expression data
source("miRNA_data_prep.R")

#get the methylation data
source("methylation_data_prep.R")

#prepare single global metadata
combined_metadata <- rbind(mRNA_metadata, miRNA_metadata, meth_metadata, deparse.level = 0)

# Sample column required for expression matrix filtering
combined_metadata$Sample <- rownames(combined_metadata)
}
71 changes: 71 additions & 0 deletions load.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
flog.debug("Starting App", name="server")

#source the heatmap code
source("expression_heatmap.R")

#source generic heatmap functions
source("generic_annotation_functions.R")

#get the global functions
source("global_functions.R")

###############################
## Load precomputed data
###############################

source("loadPrecomputedData.R")

###############################
## Load synapse data
###############################


## This may break!
## Cache the data thats actually used
# save(list=c("combined_metadata", "eset.mRNA", "eset.miRNA", "eset.meth", "meth_to_gene", "miRNA_to_genes", "pathways_list"),
# file="cached_data.RData")
# f <- File("cached_data.RData", parentId="syn4108202")
# o <- synStore(f)

# Use only these metadata columns
metadataColsToUse <- c("Cell_Line_Type", "Reprogramming_Gene_Combination",
"Reprogramming_Vector_Type", "Tissue_of_Origin", "Diffname_short",
"Cell_Type_of_Origin", "Gender", "Originating_Lab_ID",
"Cell_Line_of_Origin", "Donor_ID", "Originating_Lab", "Cell_Type",
"Culture_Conditions")
# metadataColsToUse <- c("Cell_Line_Type")
metadataIdCol <- "UID"

# cacheId <- "syn4108151"
cacheId <- NA
# cacheId <- "local"

if (!is.na(cacheId)) {
## Caching for testing
if (cacheId == "local") {
load("cached_data.RData")
}
else {
o <- synGet(cacheId)
load(getFileLocation(o))
}
flog.debug("Using cached data loaded from Synapse", name="server")
} else {
#get the MSigDB data
source("msigdb_data_prep.R")

#get the mRNA expression data
source("mRNA_data_prep.R")

#get the miRNA expression data
source("miRNA_data_prep.R")

#get the methylation data
source("methylation_data_prep.R")

#prepare single global metadata
combined_metadata <- rbind(mRNA_metadata, miRNA_metadata, meth_metadata, deparse.level = 0)

# Sample column required for expression matrix filtering
combined_metadata$Sample <- rownames(combined_metadata)
}
2 changes: 1 addition & 1 deletion msigdb_data_prep.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#get the MsigDB object
flog.info('Reading the MSIGDB object from synapse...', name='synapse')
MSIGDB_syn<-synGet("syn2227979")
MSIGDB_syn<-synGet("syn11519351")
load(MSIGDB_syn@filePath) #available as MSigDB R object
pathways_list <- c(MSigDB$C2.CP.BIOCARTA, MSigDB$C2.CP.KEGG, MSigDB$C2.CP.REACTOME)
Loading

0 comments on commit c2ce1cb

Please sign in to comment.