Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
#date 15 Sep.2018 
Update the control panels, enrichment analysis, data tables display.
Add the "About" section.
Detailed user manual for CMTCN is ready!
Example data has been updated!
  • Loading branch information
rilletlee authored Sep 18, 2018
1 parent e67ab5b commit 821330f
Show file tree
Hide file tree
Showing 42 changed files with 1,237 additions and 394 deletions.
Binary file added Database/Clin_Stage.db
Binary file not shown.
Binary file modified Database/CoMotif.db
Binary file not shown.
Binary file modified Database/Enrichment.db
Binary file not shown.
Binary file modified Database/GTM.db
Binary file not shown.
Binary file modified Database/TopMutated.db
Binary file not shown.
Binary file modified Database/miREnrichment.db
Binary file not shown.
196 changes: 154 additions & 42 deletions Functions/01PickCo-Data.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#' CFFL_Data <- Pick_CFFL(Disease,Rcut=0.2)
#' ************************************************************

Pick_SP <- function(Disease,Pcut=0.05,Rcut=NULL){
Pick_SP <- function(Disease,Pcut=0.05,Rcut=NULL,TFReg=c("Pos","Neg","Bot")){
sqlite <- dbDriver("SQLite")
con <- dbConnect(sqlite,"./Database/CoMotif.db")
TableName <- paste0(Disease,"CMotif")
Expand All @@ -29,17 +29,37 @@ Pick_SP <- function(Disease,Pcut=0.05,Rcut=NULL){
SP_Data <- SP_Data[which(SP_Data$P_TG<=Pcut&
SP_Data$P_MG<=Pcut),]
}else{
SP_Data <- SP_Data[which(SP_Data$P_TG<=Pcut&
SP_Data$P_MG<=Pcut&
abs(SP_Data$R_TG)>=Rcut&
abs(SP_Data$R_MG)>=Rcut&
SP_Data$R_MG < 0
),]
if(TFReg==c("Bot")){
SP_Data <- SP_Data[which(SP_Data$P_TG<=Pcut&
SP_Data$P_MG<=Pcut&
abs(SP_Data$R_TG)>=Rcut&
abs(SP_Data$R_MG)>=Rcut&
SP_Data$R_MG < 0
),]
}
if(TFReg==c("Pos")){
SP_Data <- SP_Data[which(SP_Data$P_TG<=Pcut&
SP_Data$P_MG<=Pcut&
abs(SP_Data$R_TG)>=Rcut&
abs(SP_Data$R_MG)>=Rcut&
SP_Data$R_MG < 0&
SP_Data$R_TG > 0
),]
}
if(TFReg==c("Neg")){
SP_Data <- SP_Data[which(SP_Data$P_TG<=Pcut&
SP_Data$P_MG<=Pcut&
abs(SP_Data$R_TG)>=Rcut&
abs(SP_Data$R_MG)>=Rcut&
SP_Data$R_MG < 0&
SP_Data$R_TG < 0
),]
}
}
return(SP_Data)
}

Pick_TFFL <- function(Disease,Pcut=0.05,Rcut=NULL){
Pick_TFFL <- function(Disease,Pcut=0.05,Rcut=NULL,TFReg=c("Pos","Neg","Bot")){
sqlite <- dbDriver("SQLite")
con <- dbConnect(sqlite,"./Database/CoMotif.db")
TableName <- paste0(Disease,"CMotif")
Expand All @@ -59,19 +79,45 @@ Pick_TFFL <- function(Disease,Pcut=0.05,Rcut=NULL){
TFFL_Data$P_TM<=Pcut&
TFFL_Data$P_MG<=Pcut),]
}else{
TFFL_Data <- TFFL_Data[which(TFFL_Data$P_TG<=Pcut&
TFFL_Data$P_TM<=Pcut&
TFFL_Data$P_MG<=Pcut&
abs(TFFL_Data$R_TG)>=Rcut&
abs(TFFL_Data$R_TM)>=Rcut&
abs(TFFL_Data$R_MG)>=Rcut&
TFFL_Data$R_MG < 0
),]
if(TFReg==c("Bot")){
TFFL_Data <- TFFL_Data[which(TFFL_Data$P_TG<=Pcut&
TFFL_Data$P_TM<=Pcut&
TFFL_Data$P_MG<=Pcut&
abs(TFFL_Data$R_TG)>=Rcut&
abs(TFFL_Data$R_TM)>=Rcut&
abs(TFFL_Data$R_MG)>=Rcut&
TFFL_Data$R_MG < 0
),]
}
if(TFReg==c("Pos")){
TFFL_Data <- TFFL_Data[which(TFFL_Data$P_TG<=Pcut&
TFFL_Data$P_TM<=Pcut&
TFFL_Data$P_MG<=Pcut&
abs(TFFL_Data$R_TG)>=Rcut&
abs(TFFL_Data$R_TM)>=Rcut&
abs(TFFL_Data$R_MG)>=Rcut&
TFFL_Data$R_MG < 0&
TFFL_Data$R_TG > 0&
TFFL_Data$R_TM > 0
),]
}
if(TFReg==c("Neg")){
TFFL_Data <- TFFL_Data[which(TFFL_Data$P_TG<=Pcut&
TFFL_Data$P_TM<=Pcut&
TFFL_Data$P_MG<=Pcut&
abs(TFFL_Data$R_TG)>=Rcut&
abs(TFFL_Data$R_TM)>=Rcut&
abs(TFFL_Data$R_MG)>=Rcut&
TFFL_Data$R_MG < 0&
TFFL_Data$R_TG < 0&
TFFL_Data$R_TM < 0
),]
}
}
return(TFFL_Data)
}

