Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions R/create.R
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@
#' from \code{\link{createGiottoInstructions}}
#' @param cores how many cores or threads to use to read data if paths are
#' provided
#' @param expression_matrix_class class of expression matrix to
#' use (e.g. 'dgCMatrix', 'DelayedArray')
#' @param expression_matrix_class deprecated. See `?createExprObj` for details
#' @param h5_file path to h5 file
#' @param verbose be verbose when building Giotto object
#' @returns `giotto` object
Expand Down Expand Up @@ -218,7 +217,7 @@
instructions = NULL,
cores = determine_cores(),
raw_exprs = NULL,
expression_matrix_class = c("dgCMatrix", "DelayedArray"),
expression_matrix_class = deprecated(),

Check warning

Code scanning / lintr

no visible global function definition for 'deprecated' Warning

no visible global function definition for 'deprecated'
h5_file = NULL,
verbose = FALSE) {
debug_msg <- FALSE # for reading debug help
Expand All @@ -236,6 +235,13 @@
images <- c(images, largeImages)
}

if (is_present(expression_matrix_class)) {

Check warning

Code scanning / lintr

no visible global function definition for 'is_present' Warning

no visible global function definition for 'is_present'
warning(sprintf(
"[createGiottoObject] param '%s' is deprecated",

Check notice

Code scanning / lintr

Hanging indent should be 24 spaces but is 12 spaces. Note

Hanging indent should be 24 spaces but is 12 spaces.
"expression_matrix_class"),
call. = FALSE)
}

# create minimum giotto
gobject <- giotto(
expression_feat = expression_feat,
Expand Down Expand Up @@ -345,8 +351,7 @@
sparse = TRUE,
cores = cores,
default_feat_type = expression_feat,
verbose = debug_msg,
expression_matrix_class = expression_matrix_class
verbose = debug_msg
)
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ###
## evaluate if h5_file exists
Expand Down
3 changes: 0 additions & 3 deletions R/data_evaluation.R
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,6 @@ evaluate_input <- function(type, x, ...) {
#' @param inputmatrix inputmatrix to evaluate
#' @param sparse create sparse matrix (default = TRUE)
#' @param cores how many cores to use
#' @param expression_matrix_class `character` (optional). Matrix
#' representation to convert to. If left as NULL, no conversions will
#' be attempted
#' @details The inputmatrix can be a matrix, sparse matrix, data.frame,
#' data.table or path to any of these.
#' @keywords internal
Expand Down
41 changes: 18 additions & 23 deletions R/data_input.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
#' @param path path to the expression matrix
#' @param cores number of cores to use
#' @param transpose transpose matrix
#' @param expression_matrix_class class of expression matrix to
#' use (e.g. 'dgCMatrix', 'DelayedArray')
#' @param expression_matrix_class deprecated. See `?createExprObj` for details
#' @inheritParams data_access_params
#' @details The expression matrix needs to have both unique column names and
#' row names
Expand All @@ -28,18 +27,16 @@
cores = determine_cores(),
transpose = FALSE,
feat_type = "rna",
expression_matrix_class = c(
"dgCMatrix",
"DelayedArray",
"dbSparseMatrix"
)) {
expression_matrix_class = deprecated()) {

Check warning

Code scanning / lintr

no visible global function definition for 'deprecated' Warning

no visible global function definition for 'deprecated'
# check if path is a character vector and exists
if (!is.character(path)) stop("path needs to be character vector")
if (!file.exists(path)) stop("the path: ", path, " does not exist")

Check warning

Code scanning / lintr

no visible global function definition for 'is_present' Warning

no visible global function definition for 'is_present'
expression_matrix_class <- match.arg(expression_matrix_class)
if (identical(expression_matrix_class, "dbSparseMatrix")) {
stop("File conversion to dbMatrix is not yet supported")
if (is_present(expression_matrix_class)) {
warning(sprintf(

Check notice

Code scanning / lintr

Hanging indent should be 24 spaces but is 12 spaces. Note

Hanging indent should be 24 spaces but is 12 spaces.
"[readExprMatrix] param '%s' is deprecated",
"expression_matrix_class"),
call. = FALSE)
}

data.table::setDTthreads(threads = cores)
Expand All @@ -61,10 +58,6 @@
spM <- t_flex(spM)
}

if (expression_matrix_class[1] == "DelayedArray") {
spM <- DelayedArray::DelayedArray(spM)
}

return(spM)
}

Expand All @@ -85,8 +78,7 @@
#' @param data_list (nested) list of expression input data
#' @param sparse (boolean, default = TRUE) read matrix data in a sparse manner
#' @param cores number of cores to use
#' @param expression_matrix_class class of expression matrix to
#' use (e.g. 'dgCMatrix', 'DelayedArray')
#' @param expression_matrix_class deprecated. See `?createExprObj` for details
#' @inheritParams read_data_params
#' @returns exprObj
#' @details
Expand All @@ -111,24 +103,29 @@
#' x <- matrix(seq_len(100), nrow = 10)
#' temporal_dir <- tempdir()
#' write.csv(x, paste0(temporal_dir, "/mymatrix.csv"))
#'

Check warning

Code scanning / lintr

no visible global function definition for 'deprecated' Warning

no visible global function definition for 'deprecated'
#' readExprData(paste0(temporal_dir, "/mymatrix.csv"))

Check warning

Code scanning / lintr

no visible global function definition for 'is_present' Warning

no visible global function definition for 'is_present'
#' @export
readExprData <- function(data_list,

Check notice

Code scanning / lintr

Hanging indent should be 24 spaces but is 12 spaces. Note

Hanging indent should be 24 spaces but is 12 spaces.
sparse = TRUE,
cores = determine_cores(),
default_feat_type = NULL,
verbose = TRUE,
provenance = NULL,
expression_matrix_class = c("dgCMatrix", "DelayedArray")) {
expression_matrix_class = deprecated()) {
if (is_present(expression_matrix_class)) {
warning(sprintf(
"[readExprData] param '%s' is deprecated",
"expression_matrix_class"),
call. = FALSE)
}
.read_expression_data(
expr_list = data_list,
sparse = sparse,
cores = cores,
default_feat_type = default_feat_type,
verbose = verbose,
provenance = provenance,
expression_matrix_class = expression_matrix_class
provenance = provenance
)
}

Expand All @@ -141,8 +138,7 @@
default_spat_unit = NULL,
default_feat_type = NULL,
verbose = TRUE,
provenance = NULL,
expression_matrix_class = c("dgCMatrix", "DelayedArray")) {
provenance = NULL) {
# import box characters
ch <- box_chars()

Expand Down Expand Up @@ -335,8 +331,7 @@
} else {
provenance
}, # assumed
misc = NULL,
expression_matrix_class = expression_matrix_class
misc = NULL
)
)
}
Expand Down
5 changes: 2 additions & 3 deletions man/create_giotto.Rd

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

5 changes: 2 additions & 3 deletions man/readExprData.Rd

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

5 changes: 2 additions & 3 deletions man/readExprMatrix.Rd

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

Loading