generateRef_DEseq2: Generate Reference Signature Matrix using DESeq2

View source: R/generateRef_DEseq2.R

generateRef_DEseq2R Documentation

Generate Reference Signature Matrix using DESeq2

Description

This function performs differential expression analysis using the DESeq2 package to identify genes that are significantly expressed across different cell types, as specified in 'pheno'. It calculates median expression levels of these significant genes to form a reference signature matrix.

Usage

generateRef_DEseq2(dds, pheno, FDR = 0.05, dat)

Arguments

dds

raw count data from RNA-seq

pheno

character vector; cell type class of the samples

FDR

numeric; genes with BH adjust p value < FDR are considered significant.

dat

data frame or matrix; normalized transcript quantification data (like FPKM, TPM). Note: cell's median expression level of the identified probes will be the output of reference_matrix.

Value

A list containing the following elements: - 'reference_matrix': A dataframe with the median expression values of significant genes across cell types. - 'G': The optimal number of probes that minimizes the condition number. - 'condition_number': The minimum condition number corresponding to the optimal number of probes. - 'whole_matrix': The whole median expression matrix used for further analysis or validation.

Examples

# Example usage assuming 'dds' is a DESeq2 dataset and 'dat' is normalized data:
# Load raw count data
dds <- matrix(sample(0:1000, 2000, replace = TRUE), nrow = 100, ncol = 20)
colnames(dds) <- paste("Sample", 1:20, sep = "_")
rownames(dds) <- paste("Gene", 1:100, sep = "_")

# Create phenotype data
pheno <- rep(c("Type1", "Type2"), each = 10)

# Load normalized data
dat <- matrix(runif(2000), nrow = 100, ncol = 20)
rownames(dat) <- rownames(dds)
colnames(dat) <- colnames(dds)

# Generate reference signature matrix
result <- generateRef_DEseq2(dds = dds, pheno = pheno, FDR = 0.05, dat = dat)
print(result$reference_matrix)

IOBR/IOBR documentation built on Sept. 9, 2024, 8:36 p.m.