Skip to content

Commit 9d77c15

Browse files
authored
Remove suppressWarnings() in as_Seurat() (#312)
1 parent 2e7fee8 commit 9d77c15

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

R/as_Seurat.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ to_Seurat <- function(...) {
492492
}
493493

494494
if (!grepl(SeuratObject::.KeyPattern(), key)) {
495-
new_key <- suppressWarnings(Seurat::Key(key))
495+
new_key <- SeuratObject::Key(key, quiet = TRUE)
496496
cli_warn(paste(
497497
"Key {.val {key}} does not match the expected pattern,",
498498
"it has been replaced with {.val {new_key}}"
@@ -534,7 +534,7 @@ to_Seurat <- function(...) {
534534
if (is.atomic(reduction_mapping)) {
535535
reduction_mapping <- purrr::map(reduction_mapping, function(.obsm) {
536536
c(
537-
key = suppressWarnings(SeuratObject::Key(.obsm)),
537+
key = SeuratObject::Key(.obsm, quiet = TRUE),
538538
embeddings = .obsm
539539
)
540540
})
@@ -617,7 +617,7 @@ to_Seurat <- function(...) {
617617

618618
mapping <- c(
619619
# Make sure we have valid keys here to avoid warnings later
620-
key = suppressWarnings(SeuratObject::Key(.obsm)),
620+
key = SeuratObject::Key(.obsm, quiet = TRUE),
621621
embeddings = .obsm
622622
)
623623
if (.obsm == "X_pca" && "PCs" %in% names(adata$varm)) {

0 commit comments

Comments
 (0)