-
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.
Merge pull request #97 from jr-leary7/dev
Dev
- Loading branch information
Showing
40 changed files
with
1,301 additions
and
829 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 |
---|---|---|
|
@@ -2,5 +2,6 @@ | |
.Rhistory | ||
.RData | ||
.Ruserdata | ||
.Rbuildignore | ||
inst/doc | ||
codecov.yml |
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,62 +1,77 @@ | ||
Package: scLANE | ||
Type: Package | ||
Title: Model gene expression over pseudotime with spline-based NB GLMs, GEEs, & GLMMs | ||
Version: 0.6.2 | ||
Title: Model gene expression dynamics with spline-based NB GLMs, GEEs, & GLMMs | ||
Version: 0.7.0 | ||
Authors@R: c(person(given = "Jack", family = "Leary", email = "[email protected]", role = c("aut", "cre")), | ||
person(given = "Rhonda", family = "Bacher", email = "[email protected]", role = c("ctb", "fnd"))) | ||
Description: This package uses truncated power basis spline models to build flexible, interpretable models of single cell gene expression over pseudotime / latent time. Currently supports negative binomial GLMs, GEEs, & GLMMs. | ||
Description: This package uses truncated power basis spline models to build flexible, interpretable models of single cell gene expression over pseudotime or latent time. | ||
The modeling architectures currently supported are negative binomial GLMs, GEEs, & GLMMs. | ||
Downstream analysis functionalities include model comparison, dynamic gene clustering, smoothed counts generation, gene set enrichment testing, & visualization. | ||
License: MIT + file LICENSE | ||
Encoding: UTF-8 | ||
LazyData: true | ||
RoxygenNote: 7.2.1 | ||
Depends: | ||
magrittr, | ||
glm2 | ||
glm2, | ||
magrittr | ||
Imports: | ||
dplyr, | ||
foreach, | ||
doParallel, | ||
parallel, | ||
geeM, | ||
MASS, | ||
ggplot2, | ||
dplyr, | ||
stats, | ||
gamlss, | ||
scales, | ||
splines, | ||
bigstatsr, | ||
broom, | ||
utils, | ||
withr, | ||
purrr, | ||
tidyr, | ||
geeM, | ||
glmmTMB, | ||
broom.mixed, | ||
tidyselect, | ||
furrr, | ||
gamlss, | ||
scales, | ||
future, | ||
ggplot2, | ||
splines, | ||
foreach, | ||
glmmTMB, | ||
parallel, | ||
bigstatsr, | ||
RcppEigen, | ||
doParallel, | ||
tidyselect, | ||
broom.mixed, | ||
Rcpp (>= 1.0.7) | ||
URL: https://github.com/jr-leary7/scLANE | ||
BugReports: https://github.com/jr-leary7/scLANE/issues | ||
Suggests: | ||
rmarkdown, | ||
knitr, | ||
testthat (>= 3.0.0), | ||
covr, | ||
ggh4x, | ||
knitr, | ||
irlba, | ||
rlang, | ||
igraph, | ||
Seurat, | ||
bluster, | ||
cluster, | ||
clusterProfiler, | ||
igraph, | ||
irlba, | ||
slingshot, | ||
msigdbr, | ||
rmarkdown, | ||
slingshot, | ||
BiocGenerics, | ||
BiocNeighbors, | ||
rlang, | ||
Seurat, | ||
clusterProfiler, | ||
testthat (>= 3.0.0), | ||
SingleCellExperiment, | ||
SummarizedExperiment, | ||
BiocGenerics | ||
SummarizedExperiment | ||
VignetteBuilder: knitr | ||
Config/testthat/edition: 3 | ||
LinkingTo: | ||
RcppEigen, | ||
Rcpp | ||
Rcpp, | ||
RcppEigen | ||
biocViews: | ||
RNASeq, | ||
Software, | ||
TimeCourse, | ||
Sequencing, | ||
Regression, | ||
SingleCell, | ||
Visualization, | ||
GeneExpression, | ||
Transcriptomics, | ||
DifferentialExpression |
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,3 @@ | ||
# scLANE 0.6.3 | ||
|
||
* Added a `NEWS.md` file to track changes to the package. |
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,36 @@ | ||
#' Create an offset vector before modeling | ||
#' | ||
#' @name createCellOffset | ||
#' @author Jack Leary | ||
#' @description Creates a vector of per-cell size factors to be used as input to \code{\link{testDynamic}} as a model offset given a variety of inputs. | ||
#' @param expr.mat Either a gene-by-cell (cells as columns) matrix of raw integer counts prior to any cell filtering, a \code{Seurat} object, or a \code{SingleCellExperiment} object. Defaults to NULL. | ||
#' @param scale.factor The scaling factor use to multiply the sequencing depth factor for each cell. The default value is 1e4, which returns counts-per-10k. | ||
#' @return A named numeric vector containing the computed size factor for each cell. | ||
#' @seealso \code{\link{testDynamic}} | ||
#' @seealso \code{\link{marge2}} | ||
#' @seealso \code{\link[Seurat]{LogNormalize}} | ||
#' @seealso \code{\link[scuttle]{computeLibraryFactors}} | ||
#' @export | ||
#' @examples | ||
#' \dontrun{ | ||
#' createCellOffset(expr.mat = raw_counts) | ||
#' createCellOffset(expr.mat = raw_counts, scale.factor = 1e5) | ||
#' } | ||
|
||
createCellOffset <- function(expr.mat = NULL, scale.factor = 1e4) { | ||
# check inputs | ||
if (is.null(expr.mat)) { stop("Please provide expr.mat to createCellOffset().") } | ||
if (inherits(expr.mat, "SingleCellExperiment")) { | ||
expr.mat <- as.matrix(BiocGenerics::counts(expr.mat)) | ||
} else if (inherits(expr.mat, "Seurat")) { | ||
expr.mat <- as.matrix(Seurat::GetAssayData(expr.mat, | ||
slot = "counts", | ||
assay = Seurat::DefaultAssay(expr.mat))) | ||
} | ||
# compute per-cell size factors | ||
cell_names <- colnames(expr.mat) | ||
seq_depths <- colSums(expr.mat) | ||
lib_size_factors <- scale.factor / seq_depths | ||
names(lib_size_factors) <- cell_names | ||
return(lib_size_factors) | ||
} |
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
Oops, something went wrong.