Description Usage Arguments Value Author(s) Examples
A function for creating a gene by sample matrix containing normalized counts. The expected input is a dataframe with gene_id, sample and fpkm counts.
1 | create_sample_gene_matrix(data = NULL, genes = NULL, samples = NULL)
|
data |
Dataframe containing gene_id, sample and fpkm. (required) |
genes |
A vector of gene names to filter (optional, default: NULL) |
samples |
A vector of sample names to subset (optional, default: NULL) |
Returns a dataframe containing samples as columns and gene names as rows.
Richard J. de Borja <richard.deborja@uhnresearch.ca
1 2 3 4 5 6 7 8 9 | data <- data.frame(
gene_id=c("TP53", "ATK1", "NF2", "TP53", "ATK1", "NF2","TP53", "ATK1", "NF2"),
sample=c("S1", "S1", "S1", "S2", "S2", "S2", "S3", "S3", "S3"),
fpkm=c(1.06, 2.4, 2.3, 1.52, 1.33, 1.4, 2.7, 2.1, 8.2))
data$gene_id <- as.character(data$gene_id)
data$sample <- as.character(data$sample)
out_matrix <- create_sample_gene_matrix(
data=data
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.