merge_two_expfiles Used to combine two single cell type datasets.

merge_two_expfiles(
  exp1,
  exp2,
  annot1,
  annot2,
  name1 = "",
  name2 = "",
  as_sparse = TRUE,
  as_DelayedArray = FALSE,
  verbose = TRUE
)

Arguments

exp1

Numerical expression matrix for dataset1 with row for each gene and column for each cell. Row names are gene symbols. Column names are cell IDs which can be cross referenced against the annot data frame.

exp2

Numerical expression matrix for dataset2 with row for each gene and column for each cell. Row names are gene symbols. Column names are cell IDs which can be cross referenced against the annot data frame.

annot1

Annotation data frame for dataset1 which contains three columns at least: cell_id, level1class and level2class

annot2

Annotation data frame for dataset2 which contains three columns at least: cell_id, level1class and level2class

name1

Name used to refer to dataset 1. Leave blank if it's already a merged dataset.

name2

Name used to refer to dataset 2. Leave blank if it's already a merged dataset.

as_sparse

Convert the merged exp to a sparse matrix.

as_DelayedArray

Convert the merged exp to a DelayedArray.

verbose

Print messages.

Value

List containing merged exp and annot.

Examples

cortex_mrna <- ewceData::cortex_mrna()
#> see ?ewceData and browseVignettes('ewceData') for documentation
#> loading from cache
exp1 <- cortex_mrna$exp[, 1:50]
exp2 <- cortex_mrna$exp[, 51:100]
annot1 <- cortex_mrna$annot[1:50, ]
annot2 <- cortex_mrna$annot[51:100, ]
merged_res <- EWCE::merge_two_expfiles(
    exp1 = exp1,
    exp2 = exp2,
    annot1 = annot1,
    annot2 = annot2,
    name1 = "dataset1",
    name2 = "dataset2"
)
#> 0 non-overlapping gene(s) removed from exp1.
#> 0 non-overlapping gene(s) removed from exp2.
#> 19,972 intersecting genes remain.
#> Converting to data.frame
#> Converting to data.frame
#> Converting to sparse matrix.