merge_eset: Merge Two ExpressionSet Class Objects into One

View source: R/pipeline_functions.R

merge_esetR Documentation

Merge Two ExpressionSet Class Objects into One

Description

merge_eset merges two ExpressionSet class objects and returns one ExpresssionSet object. If genes in the two ExpressionSet objects are identical, the expression matrix will be combined directly. Otherwise, Z-transformation is strongly suggested to be performed before combination (set std=TRUE).

Usage

merge_eset(
  eset1,
  eset2,
  group1 = NULL,
  group2 = NULL,
  group_col_name = "original_group",
  use_col = NULL,
  remove_batch = FALSE,
  std = FALSE
)

Arguments

eset1

ExpressionSet class, the first ExpressionSet.

eset2

ExpressionSet class, the second ExpressionSet.

group1

character, name of the first ExpressionSet.

group2

character, name of the second ExpressionSet.

group_col_name

character, name of the column which contains the names defined in group1 and group2. This column is designed to show which original ExpressionSet each sample comes from before combination. Default name of this column is "original_group".

use_col

a vector of characters, the column names in the phenotype information to be kept. If NULL, shared column names of eset1 and eset2 will be used. Default is NULL.

remove_batch

logical, if TRUE, remove the batch effects from these two expression datasets. Default is FALSE.

std

logical, whether to perform std to the original expression matrix. Default is FALSE.

Value

Return an ExressionSet class object.

Examples

mat1 <- matrix(rnorm(10000),nrow=1000,ncol=10)
colnames(mat1) <- paste0('Sample1_',1:ncol(mat1))
rownames(mat1) <- paste0('Gene',1:nrow(mat1))
eset1 <- generate.eset(exp_mat=mat1)
mat2 <- matrix(rnorm(10000),nrow=1000,ncol=10)
colnames(mat2) <- paste0('Sample2_',1:ncol(mat1))
rownames(mat2) <- paste0('Gene',1:nrow(mat1))
eset2 <- generate.eset(exp_mat=mat2)
new_eset <- merge_eset(eset1,eset2)

jyyulab/NetBID documentation built on Dec. 23, 2024, 6:34 a.m.