Learn R Programming

metaseqR (version 1.12.2)

make.fold.change: Calculates fold changes

Description

Returns a matrix of fold changes based on the requested contrast, the list of all samples and the data matrix which is produced by the metaseqr workflow. For details on the contrast, sample.list and log.offset parameters, see the main usage page of metaseqr. This function is intended mostly for internal use but can also be used independently.

Usage

make.fold.change(contrast, sample.list, data.matrix,
        log.offset = 1)

Arguments

contrast
the vector of requested statistical comparison contrasts.
sample.list
the list containing condition names and the samples under each condition.
data.matrix
a matrix of gene expression data whose column names are the same as the sample names included in the sample list.
log.offset
a number to be added to each element of data matrix in order to avoid Infinity on log type data transformations.

Value

  • A matrix of fold change ratios, treatment to control, as these are parsed from contrast.

Examples

Run this code
data.matrix <- round(1000*matrix(runif(400),100,4))
rownames(data.matrix) <- paste("gene_",1:100,sep="")
colnames(data.matrix) <- c("C1","C2","T1","T2")
fc <- make.fold.change("Control_vs_Treatment",list(Control=c("C1","C2"),
    Treatment=c("T1","T2")),data.matrix)

Run the code above in your browser using DataLab