Skip to content

Commit

Permalink
set min to avoid NA warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewwbutler committed Jan 28, 2021
1 parent 1e29aff commit ad86a5c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions R/preprocessing.R
Original file line number Diff line number Diff line change
Expand Up @@ -1884,6 +1884,7 @@ FindVariableFeatures.SCTAssay <- function(
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 ad86a5c

Please sign in to comment.