Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:satijalab/seurat-private into de…
Browse files Browse the repository at this point in the history
…velop
  • Loading branch information
mojaveazure committed Jan 28, 2021
2 parents 05c783b + 55df279 commit 12a93a5
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions R/preprocessing.R
Original file line number Diff line number Diff line change
Expand Up @@ -1880,12 +1880,11 @@ FindVariableFeatures.SCTAssay <- function(
nfeatures = 2000,
...
) {
feature.attr <- SCTResults(object = object, slot = "feature.attributes")
if (length(x = feature.attr) > 1) {
stop("SCT assay is comprised of multiple SCT models. To change the variable features, please set manually with VariableFeatures<-")
} else {
feature.attr <- feature.attr[[1]]
if (length(x = slot(object = object, name = "SCTModel.list")) > 1) {
stop("SCT assay is comprised of multiple SCT models. To change the variable features, please set manually with VariableFeatures<-", call. = FALSE)
}
feature.attr <- SCTResults(object = object, slot = "feature.attributes")
nfeatures <- min(nfeatures, nrow(x = feature.attr))
top.features <- rownames(x = feature.attr)[order(feature.attr$residual_variance, decreasing = TRUE)[1:nfeatures]]
VariableFeatures(object = object) <- top.features
return(object)
Expand Down

0 comments on commit 12a93a5

Please sign in to comment.