scale_abundance: Normalise the counts of transcripts/genes

scale_abundanceR Documentation

Normalise the counts of transcripts/genes

Description

scale_abundance() takes as imput a 'tbl' formatted as | <SAMPLE> | <TRANSCRIPT> | <COUNT> | <...> | and normalises the data for the library size (e.g., with TMM algorithm, Robinson and Oshlack doi.org/10.1186/gb-2010-11-3-r25).

Usage

scale_abundance(.data, verbose = TRUE, action = "add")

Arguments

.data

A 'tbl' formatted as | <SAMPLE> | <TRANSCRIPT> | <COUNT> | <...> |

action

A character string between "add" (default) and "get". "add" joins the new information to the input tbl (default), "get" return a non-redundant tbl with the just new information.

.sample

The name of the sample column

.transcript

The name of the transcript/gene column

.abundance

The name of the transcript/gene abundance column

cpm_threshold

A real positive number. It is the threshold of count per million that is used to filter transcripts/genes out from the normalisation procedure. The normalisation inference is then applied back to all unfiltered data.

prop

A real positive number between 0 and 1. It is the threshold of proportion of samples for each transcripts/genes that have to be characterised by a cmp bigger than the threshold to be included for normalisation procedure.

method

A character string. The methods used by the function. The method is passed to the function 'calcNormFactors' from edgeR package.

reference_selection_function

A fucntion that is used to selecting the reference sample for normalisation. It could be max (default), which choose the sample with maximum library size; or median, which chooses the sample with median library size.

Details

\lifecycle

experimental

normalises the data for the library size (e.g., with TMM algorithm, Robinson and Oshlack doi.org/10.1186/gb-2010-11-3-r25). Lowly transcribed transcripts/genes (defined with cpm_threshold and prop parameters) are filtered out from the normalisation procedure. The normalisation inference is then applied back to all unfiltered data.

Value

A tbl object with additional columns with normalised data as '<NAME OF COUNT COLUMN> normalised'

Examples





counts %>%
    scale_abundance(sample, transcript, `count`)





stemangiola/ttSc documentation built on Dec. 8, 2022, 2:37 a.m.