Skip to contents

This function checks whether the values in an RNAseq expression data frame have been log2-transformed. It performs multiple checks, including the range of values, the presence of zeros, and the presence of negative values, to provide a robust assessment.

Usage

int_check_log2_transformation(expression_df, print_histogram = FALSE)

Arguments

expression_df

A data frame containing RNAseq expression data.

print_histogram

Set to TRUE to draw histogram with expression values, default is FALSE.

Value

A list with information about log2 transformation.

Details

The function uses the following criteria to determine if the data is log2-transformed:

  • If the maximum value exceeds 20, the data is likely not log2-transformed.

  • If the minimum value is less than -5, the data is likely not log2-transformed.

  • If the data contains zeros, it may be log2-transformed but without pseudocounts.

  • If the range and distribution of values are consistent with log2-transformed data, the function concludes that the data is likely log2-transformed.

Examples

if (FALSE) { # \dontrun{
# No examples provided
} # }