Skip to content

Commit

Permalink
packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
effiken committed Jul 26, 2018
1 parent 1e4780c commit 85c9b12
Show file tree
Hide file tree
Showing 24 changed files with 47 additions and 9 deletions.
10 changes: 10 additions & 0 deletions DESCRIPTION
@@ -0,0 +1,10 @@
Package: scDissector
Title: Exploratory Data Analysis tool for single-cell RNA-seq data
Version: 1.00
Authors@R: person("Ephraim", "Kenigsberg", email = "effiken@gmail.com", role = c("aut", "cre"))
Description: What the package does (one paragraph).
Depends: R (>= 3.4.3),ggvis,dplyr,gplots,Matrix,Matrix.utils
License: GPL-3
Encoding: UTF-8
LazyData: true
RoxygenNote: 6.1.0
3 changes: 3 additions & 0 deletions NAMESPACE
@@ -0,0 +1,3 @@
# Generated by roxygen2: do not edit by hand

export(runExample)
9 changes: 9 additions & 0 deletions R/runExample.R
@@ -0,0 +1,9 @@
#' @export
runExample <- function() {
appDir <- system.file("shiny", package = "scDissector")
if (appDir == "") {
stop("Could not find example directory. Try re-installing `scDissector`.", call. = FALSE)
}

shiny::runApp(appDir, display.mode = "normal")
}
Binary file added inst/.DS_Store
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file added inst/shiny/.DS_Store
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
18 changes: 9 additions & 9 deletions server.R → inst/shiny/server.R
Expand Up @@ -12,17 +12,17 @@ set.seed(3505)
non_data_tabs=c("Gating","Basics","Clusters","Truth","QC","Clustering QC","Gene Modules","Samples")

#write.table(file="~/Documents/GitHub/scDissector/viridis_colors.txt",viridis(100),quote=T,row.names=F,col.names=F)
colgrad_abs<<-read.table("~/Documents/GitHub/scDissector/colors_viridis.txt",stringsAsFactors=F)[,1]
colgrad_rel<<-read.table("~/Documents/GitHub/scDissector/colors_brewer_RdBu.txt",stringsAsFactors=F)[,1]
colgrad_abs<<-read.table(system.file("extdata", "colors_viridis.txt", package="scDissector"),stringsAsFactors=F)[,1]
colgrad_rel<<-read.table(system.file("extdata", "colors_brewer_RdBu.txt", package="scDissector"),stringsAsFactors=F)[,1]

colgrad<<-read.table("~/Documents/GitHub/scDissector/colors_paul.txt",stringsAsFactors=F)[,1]
colgrad<<-read.table(system.file("extdata", "colors_paul.txt", package="scDissector"),stringsAsFactors=F)[,1]
#colgrad<<-c(colorRampPalette(c("white",colors()[378],"orange", "tomato","mediumorchid4"))(100))

default_sample_colors<<-rep(paste("#",read.table("sample_colors.txt",stringsAsFactors = F)[,1],sep=""),10)
default_sample_colors<<-rep(paste("#",read.table(system.file("extdata", "sample_colors.txt", package="scDissector"),stringsAsFactors = F)[,1],sep=""),10)


print(getwd())
genesetsfile<<-"gene_sets.txt"
genesetsfile<<-system.file("extdata", "gene_sets.txt", package="scDissector")
if (file.exists(genesetsfile)){
geneList_tmp<-read.table(file=genesetsfile,header=T,stringsAsFactors = F,row.names =1)
geneList<<-geneList_tmp[,1]
Expand Down Expand Up @@ -1151,6 +1151,9 @@ tab3_left_margin=12

})




# output$avg_heatmap_interactive <-renderD3heatmap({
output$avg_heatmap_interactive <-renderPlotly({

Expand All @@ -1177,6 +1180,7 @@ tab3_left_margin=12
if (length(inclusts)==0){
return()
}

zlim=input$inModelColorScale
par(mar=c(7,tab3_left_margin,1,9))
if (input$inModelOrAverage=="Model"){
Expand All @@ -1196,8 +1200,6 @@ tab3_left_margin=12
numis_per_clust_mat=apply(session$userData$dataset$counts[insamples,,inclusts,drop=F],c(1,3),sum,na.rm=T)
numis_per_clust_arr=aperm(array(numis_per_clust_mat,dim=c(length(insamples),length(inclusts),length(gene_match))),c(1,3,2))
# mat=t(t(mat)/numis_per_clust)

numis_per_sample=apply(session$userData$dataset$counts,1,sum)

if (input$inModelOrAverage=="Batch-corrected Average"){
if (!is.null(session$userData$dataset$noise_counts)){
Expand All @@ -1214,9 +1216,7 @@ tab3_left_margin=12
counts=session$userData$dataset$counts[insamples,gene_match,inclusts,drop=F]
}
mat=avg_per_sample_cluster=apply(counts,2:3,sum,na.rm=T)/apply(numis_per_clust_arr,2:3,sum,na.rm=T)
#mat=apply(avg_per_sample_cluster,2:3,mean,na.rm=T)
rownames(mat)=ingenes
#mat<-t(t(mat)/colSums(mat,na.rm=T))
}
isolate({
mat1=mat
Expand Down
File renamed without changes.
File renamed without changes
16 changes: 16 additions & 0 deletions scDissector.Rproj
@@ -0,0 +1,16 @@
Version: 1.0

RestoreWorkspace: No
SaveWorkspace: No
AlwaysSaveHistory: Default

EnableCodeIndexing: Yes
Encoding: UTF-8

AutoAppendNewline: Yes
StripTrailingWhitespace: Yes

BuildType: Package
PackageUseDevtools: Yes
PackageInstallArgs: --no-multiarch --with-keep.source
PackageRoxygenize: rd,collate,namespace

0 comments on commit 85c9b12

Please sign in to comment.