fold_change: calculation of Fold-Change

Description Usage Arguments Value Author(s) Examples

View source: R/fold_change.R

Description

A function to calculate fold-change between group comparison; "Test_group" vs "Ref_group"

Usage

1
2
3
4
5
6
7
fold_change(
  df_raw = df_raw,
  sample_info = sample_info,
  Group_column = Group_column,
  Test_group = Test_group,
  Ref_group = Ref_group
)

Arguments

df_raw

Matrix of normalized expression data (not Log2 transformed). Genes should be in rows and Sample ID in columns. Row names are required to be valid Gene Symbols

sample_info

A dataframe with sample annotation. Sample_info dataframe requires two columns: 1) a column specifying Sample ID (exactly matching Sample ID of data.matrix) and 2) a column specifying group names

Group_column

Character vector identical to the column name from sample_info dataframe that specifies group annotation used for the analysis

Test_group

Character vector specifying values within the group column (Group_column) that will be used as Test group (samples considered as cases or “intervention” group).

Ref_group

Character vector specifying value within the group column (Group_column) that will be used as Reference group

Value

A matrix of the fold change comparison between "Test_group" vs ""Ref_group"

Author(s)

Darawan Rinchai drinchai@gmail.com

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## data could be downloaded from ExperimentHub("GSE13015")
library(ExperimentHub)
library(SummarizedExperiment)
dat = ExperimentHub()
res = query(dat , "GSE13015")
GSE13015 = res[["EH5429"]]
data_matrix = assay(GSE13015)
sample_ann = data.frame(colData(GSE13015))

FCgroup = fold_change(df_raw = data_matrix[c(1:5),],
                     sample_info = sample_ann,
                     Group_column = "Group_test",
                     Test_group="Sepsis",
                     Ref_group="Control")

Drinchai/BloodGen3Module documentation built on Sept. 20, 2021, 10:31 p.m.