baseline_exprs: Estimate the offset terms.

Description Usage Arguments Value Examples

View source: R/baseline_fn.R

Description

Estimate the offset terms.

Usage

1
baseline_exprs(Y, pure_samples, markers, summary_fn = mean)

Arguments

Y

Expression matrix.

(Required) Two-dimensional numeric. Must implement as.matrix.

Each row contains expression measurements for a particular sample. Each columm contains the measurements of the same gene over all individuals. Can either contain just the mixture samples to be deconvolved or both the mixture samples and the reference samples. See pure_samples and references for more details.

pure_samples

The pure sample indicies.

(Optional) List of one-dimensional integer. Must implement as.list.

The i-th element of the top-level list is a vector of indicies (rows of Y or references) that are pure samples of type i. If references is not specified then this argument identifies which rows of Y correspond to pure reference samples of which cell-types. If references is specified then this makes same idenficiation but for the references matrix instead.

markers

Marker gene indices.

(Optional) List of one-dimensional integer.

Top-level list should be same length as pure_samples, i.e. one element for each cell type. Each element of the top-level list is a vector of indicies (columns of Y) that will be considered markers of that particular type. If not supplied then dtangle finds markers internally using find_markers. Alternatively, one can supply the output of find_markers to the markers argument.

summary_fn

What summary statistic to use when aggregating expression measurements.

(Optional) Function that takes a one-dimensional vector of numeric and returns a single numeric.

Defaults to the mean. Other good options include the median.

Value

List of vectors. Each vector is estimated estimated basline in pure samples of markers for each group, resp.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
truth = shen_orr_ex$annotation$mixture
pure_samples <- lapply(1:3, function(i) {
   which(truth[, i] == 1)
})
Y <- shen_orr_ex$data$log
markers = find_markers(Y=Y,
pure_samples = pure_samples,data_type='microarray-gene',marker_method='ratio')$L
K = length(pure_samples)
n_markers = rep(20,K)
mrkrs <- lapply(1:K, function(i) {
       markers[[i]][1:n_markers[i]]
})
dtangle:::baseline_exprs(Y, pure_samples, mrkrs)

dtangle documentation built on Dec. 2, 2019, 1:09 a.m.