-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Actions taken regarding feedback from Prof. Brian Ripley: * Removed 'ncdFlow', 'flowWorkspaceData', and 'knitr' from Suggests * Created a random data set 'randCyto' and all documentation * Updated examples and testthat to use 'randCyto' data * Updated vignette with clearer language
- Loading branch information
Ian Buller, PhD, MA
committed
Nov 17, 2020
1 parent
12fe622
commit 1056690
Showing
23 changed files
with
298 additions
and
479 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,4 @@ | |
^vignette\.Rmd$ | ||
^dev$ | ||
^CRAN-RELEASE$ | ||
^data-raw$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
Package: gateR | ||
Type: Package | ||
Title: Flow/Mass Cytometry Gating via Spatial Kernel Density Estimation | ||
Version: 0.1.3.9000 | ||
Date: 2020-11-10 | ||
Version: 0.1.3 | ||
Date: 2020-11-16 | ||
Authors@R: | ||
c(person(given = "Ian D.", | ||
family = "Buller", | ||
|
@@ -27,10 +27,10 @@ Authors@R: | |
person(given = "NCI", | ||
role = "cph")) | ||
Maintainer: Ian D. Buller <[email protected]> | ||
Description: Estimates statistically significant fluorescent marker combination values within | ||
Description: Estimates statistically significant marker combination values within | ||
which one immunologically distinctive group (i.e., disease case) is more associated than | ||
another group (i.e., healthy control), successively, using various combinations (i.e., | ||
"gates") of fluorescent markers to examine features of cells that may be different between | ||
"gates") of markers to examine features of cells that may be different between | ||
groups. For a two-group comparison, the 'gateR' package uses the spatial relative risk | ||
function that is estimated using the 'sparr' package. Details about the 'sparr' package | ||
methods can be found in the tutorial: Davies et al. (2018) <doi:10.1002/sim.7577>. Details | ||
|
@@ -56,10 +56,7 @@ Imports: | |
stats, | ||
tibble, | ||
utils | ||
Suggests: | ||
flowWorkspaceData, | ||
knitr, | ||
ncdfFlow, | ||
Suggests: | ||
R.rsp, | ||
spelling, | ||
testthat | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
# gateR (development version) | ||
|
||
# gateR v0.1.3.9000 | ||
|
||
* | ||
# gateR v0.1.3 | ||
* Removed 'ncdFlow', 'flowWorkspaceData', and 'knitr' from Suggests | ||
* Created a random data set 'randCyto' and all documentation | ||
* Updated examples and testthat to use 'randCyto' data | ||
* Updated vignette with clearer language |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#' Subset of the 'extdata' data in the 'flowWorkspaceData' package | ||
#' | ||
#' A sample dataset containing information about flow cytometry data with two binary conditions and four markers. The data are a random subset of the 'extdata' data in the 'flowWorkspaceData' package found on Bioconductor \url{http://bioconductor.org/packages/release/data/experiment/html/flowWorkspaceData.html} and formated for 'gateR' input. The selected markers are arcsinh transformed. | ||
#' | ||
#' @format A data frame with 11763 rows and 7 variables: | ||
#' \describe{ | ||
#' \item{id}{cell ID number} | ||
#' \item{g1}{binary condition #1} | ||
#' \item{g2}{binary condition #2} | ||
#' \item{arcsinh_CD4}{arcsinh-transformed CD4} | ||
#' \item{arcsinh_CD38}{arcsinh-transformed CD38} | ||
#' \item{arcsinh_CD8}{arcsinh-transformed CD8} | ||
#' \item{arcsinh_CD3}{arcsinh-transformed CD3} | ||
#' } | ||
#' @examples | ||
#' head(randCyto) | ||
#' | ||
#' @source \url{https://github.com/Waller-SUSAN/gateR/blob/master/README.md} | ||
"randCyto" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# code to prepare `randCyto` dataset | ||
|
||
set.seed(1234) | ||
|
||
# ------------------ # | ||
# Necessary packages # | ||
# ------------------ # | ||
|
||
library(dplyr) | ||
library(flowWorkspaceData) | ||
library(ncdfFlow) | ||
library(stats) | ||
library(usethis) | ||
|
||
# ---------------- # | ||
# Data preparation # | ||
# ---------------- # | ||
|
||
# Use 'extdata' from the {flowWorkspaceData} package | ||
flowDataPath <- system.file("extdata", package = "flowWorkspaceData") | ||
fcsFiles <- list.files(pattern = "CytoTrol", flowDataPath, full = TRUE) | ||
ncfs <- ncdfFlow::read.ncdfFlowSet(fcsFiles) | ||
fr1 <- ncfs[[1]] | ||
fr2 <- ncfs[[2]] | ||
|
||
## Comparison of two samples (single condition) "g1" | ||
## Two gates (four markers) "CD4", "CD38", "CD8", and "CD3" | ||
## Arcsinh Transformation for all markers | ||
## Remove cells with NA and Inf values | ||
|
||
# First sample | ||
obs_dat1 <- data.frame("id" = seq(1, nrow(fr1@exprs), 1), | ||
"g1" = rep(1, nrow(fr1@exprs)), | ||
"arcsinh_CD4" = asinh(fr1@exprs[ , 5]), | ||
"arcsinh_CD38" = asinh(fr1@exprs[ , 6]), | ||
"arcsinh_CD8" = asinh(fr1@exprs[ , 7]), | ||
"arcsinh_CD3" = asinh(fr1@exprs[ , 8])) | ||
# Second sample | ||
obs_dat2 <- data.frame("id" = seq(1, nrow(fr2@exprs), 1), | ||
"g1" = rep(2, nrow(fr2@exprs)), | ||
"arcsinh_CD4" = asinh(fr2@exprs[ , 5]), | ||
"arcsinh_CD38" = asinh(fr2@exprs[ , 6]), | ||
"arcsinh_CD8" = asinh(fr2@exprs[ , 7]), | ||
"arcsinh_CD3" = asinh(fr2@exprs[ , 8])) | ||
|
||
# Full set | ||
obs_dat <- rbind(obs_dat1, obs_dat2) | ||
obs_dat <- obs_dat[complete.cases(obs_dat), ] # remove NAs | ||
obs_dat <- obs_dat[is.finite(rowSums(obs_dat)), ] # remove Infs | ||
obs_dat$g1 <- as.factor(obs_dat$g1) # set "g1" as binary factor | ||
|
||
## Create a second condition (randomly split the data) | ||
## In practice, use data with a measured second condition | ||
g2 <- stats::rbinom(nrow(obs_dat), 1, 0.5) | ||
obs_dat$g2 <- as.factor(g2) | ||
obs_dat <- obs_dat[ , c(1:2,7,3:6)] | ||
|
||
# Reduce size for CRAN exportation | ||
randCyto <- dplyr::sample_frac(obs_dat, size = 0.1) # saved as `randCyto` data | ||
|
||
# Export | ||
usethis::use_data(randCyto, overwrite = TRUE) |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.