Read various input file formats supported by CytoSPACER.
Usage
read_cytospace_input(file_path, as_sparse = FALSE)
Arguments
- file_path
Path to the input file. Supported formats:
.csv - Comma-separated values
.txt, .tsv - Tab-separated values
.mtx, .mtx.gz - Matrix Market format (sparse)
- as_sparse
Logical. If TRUE, return sparse matrix. Default is FALSE.
Value
A data.frame or dgCMatrix (if sparse) with genes as rows and
cells/spots as columns.
Details
For sparse matrix files (.mtx), the function expects companion files:
Examples
if (FALSE) { # \dontrun{
expr <- read_cytospace_input("scRNA_data.csv")
expr_sparse <- read_cytospace_input("matrix.mtx", as_sparse = TRUE)
} # }