Pick_MFFL <- function(Disease,Pcut=0.05,Rcut=NULL){
Pick_MFFL <- function(Disease,Pcut=0.05,Rcut=NULL,TFReg=c("Pos","Neg","Bot")){
sqlite <- dbDriver("SQLite")
con <- dbConnect(sqlite,"./Database/CoMotif.db")
TableName <- paste0(Disease,"CMotif")
Expand All @@ -91,19 +137,46 @@ Pick_MFFL <- function(Disease,Pcut=0.05,Rcut=NULL){
MFFL_Data$P_TM<=Pcut&
MFFL_Data$P_MG<=Pcut),]
}else{
MFFL_Data <- MFFL_Data[which(MFFL_Data$P_TG<=Pcut&
MFFL_Data$P_TM<=Pcut&
MFFL_Data$P_MG<=Pcut&
abs(MFFL_Data$R_TG)>=Rcut&
abs(MFFL_Data$R_TM)>=Rcut&
abs(MFFL_Data$R_MG)>=Rcut&
MFFL_Data$R_MG < 0
),]
if(TFReg==c("Bot")){
MFFL_Data <- MFFL_Data[which(MFFL_Data$P_TG<=Pcut&
MFFL_Data$P_TM<=Pcut&
MFFL_Data$P_MG<=Pcut&
abs(MFFL_Data$R_TG)>=Rcut&
abs(MFFL_Data$R_TM)>=Rcut&
abs(MFFL_Data$R_MG)>=Rcut&
MFFL_Data$R_MG < 0&
MFFL_Data$R_TM < 0
),]
}
if(TFReg==c("Pos")){
MFFL_Data <- MFFL_Data[which(MFFL_Data$P_TG<=Pcut&
MFFL_Data$P_TM<=Pcut&
MFFL_Data$P_MG<=Pcut&
abs(MFFL_Data$R_TG)>=Rcut&
abs(MFFL_Data$R_TM)>=Rcut&
abs(MFFL_Data$R_MG)>=Rcut&
MFFL_Data$R_MG < 0 &
MFFL_Data$R_TM < 0 &
MFFL_Data$R_TG > 0
),]
}
if(TFReg==c("Neg")){
MFFL_Data <- MFFL_Data[which(MFFL_Data$P_TG<=Pcut&
MFFL_Data$P_TM<=Pcut&
MFFL_Data$P_MG<=Pcut&
abs(MFFL_Data$R_TG)>=Rcut&
abs(MFFL_Data$R_TM)>=Rcut&
abs(MFFL_Data$R_MG)>=Rcut&
MFFL_Data$R_MG < 0 &
MFFL_Data$R_TM < 0 &
MFFL_Data$R_TG < 0
),]
}
}
return(MFFL_Data)
}

