Skip to content

Commit

Permalink
Merge pull request #1 from Nanostring-Biostats/updates-for-release
Browse files Browse the repository at this point in the history
update to point to new repos
  • Loading branch information
rvitancol authored Sep 29, 2020
2 parents aa26fa0 + b856a09 commit d245e1f
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 4 deletions.
3 changes: 1 addition & 2 deletions R/download_profile_matrix.R
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,8 @@ download_profile_matrix <- function(matrixname) {
warning(paste0(matrixname, " is not an expected cell profile matrix name."))
}

# X = as.matrix(utils::read.csv(paste0("https://github.com/Nanostring-Biostats/Extensions/blob/refactor/cell-profile-library/",
X <- as.matrix(utils::read.csv(paste0(
"https://raw.githubusercontent.com/patrickjdanaher/cell-profile-library/master/profile_matrices/",
"https://raw.githubusercontent.com/Nanostring-Biostats/CellProfileLibrary/master/",
matrixname, ".csv"
), row.names = 1))

Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ These include:
## Installation

``` r
devtools::install_github("Nanostring-Biostats/Extensions",
subdir="SpatialDecon", ref = "refactor", build_vignettes = TRUE)
devtools::install_github("Nanostring-Biostats/SpatialDecon",
ref = "master",
build_vignettes = TRUE)
```

## Getting started
Expand Down
82 changes: 82 additions & 0 deletions code for creating SpatialDecon.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
##### this script contains the code used to build the package.
rm(list=ls())

### strategy for shiny-in-a-package deployment: taken from https://www.r-bloggers.com/packaging-shiny-applications-a-deep-dive/
### code written to emulate: https://github.com/MangoTheCat/shinyAppDemo


#### package building code: from https://hilaryparker.com/2014/04/29/writing-an-r-package-from-scratch/


library("devtools")
library(roxygen2)
library(qpdf)
library(BiocCheck)
library("styler")
#library("formatR")
library("lintr")

setwd("SpatialDecon")
#usethis::use_tidy_style(indent_by = 4)
#styler::style_pkg(transformers = styler::tidyverse_style(indent_by = 4))

devtools::document()
devtools::test() # run unit tests
devtools::check()
setwd("..")
BiocCheck("SpatialDecon")
BiocCheckGitClone("SpatialDecon")
setwd("SpatialDecon")
devtools::build()
devtools::build(binary = TRUE)
setwd("..")
install("SpatialDecon")
#setwd("SpatialDecon")
library("SpatialDecon")


#########################################
#### Creating data objects for SpatialDecon ####
#########################################

# create colors:
cellcols = c()
cellcols["CD4.T.cells"] = "red"
cellcols["CD8.T.cells"] = "firebrick"
cellcols["Treg"] = "#FF66FF"

cellcols["T.CD4.naive"] = "#CC0000"
cellcols["T.CD4.memory"] = "#FF0000"
cellcols["T.CD8.naive"] = "#FF6633"
cellcols["T.CD8.memory"] = "#FF9900"

cellcols["NK"] = "grey10"
cellcols["B"] = "darkblue"
cellcols["B.naive"] = "#000099"
cellcols["B.memory"] = "#0000FF"
cellcols["plasma"] = "#3399CC"
cellcols["pDC"] = "#00FFFF"
cellcols["pDCs"] = "#00FFFF"
cellcols["macrophages"] = "#006600"
cellcols["monocytes"] = "#33CC00"
cellcols["monocytes.C"] = "#66CC66"
cellcols["monocytes.NC.I"] = "#33CC00"
cellcols["mDCs"] = "#00FF00"
cellcols["neutrophils"] = "#9966CC"
cellcols["mast"] = "#FFFF00"
cellcols["fibroblasts"] = "#999999"
cellcols["endothelial.cells"] = "#996633"
cellcols["tumor"] = "#333333"

# see how they look:
tempb = rep(1, length(cellcols))
names(tempb) = names(cellcols)
barplot(tempb, las = 2, col = cellcols)



save(cellcols, file = "SpatialDecon/data/cellcols.RData")
# create test dataset:
#source("create test results.R")


0 comments on commit d245e1f

Please sign in to comment.