add_sample_into_compendium: add_sample_into_compendium

Description Usage Arguments Details Value Examples

View source: R/c3_functions.R

Description

This function adds cell/tissue gene expression data into a previously made compendium by making common genes for all cells/tissues.

Usage

1
2
3
add_sample_into_compendium(compendium.data, sample.data, species = "hsapiens",
  data.format = "matrix", geneID = "ensembl_gene_id",
  experiment.descriptor = NULL, collapse.method = "max")

Arguments

compendium.data

A gene expression compendium (list), as returned by make_gene_expression_compendium.

sample.data

A list, matrix or vector containing gene expression profiles. For a list, Each element of the list contains a named gene expression vector or matrix with replicates. The list names (denoting cell types) should be unique, otherwise the experiment.descriptor parameter value should be provided with unique names for each cell or tissue. For a matrix, rows denote the genes and the columns denote the cell types or tissues. Duplicate column names are expected in this case denoting replicate samples. All the replicate samples for a specific cell or tissue should have identical column names, otherwise the experiment.descriptor parameter should be used to identify replicate samples of a specific cell type or tissue. For a vector, it should be a contain expression values from a single cell type or tissue and the names of elements should be gene IDs.

species

The species of sample.data, used to identify valid gene names. The species should be the same for the compendium. Default is "hsapiens"

data.format

The format of sample.data, either 'list', 'matrix' or 'vector'. Default is "matrix".

geneID

The code for the type of gene IDs used by sample.data, as used by the biomaRt database. To find the valid codes for gene IDs for a species, please see the find_valid_geneID() function of the C3 package. Default is "ensembl_gene_id".

experiment.descriptor

A vector corresponding to the column names (matrix) or elements (list) of compendium.data, containing the cell type or tissues of each sample. The names should be identical for a specific cell or tissue. Defaults to NULL.

collapse.method

How to summarise values when one ensembl_gene_id has more then one value (multiple microarray probes or transcripts to one gene for example). Currently two options are implemented, 'max' or 'mean'. Default is "max".

Details

This function adds cell type or tissue specific gene expression data into an existing gene expression compendium and updates the compendium with a common gene universe.

Value

This function returns a list by adding the new sample data into the gene expression compendium (i.e., into 'avg.exp.matrix').

Examples

1
2
3
4
5
6
7
8
exp.data<-matrix(runif(100, min=0, max=10), 10, 10)
rownames(exp.data)<-c("ENSG00000100053", "ENSG00000109846", "ENSG00000244752", "ENSG00000138083", "ENSG00000181449", "ENSG00000160202", "ENSG00000007372", "ENSG00000117707", "ENSG00000101144", "ENSG00000277354")
colnames(exp.data)<-c("cell1", "cell2", "cell3", "cell4", "cell5", "cell6", "cell7", "cell8", "cell9", "cell10")
compendium.data<-make_gene_expression_compendium(gene.expression.data=exp.data, expression.data.format="matrix")
new.data<-matrix(sample(1:10, 100, replace=TRUE),10,10)
rownames(new.data)<-c("CRYAA", "CRYAB", "CRYBB3", "PAX6", "SOX2", "PROX1", "SIX3", "CRIM1", "CRYBB2", "BMP7")
colnames(new.data)<-c("cell11", "cell11", "cell11", "cell12", "cell12", "cell12", "cell13", "cell13", "cell13", "cell13")
add_sample_into_compendium(compendium.data = compendium.data, sample.data = new.data, geneID = "external_gene_name")

VCCRI/C3 documentation built on May 14, 2019, 8:41 a.m.