load_cellranger_data | R Documentation |
This function reads a vector of cellranger "out" folders for conversion to a monocle3 cell_data_set object
#' There are two modes of this function that enable reading data: 1. folder-mode - Loading cellranger output folder(s) specifying folder locations using the 'folders' argument 2. file-mode - Specifying h5 files directly using 'files' argument
There are two datatypes that can be read from cellranger output: 1. Loading the cellranger h5 files either by specifying cellranger output folder(s) (containing the h5 files as geneerated by cellranger) or or can directly import .h5 files using the 'file' argument. 2. Loading the traditional 3 files output from cellranger: (matrix.mtx, barcodes.tsv, genes.tsv)
As a default, this function will use the cellranger-imposed filters for identification of droplets that do not contain cells, however, optionally, this function can return the unfiltered data as well for further manipulation (ie manual adjustment of droplet thresholds) if desired.
load_cellranger_data( folders = NULL, files = NULL, data_type = c("h5", "files3"), samplenames = NULL, unfiltered = F, unfilt_files = NULL, empty.droplet.threshold = 15, expressed_genes = TRUE, cell_min = 1, aggregated = F, chemistry = "SC3Pv3", atac_feature = "peaks" )
folders |
A vector of cellranger folders (full folder name). These must contain an "outs" subfolders with two files; 1) raw_feature_bc_matrix.h5, and 2) filtered_feature_bc_matrix.h5 (if using the data_type = 'h5' setting, or the 3 files: matrix.mtx, barcodes.tsv, genes.tsv. For aggregated samples nrun with cellrangers 'aggregate' function, this folder should also contain the aggregation.csv file. |
files |
A vector of filtered h5 cellranger files. Not compatible with aggregated mode. |
data_type |
Use 'h5' for h5 import or 'files3' for the traditional 3 files (matrix.mtx, barcodes.tsv, genes.tsv). |
samplenames |
An optional vector that corresponds to the names you would like to give to each element in filelist. This defaults to the the basename of the filelist element i.e. |
unfiltered |
This parameter, if TRUE, returns a list containing 1) the filtered cds, 2) a list of unfiltered cds for each sample in 'folders', ultimately enabling the user to set desired cutoffs for inclusion of droplets as 'cells'. |
unfilt_files |
A vector of unfiltered h5 cellranger files. Not compatible with aggregated mode. Will be ignored if unfiltered is FALSE. |
empty.droplet.threshold |
minimum number of umis per droplet to include in unfiltered output (default 15) |
expressed_genes |
If true, this option removes genes that do not have expression in at least a minumum number of cells (cell_min parameter) |
cell_min |
Minimum number of cells that a gene needs to be expressed for the gene to be included |
aggregated |
will read a cellranger aggregate folder, this is currently only supported for 1 folder. The 'aggregation.csv' file must be included in the 'outs' folder. |
a cell_data_set object or a list of items if unfiltered data is returned (see unfiltered)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.