DSA: Interface function to implement DSA

Description Usage Arguments Details Value See Also Examples

View source: R/DSA.R

Description

This is the main interface function to implement digital sorting algorithm for cell type specific gene expression profiles.

Usage

1
2
DSA(mix, cell.gene, weight = NULL, method = "LM", out.cell.file = NULL, 
	out.weight.file = NULL, log2 = TRUE, l = 0, u = 2^34, meq = 0)

Arguments

mix

matrix of mixture signals (genes in row, cell type in column).

cell.gene

the cell-gene key table: mapping between cell type and cell specific genes. This table needs to be only two columns: first column with gene symbols, second column the cell type.

weight

weight matrix (samples in row, cell types in column). Default to 'NULL', where no weight matrix is provided by user, and the weight will be estimated by the function.

method

methods used in estimating weight and true signals for each tissue type. Default to 'LM' for linear regression. Other methods included 'LG' (logistic regression),'QP_LM' or 'QP_LG' (quadradic programming with constraint on the estimated parameter on linear/logistic regression).

out.cell.file

file name to store the deconvoluted signals. default to 'NULL' where no file will be created.

out.weight.file

file name to store the estimated weights. default to 'NULL' where no file will be created.

log2

flag indicating if the input mixture signals are in log2 scale. Default to 'TRUE'.

l,u

values for the lower- (l) and upper- (u) bound used in setting the vector for values of b0 (bvec for solve.QP) in solving for quadratic programming. Defaults to 0 and 2^34 respectively.

meq

default to zero (used to set meq for solve.QP)

Details

This is the main function (an interface) to implement digital sorting algorithm for cell type specific gene expression profiles, by proving minimum of an data matrix for mixture signal and cell-gene key tables. You may provide specific parameters for weight estimation and deconvolution.

Value

A list object containing two elements:

est.weight

a list of estimated weight ('estimated_weight') and the model's mean square error ('mse'). estimated_weight is a matrix of cell types in row and samples in columns. mse defaults to 'NULL' if method is not 'LM'.

deconv

a matrix of deconvoluted signals: genes in row, cell types in columns.

See Also

EstimateWeight, Deconvolution, GSM_QP, solve.QP,

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
	## load package DSA
	library(DSA)
	
	## load sample data
	data('mix.signals')
	data('cell.gene')
	data('weight')
	
	# In this data, thr first three samples contain signal from only one cell	
	pure <- mix[, 1:3]
	mix <- mix[, 4:14]

	weight.orig <- weight
	weight <- weight[4:14, ]

	## Exp 1: Obtain the cell-type specific signals estimated from DSA with default parameters: 
	##			estimated weights and linear model in deconvolution
	decov.LM <- DSA(mix, cell.gene)
	
	## Exp 2: Obtain the cell-type specific signals estimated from DSA with estimated 
	##			weight and quadratic programming
	dec.QLM <- DSA(mix, cell.gene, method="QP_LM")
	
	# check cell type proportions
	t.weight <- as.numeric(weight)/100
	e.weight <- as.numeric(t(dec.QLM$est.weight))
	limits <- range(t.weight, e.weight)

	plot(t.weight, e.weight, xlim=limits, pch=19, ylim=limits)
	cor(t.weight, e.weight)
	abline(a=0, b=1)

	# check the estimated cell-type specific signals
	par(mfrow=c(1,3))
	for(i in 1:3){
		print(cor(2^(pure[,i]),2^(dec.QLM$deconv[,i])))
	}

chichaumiau/DSA documentation built on Dec. 19, 2021, 3:56 p.m.