normaliseCountMatrix-scRNAseq: normaliseCountMatrix

normaliseCountMatrix,scRNAseq-methodR Documentation

normaliseCountMatrix

Description

This function uses coldata (cells informations) and rowdata (genes informations) to filter the count matrix. It also normalizes by using deconvolution with size factors.

Usage

normaliseCountMatrix(theObject, sizes=c(20,40,60,80,100), rowdata=NULL,
                    coldata=NULL, alreadyCellFiltered=FALSE,
                    runQuickCluster=TRUE, info=TRUE)

Arguments

theObject

A scRNAseq object

sizes

Vector of size factors used by scran::computeSumFactors(). It is a numeric vector of pool sizes, i.e., number of cells per pool. See ?scran::computeSumFactors for more details.

rowdata

Data frame containing genes informations. Default is NULL.

coldata

Data frame containing cells informations. Default is NULL.

alreadyCellFiltered

Logical. If TRUE, quality check and filtering will not be applied.

runQuickCluster

Logical. If TRUE scran::quickCluster() function will be applied. It usually improves the normalization for medium-size count matrices. However, it is not recommended for datasets with less than 200 cells and may take too long for datasets with more than 10000 cells.

info

Logical. If TRUE, additional annotations like ensembl_gene_id, go_id, name_1006, chromosome_name and gene_biotype are added to the row data, for all the genes from the count matrix with ENSEMBL IDs or SYMBOL ID. Default: TRUE.

removeNoSymbol

Logical. If TRUE, genes with no SYMBOL are removed after the normalization

Details

This function uses the normalization method of the scater package. For more details about the normalization used see ?scater::normalize. The size factors used in the normalization are calculated with scran::computeSumFactors.

Beforehand, the function will annotate genes creating rowData and add statistics about cells into columnsMetaData. If you already have columnsMetaData and rowData, you can give it to the function (see manual). It will keep your columns and add new ones at the end. If you do not want to lose any cell after quality metrics check, select alreadyCellFiltered = TRUE, by default it is FALSE. Before scater normalization, the function will call scran::quickCluster (see manual for details). If you want to skip this step, set runQuickCluster = FALSE, by default it is TRUE. We advice to first try the analysis with this option and to set it to FALSE if no rare populations are found.

Value

Returns a scRNASeq object with its sceNorm slot updated. This slot contains a SingleCellExperiment object having the normalized count matrix, the colData (table with cells informations), and the rowData (table with the genes informations). See ?SingleCellExperiment for more details.

Author(s)

Ilyess RACHEDI, based on code by Polina PAVLOVICH and Nicolas DESCOSTES.

Examples

## Load the count matrix
countmatrixPath <- system.file("extdata/countMatrix.tsv", package="conclus")
countMatrix <- loadDataOrMatrix(file=countmatrixPath, type="countMatrix",
                                ignoreCellNumber=TRUE)

## Load the coldata
coldataPath <- system.file("extdata/colData.tsv", package="conclus")
columnsMetaData <- loadDataOrMatrix(file=coldataPath, type="coldata",
columnID="cell_ID")

## Create the initial object
scr <- singlecellRNAseq(experimentName = "Bergiers",
                countMatrix     = countMatrix,
                species         = "mouse",
                outputDirectory = "YourOutputDirectory")

## Normalize and filter the raw counts matrix
scr <- normaliseCountMatrix(scr, coldata = columnsMetaData, info=FALSE)


ilyessr/conclus documentation built on April 8, 2022, 1:43 p.m.