Title: | Gene Scoring from Count Tables |
---|---|
Description: | Provides two methods for automatic calculation of gene scores from gene count tables: the z-score method, which requires a table of samples being scored and a count table with control samples, and the geometric mean method, which does not rely on control samples. The mathematical methods implemented are described by Kim et al. (2018) <doi:10.1089/jir.2017.0127>. |
Authors: | Aris Syntakas [aut, cre] |
Maintainer: | Aris Syntakas <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.1.1 |
Built: | 2024-10-26 03:30:26 UTC |
Source: | CRAN |
This function computes the geometric mean for each sample in the given count table.
geomean(count_table)
geomean(count_table)
count_table |
A data frame of gene count data (genes as rows, samples as columns). All columns must be numeric. |
A data frame with the geometric means per sample and the sample IDs.
# Example data to be scored count_table <- data.frame( sample1 = c(1, 10, 100), sample2 = c(2, 20, 200), sample3 = c(3, 30, 300) ) rownames(count_table) <- c("gene1", "gene2", "gene3") # Calculate Geometric Mean per sample in the count_table geomean(count_table)
# Example data to be scored count_table <- data.frame( sample1 = c(1, 10, 100), sample2 = c(2, 20, 200), sample3 = c(3, 30, 300) ) rownames(count_table) <- c("gene1", "gene2", "gene3") # Calculate Geometric Mean per sample in the count_table geomean(count_table)
This function computes a Z-score sum for each sample in the given "scored" count table, based on the means and SDs of the genes in the control table.
zscore(scored_table, control_table)
zscore(scored_table, control_table)
scored_table |
Data frame of samples to be scored (genes as rows, samples as columns). All columns must be numeric. |
control_table |
Data frame of control samples (genes as rows, samples as columns). All columns must be numeric. |
A data frame with the sum of Z-scores per sample and the sample IDs.
# Example data to be scored scored_table <- data.frame( sample1 = c(1, 2, 3), sample2 = c(4, 5, 6), sample3 = c(7, 8, 9) ) rownames(scored_table) <- c("gene1", "gene2", "gene3") # Example control data control_table <- data.frame( control1 = c(1, 1, 1), control2 = c(2, 2, 2), control3 = c(3, 3, 3) ) rownames(control_table) <- c("gene1", "gene2", "gene3") # Calculate Z-score for each sample of the scored_table zscore(scored_table, control_table)
# Example data to be scored scored_table <- data.frame( sample1 = c(1, 2, 3), sample2 = c(4, 5, 6), sample3 = c(7, 8, 9) ) rownames(scored_table) <- c("gene1", "gene2", "gene3") # Example control data control_table <- data.frame( control1 = c(1, 1, 1), control2 = c(2, 2, 2), control3 = c(3, 3, 3) ) rownames(control_table) <- c("gene1", "gene2", "gene3") # Calculate Z-score for each sample of the scored_table zscore(scored_table, control_table)