Skip to content

Commit dcb5614

Browse files
authored
Add warning to .from_SCE_convert() (#402)
1 parent acfc1e3 commit dcb5614

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

R/from_SingleCellExperiment.R

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,20 @@ from_SingleCellExperiment <- function(
213213
object
214214
}
215215
} else {
216+
if (!is.data.frame(object) && !is.list(object)) {
217+
cli_warn(c(
218+
paste(
219+
"Converting unknown object of class {.cls {class(object)[1]}} from",
220+
"{.cls SingleCellExperiment}"
221+
),
222+
"!" = "It will be returned as is but this may result in other errors",
223+
"i" = paste(
224+
"This may be solved by converting to a {.cls matrix}/{.cls Matrix},",
225+
"{.cls data.frame}/{.cls DataFrame}, or {.cls list}/{.cls SimpleList}"
226+
)
227+
))
228+
}
229+
216230
object
217231
}
218232
}

0 commit comments

Comments
 (0)