Description Usage Arguments Details Value Author(s)
View source: R/aveytoolkit_FoldChange.R
Calculate the fold change between pairs of conditions in a matrix or data frame
1 2 3 4 5 6 7 8 9 10 | FoldChange(
x,
condNum,
condDen,
conditions,
grouping,
preserveOrder = FALSE,
log2Transform = FALSE,
oper = c("subtract", "divide")
)
|
x |
matrix or data.frame from which to calculate fold changes with samples in columns. |
condNum |
a vector of condition(s) to be used as the numerator in the fold change calculation |
condDen |
a vector of condition(s) to be used as the denominator in the fold change calculation |
conditions |
a vector with length equal to the number of columns of x containing the condition labels between which to find the fold changes. |
grouping |
a vector with length equal to the number of columns of x containing a grouping of the samples (e.g. subjects, cell lines, strains). |
preserveOrder |
if TRUE, the same ordering of the columns in x will be kept after columns in condDen are removed. If FALSE (the default for backwards compatability), the ordering is changed to sort by group, then by condNum in order passed in. |
log2Transform |
when 'TRUE', log2 transformation will be applied to x before taking the FC. If 'FALSE' (default) no transformation is applied and x is ASSUMED to be already log transformed. |
oper |
the operation to be performed between numerator and denominator. Default is 'subtract' because this is appropriate for log-transformed data. Set oper to 'divide' if data is on linear scale. |
FoldChange takes the fold change of log2 transformed data by subtracting columns of the x dataframe or matrix depending on the conditions passed in.
a data.frame of the fold changes with one column for each fold change
Stefan Avey
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.