importDropEst: Create a SingleCellExperiment Object from DropEst output

View source: R/importDropEst.R

importDropEstR Documentation

Create a SingleCellExperiment Object from DropEst output

Description

imports the RDS file created by DropEst (https://github.com/hms-dbmi/dropEst) and create a SingleCellExperiment object from either the raw or filtered counts matrix. Additionally parse through the RDS to obtain appropriate feature annotations as SCE coldata, in addition to any metadata.

Usage

importDropEst(
  sampleDirs = NULL,
  dataType = c("filtered", "raw"),
  rdsFileName = "cell.counts",
  sampleNames = NULL,
  delayedArray = FALSE,
  class = c("Matrix", "matrix"),
  rowNamesDedup = TRUE
)

Arguments

sampleDirs

A path to the directory containing the data files. Default "./".

dataType

can be "filtered" or "raw". Default "filtered".

rdsFileName

File name prefix of the DropEst RDS output. default is "cell.counts"

sampleNames

A User-defined sample name. This will be prepended to all cell barcode IDs. Default "sample".

delayedArray

Boolean. Whether to read the expression matrix as DelayedArray object or not. Default FALSE.

class

Character. The class of the expression matrix stored in the SCE object. Can be one of "Matrix" (as returned by readMM function), or "matrix" (as returned by matrix function). Default "Matrix".

rowNamesDedup

Boolean. Whether to deduplicate rownames. Default TRUE.

Details

importDropEst expects either raw counts matrix stored as "cm_raw" or filtered counts matrix stored as "cm" in the DropEst rds output. ColData is obtained from the DropEst corresponding to "mean_reads_per_umi","aligned_reads_per_cell", "aligned_umis_per_cell","requested_umis_per_cb","requested_reads_per_cb" If using filtered counts matrix, the colData dataframe is subset to contain features from the filtered counts matrix alone. If any annotations of ("saturation_info","merge_targets","reads_per_umi_per_cell") are found in the DropEst rds, they will be added to the SCE metadata field

Value

A SingleCellExperiment object containing the count matrix, the feature annotations from DropEst as ColData, and any metadata from DropEst

Examples

# Example results were generated as per instructions from the developers of dropEst described in
# https://github.com/hms-dbmi/dropEst/blob/master/examples/EXAMPLES.md
sce <- importDropEst(sampleDirs = system.file("extdata/dropEst_scg71", package = "singleCellTK"),
                     sampleNames = 'scg71')

compbiomed/singleCellTK documentation built on Oct. 27, 2024, 3:26 a.m.