Skip to content

Commit

Permalink
Merge branch 'develop' into feat/ObjectUpdates
Browse files Browse the repository at this point in the history
  • Loading branch information
mojaveazure committed Sep 17, 2019
2 parents 46c7ffd + 4e46502 commit 0f309a7
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 11 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: Seurat
Version: 3.1.0.9010
Version: 3.1.0.9012
Date: 2019-09-17
Title: Tools for Single Cell Genomics
Description: A toolkit for quality control, analysis, and exploration of single cell RNA sequencing data. 'Seurat' aims to enable users to identify and interpret sources of heterogeneity from single cell transcriptomic measurements, and to integrate diverse types of single cell data. See Satija R, Farrell J, Gennert D, et al (2015) <doi:10.1038/nbt.3192>, Macosko E, Basu A, Satija R, et al (2015) <doi:10.1016/j.cell.2015.05.002>, and Butler A and Satija R (2017) <doi:10.1101/164889> for more details.
Expand Down
10 changes: 9 additions & 1 deletion R/dimensional_reduction.R
Original file line number Diff line number Diff line change
Expand Up @@ -1152,6 +1152,7 @@ RunUMAP.default <- function(
negative.sample.rate = 5,
a = NULL,
b = NULL,
uwot.sgd = FALSE,
seed.use = 42,
metric.kwds = NULL,
angular.rp.forest = FALSE,
Expand All @@ -1162,7 +1163,6 @@ RunUMAP.default <- function(
CheckDots(...)
if (!is.null(x = seed.use)) {
set.seed(seed = seed.use)
py_set_seed(seed = seed.use)
}
if (umap.method != 'umap-learn' && getOption('Seurat.warn.umap.uwot', TRUE)) {
warning(
Expand All @@ -1180,6 +1180,9 @@ RunUMAP.default <- function(
if (!py_module_available(module = 'umap')) {
stop("Cannot find UMAP, please install through pip (e.g. pip install umap-learn).")
}
if (!is.null(x = seed.use)) {
py_set_seed(seed = seed.use)
}
if (typeof(x = n.epochs) == "double") {
n.epochs <- as.integer(x = n.epochs)
}
Expand Down Expand Up @@ -1229,6 +1232,7 @@ RunUMAP.default <- function(
negative_sample_rate = negative.sample.rate,
a = a,
b = b,
fast_sgd = uwot.sgd,
verbose = verbose
)
},
Expand Down Expand Up @@ -1268,6 +1272,7 @@ RunUMAP.Graph <- function(
negative.sample.rate = 5L,
a = NULL,
b = NULL,
uwot.sgd = FALSE,
seed.use = 42L,
metric.kwds = NULL,
verbose = TRUE,
Expand Down Expand Up @@ -1383,6 +1388,7 @@ RunUMAP.Graph <- function(
#' @param b More specific parameters controlling the embedding. If NULL, these values are set
#' automatically as determined by min. dist and spread. Parameter of differentiable approximation of
#' right adjoint functor.
#' @param uwot.sgd Set \code{uwot::umap(fast_sgd = TRUE)}; see \code{\link[uwot]{umap}} for more details
#' @param metric.kwds A dictionary of arguments to pass on to the metric, such as the p value for
#' Minkowski distance. If NULL then no arguments are passed on.
#' @param angular.rp.forest Whether to use an angular random projection forest to initialise the
Expand Down Expand Up @@ -1421,6 +1427,7 @@ RunUMAP.Seurat <- function(
negative.sample.rate = 5L,
a = NULL,
b = NULL,
uwot.sgd = FALSE,
seed.use = 42L,
metric.kwds = NULL,
angular.rp.forest = FALSE,
Expand Down Expand Up @@ -1460,6 +1467,7 @@ RunUMAP.Seurat <- function(
negative.sample.rate = negative.sample.rate,
a = a,
b = b,
uwot.sgd = uwot.sgd,
seed.use = seed.use,
metric.kwds = metric.kwds,
angular.rp.forest = angular.rp.forest,
Expand Down
8 changes: 5 additions & 3 deletions R/preprocessing.R
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ GetResidual <- function(
x = new_features,
y = vst_set_genes
)
if (diff_features !=0){
if (length(x = diff_features) !=0) {
warning(
"The following ", length(x = diff_features),
" features do not exist in all SCT models: ",
Expand Down Expand Up @@ -535,9 +535,11 @@ GetResidual <- function(
object = object,
assay = assay,
slot = "scale.data",
new.data = new.scale.data
new.data = rbind(
GetAssayData(object = object, slot = 'scale.data', assay = assay),
new.scale.data
)
)

}
}
}
Expand Down
16 changes: 10 additions & 6 deletions man/RunUMAP.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0f309a7

Please sign in to comment.