Convert log2 fold change to signed fold change
Value
numeric vector representing signed fold change values,
using negative values for negative log2 fold changes.
Details
This function takes log2 fold change values as input, and returns normal space fold change values that retain the positive and negative sign, and the magnitude.
For this function, a log2 fold change zero 0 becomes
fold change 1.
For example:
log2 fold change = 2becomesfold change = 4.log2 fold change = -2becomesfold change = -4.log2 fold change = 0becomesfold change = 1.
This function therefore differs from similar functions that convert
log2 fold change into a ratio. Instead, log2fold_to_fold()
retains the magnitude of negative changes.
See also
Other jam numeric functions:
deg2rad(),
fold_to_log2fold(),
noiseFloor(),
normScale(),
rad2deg(),
rowGroupMeans(),
rowRmMadOutliers(),
warpAroundZero()
Examples
x <- c(-3, -2, -1, 0, 1, 2, 3, NA);
fc <- log2fold_to_fold(x);
fc;
#> [1] -8 -4 -2 1 2 4 8 NA
fold_to_log2fold(fc);
#> [1] -3 -2 -1 0 1 2 3 NA