Pick_CFFL <- function(Disease,Pcut=0.05,Rcut=NULL){
Pick_CFFL <- function(Disease,Pcut=0.05,Rcut=NULL,TFReg=c("Pos","Neg","Bot")){
sqlite <- dbDriver("SQLite")
con <- dbConnect(sqlite,"./Database/CoMotif.db")
TableName <- paste0(Disease,"CMotif")
Expand All @@ -123,14 +196,38 @@ Pick_CFFL <- function(Disease,Pcut=0.05,Rcut=NULL){
CFFL_Data$P_TM<=Pcut&
CFFL_Data$P_MG<=Pcut),]
}else{
CFFL_Data <- CFFL_Data[which(CFFL_Data$P_TG<=Pcut&
CFFL_Data$P_TM<=Pcut&
CFFL_Data$P_MG<=Pcut&
abs(CFFL_Data$R_TG)>=Rcut&
abs(CFFL_Data$R_TM)>=Rcut&
abs(CFFL_Data$R_MG)>=Rcut&
CFFL_Data$R_MG < 0
),]
if(TFReg==c("Bot")){
CFFL_Data <- CFFL_Data[which(CFFL_Data$P_TG<=Pcut&
CFFL_Data$P_TM<=Pcut&
CFFL_Data$P_MG<=Pcut&
abs(CFFL_Data$R_TG)>=Rcut&
abs(CFFL_Data$R_TM)>=Rcut&
abs(CFFL_Data$R_MG)>=Rcut&
CFFL_Data$R_MG < 0
),]
}
if(TFReg==c("Pos")){
CFFL_Data <- CFFL_Data[which(CFFL_Data$P_TG<=Pcut&
CFFL_Data$P_TM<=Pcut&
CFFL_Data$P_MG<=Pcut&
abs(CFFL_Data$R_TG)>=Rcut&
abs(CFFL_Data$R_TM)>=Rcut&
abs(CFFL_Data$R_MG)>=Rcut&
CFFL_Data$R_MG < 0&
CFFL_Data$R_TG > 0
),]
}
if(TFReg==c("Neg")){
CFFL_Data <- CFFL_Data[which(CFFL_Data$P_TG<=Pcut&
CFFL_Data$P_TM<=Pcut&
CFFL_Data$P_MG<=Pcut&
abs(CFFL_Data$R_TG)>=Rcut&
abs(CFFL_Data$R_TM)>=Rcut&
abs(CFFL_Data$R_MG)>=Rcut&
CFFL_Data$R_MG < 0&
CFFL_Data$R_TG < 0
),]
}
}
return(CFFL_Data)
}
Expand Down Expand Up @@ -317,6 +414,8 @@ RegMatch_CFFL <- function(TripleData,TG_RSource,TM_RSource,MG_RSource,MT_RSource
#'**************************************************
#'@description parse the co-regulatory data
#'display the related regulatory database
#'@date Sep 10: display the related regulatory database
#'one for TF, one for miRNA
#' @example
#' Disease <- c("BRCA")
#' SP_Data <- Pick_SP(Disease,Rcut=0.1)
Expand All @@ -325,16 +424,29 @@ RegMatch_CFFL <- function(TripleData,TG_RSource,TM_RSource,MG_RSource,MT_RSource
#'
coRegKnowledge <- function(TripleData){
if(nrow(TripleData)==0){return(NULL)}
Knowledgebases <- c()
Knowledgebases <- apply(TripleData[,c("TG_Source","TM_Source","MG_Source","MT_Source")],
MARGIN = 1,
FUN = function(x){
paste0(x,collapse = "/")
})
Knowledgebases_TF <- c()
Knowledgebases_miRNA <- c()
# Knowledgebases <- apply(TripleData[,c("TG_Source","TM_Source","MG_Source","MT_Source")],
# MARGIN = 1,
# FUN = function(x){
# paste0(x,collapse = "/")
# })
Knowledgebases_TF <- apply(TripleData[,c("TG_Source","TM_Source")],
MARGIN = 1,
FUN = function(x){
paste0(x,collapse = "/")
})
Knowledgebases_miRNA <- apply(TripleData[,c("MG_Source","MT_Source")],
MARGIN = 1,
FUN = function(x){
paste0(x,collapse = "/")
})
# print(class(Knowledgebases))
anno <- sapply(Knowledgebases,FUN = function(x){revise_Rep(x)})
anno_TF <- sapply(Knowledgebases_TF,FUN = function(x){revise_Rep(x)})
anno_miRNA <- sapply(Knowledgebases_miRNA,FUN = function(x){revise_Rep(x)})
# print(class(anno))
TripleData$Knowledgebases <- anno
TripleData$Knowledgebases_TF <- anno_TF
TripleData$Knowledgebases_miRNA <- anno_miRNA
return(TripleData)
}

Expand Down
3 changes: 2 additions & 1 deletion Functions/05Topology.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,5 @@ net_NodeCount <- function(net){
net_Density <- function(net){
ed <- edge_density(net)
return(ed)
}
}

Binary file modified Instructions/1-Step1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Instructions/1-Step2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Instructions/1-Step3-Cli.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Instructions/1-Step3-Mut.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Instructions/2-Netinfo_Download1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Instructions/2-Netinfo_Download2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Instructions/3-Co-Interactions1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Instructions/3-Co-Interactions2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Instructions/3-Refine1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Instructions/3-Refine2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Instructions/3-Refine3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 30 additions & 0 deletions Instructions/about.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
title: "CMTCN_About"
author: "Rillet Lee"
date: "Aug 31, 2018"
output: html_document
---

CMTCN was built using
<a href="http://shiny.rstudio.com/", target="_blank"> Shiny </a> by
<a href="https://www.rstudio.com/", target="_blank"> RStudio, </a> using open source software.<br><br>
We sincerely acknowledge all publicly available resources which have been used in CMTCN!

The following R packages are utilized in no particular order of importance:<br>
[shiny](http://shiny.rstudio.com/)(>=0.14.2)<br>
[shinyjs](https://github.com/daattali/shinyjs)(>=0.8)<br>
[shinydashboard](http://rstudio.github.io/shinydashboard/)(>=0.7.0)<br>
[shinythemes](http://shiny.rstudio.com/articles/themes.html)(>=1.1.1)<br>
[data.table](http://cran.r-project.org/web/packages/data.table/)(>=1.10.4-3)<br>
[DT](http://cran.r-project.org/package=DT)(>=0.4)<br>
[RSQLite](http://cran.r-project.org/web/packages/RSQLite/index.html)(>=2.1.0)<br>
[DBI](https://cran.r-project.org/web/packages/DBI/)(>=0.8)<br>
[ggplot2](http://cran.r-project.org/web/packages/ggplot2/index.html)(>=2.2.1)<br>
[ggthemes](http://cran.r-project.org/web/packages/ggthemes/index.html )(>=3.4.2)<br>
[networkD3](http://cran.r-project.org/package=networkD3)(>=0.4)<br>
[dplyr](http://cran.r-project.org/package=dplyr)(>=0.7.4)<br>
[markdown](https://rmarkdown.rstudio.com/)(>=0.8)<br>
[shinycssloaders](https://github.com/andrewsali/shinycssloaders)(>=0.2.0)<br>
[clusterProfiler](http://www.bioconductor.org/packages/release/bioc/html/clusterProfiler.html)(>=3.8.0)<br>
[GSEABase](http://www.bioconductor.org/packages/release/bioc/html/GSEABase.html)(>=1.42.0)<br>
[igraph](http://cran.r-project.org/web/packages/igraph/index.html )(>=1.2.1)<br><br>
Loading

0 comments on commit 821330f

Please sign in to comment.