| generateRef | R Documentation |
Generates a reference signature matrix for cell types based on differential expression analysis. Supports both limma for normalized data and DESeq2 for raw count data.
generateRef(dds, pheno, FDR = 0.05, dat, method = "limma")
dds |
Matrix. Raw count data from RNA-seq. Required if 'method = "DESeq2"'. |
pheno |
Character vector. Cell type class of the samples. |
FDR |
Numeric. Genes with BH adjusted p-value < FDR are considered significant. Default is 0.05. |
dat |
Matrix or data frame. Normalized transcript quantification data (e.g., FPKM, TPM). |
method |
Character. Method for differential expression: '"limma"' or '"DESeq2"'. Default is '"limma"'. |
List containing: - 'reference_matrix': Data frame of median expression for significant genes across cell types. - 'G': Optimal number of probes minimizing condition number. - 'condition_number': Minimum condition number. - 'whole_matrix': Full median expression matrix.
expressionData <- matrix(runif(1000 * 4, min = 0, max = 10), ncol = 4)
rownames(expressionData) <- paste("Gene", 1:1000, sep = "_")
colnames(expressionData) <- paste("Sample", 1:4, sep = "_")
phenotype <- c("celltype1", "celltype2", "celltype1", "celltype2")
rawCountData <- matrix(sample(1:100, 1000 * 4, replace = TRUE), ncol = 4)
rownames(rawCountData) <- paste("Gene", 1:1000, sep = "_")
colnames(rawCountData) <- paste("Sample", 1:4, sep = "_")
result <- generateRef(
dds = rawCountData, pheno = phenotype,
FDR = 0.05, dat = expressionData, method = "DESeq2"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.