Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
Package: simDeNet
Type: Package
Title: Simulation study on deconvolution for network estimate
Version: 0.0.2
Date: 2017-02-03
Author: Yun Zhang
Title: Simulation study on deconvolution for co-expression network
Version: 1.0.0
Date: 2019-04-22
Author: Yun Zhang, Jonavelle Cuerdo, Matthew McCall
Maintainer: Yun Zhang <yun_zhang@urmc.rochester.edu>
Description: This package is built for reproducibility of the simulation study.
Depends: R (>= 3.3.0)
Imports: mvtnorm, preprocessCore, ISOpureR, ROCR, WGCNA, minet, bnlearn
Depends: R (>= 3.5.0)
Imports: methods, mvtnorm, preprocessCore, ISOpureR, ROCR, shiny
VignetteBuilder: knitr
Suggests: knitr, rmarkdown
Suggests: knitr, rmarkdown, shinydashboard, DT, GeneNet, abind
License: GPL-3
10 changes: 5 additions & 5 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ importFrom(ISOpureR, ISOpure.step1.CPE, ISOpure.step2.PPE)
importFrom(ROCR, prediction, performance, plot)
importClassesFrom(ROCR, performance, prediction)
importMethodsFrom(ROCR, plot)
importFrom(WGCNA, adjacency)
importFrom(minet, minet)
importFrom(bnlearn, hc, bn.fit)
importFrom("graphics", "legend")
importFrom("methods", "slot", "slot<-")
importFrom("stats", "runif")
importFrom("shiny", "runApp")


export(oneStepSim, generate.Sigma, sim.expr, deconv, eval.ROC, netEstByMethod)
export(oneStepSim, generate.Sigma, sim.expr, deconv, eval.ROC, runShiny)
13 changes: 10 additions & 3 deletions R/eval.ROC.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
##############


eval.ROC <- function(est.str, true.str, plot.ROC=TRUE, show.AUC=TRUE, zoom=TRUE, ...){
eval.ROC <- function(est.str, true.str, plot.ROC=TRUE, show.AUC=TRUE, zoom=FALSE, lightPDF=FALSE, ...){
# if(sum(dim(est.str)!=dim(est.str))>0){stop("Error: est.str and true.str must have the same dimemsion.")}
# if(!isSymmetric(unname(est.str))|!isSymmetric(unname(true.str))){stop("Error: est.str and true.str must be symmetric.")}

Expand All @@ -23,8 +23,15 @@ eval.ROC <- function(est.str, true.str, plot.ROC=TRUE, show.AUC=TRUE, zoom=TRUE,

## plot
if(plot.ROC){
if(zoom){plot(perf, xlim=c(0,xval), ylim=c(0,yval), ...)}
else plot(perf)
perf.plot <- perf
if(lightPDF){
set.seed = 123
sparsePoints <- c(1, sort(sample(2:(n.unique-1), 10000)), n.unique)
slot(perf.plot,"x.values")[[1]] <- slot(perf.plot,"x.values")[[1]][sparsePoints]
slot(perf.plot,"y.values")[[1]] <- slot(perf.plot,"y.values")[[1]][sparsePoints]
}
if(zoom){plot(perf.plot, xlim=c(0,xval), ylim=c(0,yval), ...)}
else plot(perf.plot, ...)
if(show.AUC){legend("bottom",paste0("AUC=",round(auc.value,3)),bty = "n")}
}

Expand Down
66 changes: 0 additions & 66 deletions R/netEstByMethod.R

This file was deleted.

3 changes: 2 additions & 1 deletion R/oneStepSim.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ oneStepSim <- function(n.samp, mu.T, mu.N, Sigma.T=NULL, Sigma.N=NULL, prop.T="s

return(list("m.gene"=m.gene, "Sigma.T"=Sigma.T, "Sigma.N"=Sigma.N, "true.str.T"=true.str.T,
"expr.pure.T"=out.expr$expr.pure.T, "expr.pure.N"=out.expr$expr.pure.N,
"expr.mixed"=out.expr$expr.mixed, "true.prop"=prop.T))
"expr.mixed"=out.expr$expr.mixed, "true.prop"=out.expr$true.prop))
}


Expand Down Expand Up @@ -95,6 +95,7 @@ generate.Sigma <- function(m.gene, block.size, rho, dd=NULL, str.type="interchan
if(sum(block.size)>m.gene){stop("Error: sum of block.size must be smaller than m.gene.")}
if(length(rho)!=length(block.size)){stop("Error: rho and block.size must be have the same length.")}
if(!is.null(dd)&length(dd)!=m.gene){stop("Error: dd must have length equal to m.gene.")}
if(length(str.type)!=length(block.size)&length(str.type)!=1){stop("Error: either specify one str.type for all the blocks or specify different str.type for each block.")}

## weight matrix
if(is.null(dd)){dd <- rep(1,m.gene)}
Expand Down
8 changes: 8 additions & 0 deletions R/runShiny.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
runShiny <- function() {
appDir <- system.file("shinyapp", package = "simDeNet")
if (appDir == "") {
stop("Could not find example directory. Try re-installing `simDeNet`.", call. = FALSE)
}

shiny::runApp(appDir, display.mode = "normal")
}
26 changes: 25 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,25 @@
# simDeNet-R-Package
# Interactive exploration of the effect of tissue composition on gene co-expression

## Getting Started

Install package:
```R
install.packages("devtools")
devtools::install_github("yunzhang813/simDeNet-R-Package-Shiny")
```

Launch Shiny application for interactive exploration using pre-uploaded pure cell type data:
```R
library(simDeNet)
runShiny()
```
![](vignettes/Shiny-steps.png)


Browse vignette for other useful functions included in the pakcage:
```R
browseVignettes("simDeNet")
```

## Citation
Yun Zhang, Jonavelle Cuerdo, Marc K Halushka, Matthew N McCall, 2019. The effect of tissue composition on gene co-expression, *Briefings in Bioinformatics*, bbz135, https://doi.org/10.1093/bib/bbz135
Empty file modified data/celltype.rda
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion data/datalist
Original file line number Diff line number Diff line change
@@ -1 +1 @@
celltype
celltype
Loading