logfc_cols: Calculating logFC between two columns of a dataframe

Description Usage Arguments Details Value Examples

View source: R/logfc_cols.R

Description

This function returns dataframe with 3 columns col1, col2, log2FC. Mind the column names order: the logFC is always calculated between the first anf the second input.

Usage

1
logfc_cols(data, col1, col2)

Arguments

data

dataframe with normalized counts

col1

name or number of the column in df

col2

name or number the column in df

Details

As an example, when this function is useful is lack of data. In order to find the differentially expressed genes more samples are needed. In case of fewer samples an alternative approach is to manually calculate the expected behaviour of the desired output genes. For example, we expect a gene to have lfc > 3 for samples 1vs2 and 5vs6. In this case the logfc_cols() function could be used to calculate and order individual logFold changes, which could be further used to select the genes with the desired begaviour.

Value

dataframe with 3 columns col1, col2, log2FC

Examples

1
2
3
logfc_cols(dataNorm_df, "column_name", "5")
logfc_cols(dataNorm_df, "column_name", 5)
logfc_cols(dataNorm_df, 1, 5)

Troshchk/bioEAT documentation built on Dec. 18, 2021, 5:13 p.m.