normalizeNoiseq: Normalization based on the NOISeq package

View source: R/norm.R

normalizeNoiseqR Documentation

Normalization based on the NOISeq package

Description

This function is a wrapper over NOISeq normalization. It accepts a matrix of gene counts (e.g. produced by importing an externally generated table of counts to the main metaseqr2 pipeline).

Usage

    normalizeNoiseq(geneCounts, sampleList,
        normArgs = NULL, geneData = NULL, logOffset = 1,
        output = c("matrix", "native"))

Arguments

geneCounts

a table where each row represents a gene and each column a sample. Each cell contains the read counts for each gene and sample. Such a table can be produced outside metaseqr2 and is imported during the basic metaseqr2 workflow.

sampleList

the list containing condition names and the samples under each condition.

normArgs

a list of NOISeq normalization parameters. See the result of getDefaults("normalization", "noiseq") for an example and how you can modify it.

geneData

an optional annotation data frame (such the ones produced by get.annotation which contains the GC content for each gene and from which the gene lengths can be inferred by chromosome coordinates.

logOffset

an offset to use to avoid infinity in logarithmic data transformations.

output

the class of the output object. It can be "matrix" (default) for versatility with other tools or "native" for the NOISeq native S4 object (SeqExpressionSet). In the latter case it should be handled with suitable NOISeq methods.

Value

A matrix with normalized counts.

Author(s)

Panagiotis Moulos

Examples

dataMatrix <- metaseqR2:::exampleCountData(2000)
sampleList <- list(A=c("A1","A2"),B=c("B1","B2","B3"))
diagplotBoxplot(dataMatrix,sampleList)

lengths <- round(1000*runif(nrow(dataMatrix)))
starts <- round(1000*runif(nrow(dataMatrix)))
ends <- starts + lengths
gc=runif(nrow(dataMatrix))
geneData <- data.frame(
    chromosome=c(rep("chr1",nrow(dataMatrix)/2),
        rep("chr2",nrow(dataMatrix)/2)),
    start=starts,end=ends,gene_id=rownames(dataMatrix),gc_content=gc,
    biotype=rep("protein_coding",nrow(dataMatrix)),
    row.names=rownames(dataMatrix)
)
normDataMatrix <- normalizeNoiseq(dataMatrix,sampleList,normArgs=NULL,geneData)
diagplotBoxplot(normDataMatrix,sampleList)

pmoulos/metaseqR2 documentation built on May 20, 2024, 5:48 a.m.