BayRepulsive_unknown: BayRepulsive_unknown is a deconvolution function designed for...

Description Usage Arguments Details Value Source See Also Examples

View source: R/BayRepulsive.R

Description

This function gives the estimated number of subclones, along with deconvolution results of the observed matrix.

Usage

1
2
3
BayRepulsive_unknown(DATA, K_min, K_max, Nobs, Nfeature,
                      Niter = 100, epsilon = 0.0001, tau = 100,
                      a.theta = 0.01, b.theta = 0.01, seed = 1 )

Arguments

DATA

The observed data matrix. Each row represents a feature (gene); each column represents a sample.

K_min

The minimum number of subclones.

K_max

The Maximum number of subclones.

Nobs

The number of samples, i.e., the number of columns of the DATA.

Nfeature

The number of features, i.e., the number of rows of the DATA.

Niter

The number of maximum iterations.

epsilon

Tolerance for convergence. We determine whether to break based on the estimated weight matrix. We decide to break if the distance induced by L2 norm between two successive estimated weight matrices is less than epsilon.

tau

The hyperparameter for DPP. A large number is preferred. See BayRepulsive_known for more detials.

a.theta

The hyperparameter for DPP. See BayRepulsive_known for more detials.

b.theta

The hyperparameter for DPP. See BayRepulsive_known for more detials.

seed

The random seed.

Details

Given an observed matrix, whose columns are mixed samples of unknown number of subclones, this function gives an estimation of number of subclones along with deconvolution results.

We first use the algorithm in BayRepulsive_known to fit the data for every possible number of subclones. Let S(k) denote the square sum of the residuals when the number of subclones is fixed at k. We define the second-order finite difference Delta^2 S(k) of the residual by Delta^2(k) = [S(k+1)-S(k)]-[S(k)-S(k-1)], for k=Kmin+1,...,Kmax-1. Then the optimal \hat{K} estimated by BayRepulsive is

\hat{K} = argmin Delta^2 S(k).

And the deconvolution results are the corresponding results when the number of subclones is fixed at \hat{K}.

Value

A list of following components:

Z The estimated subclone-specific expression matrix.
W The estimated weight matrix.
K_hat The number of estimated subclones.

Source

BayRepulsive: A Bayesian Repulsive Deconvolution Model for Inferring Tumor Heterogeneity

See Also

BayRepulsive_known

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
rm(list=ls())
library(BayRepulsive)
data(CCLE)
set.seed(1)
Nobs     <- 24
Nfeature <- 100
K0       <- 3
### randomly generate weight matrix W for 24 mixing samples
W        <- matrix(0,nrow = K0, ncol = Nobs)
for(i in 1:Nobs){
  Theta <- rgamma(K0,1/K0,1)
  W[,i] <- Theta/sum(Theta)
}
### add some noise
error    <- t(matrix(rnorm(Nfeature * Nobs, mean = 0, sd = 0.5), nrow = Nobs))
DATA     <- CCLE$Z%*%W + error
### Note: please make sure that there are no negative values after adding the noise
result1  <- BayRepulsive_unknown(DATA = DATA, K_min = 2, K_max = 6, Nobs = Nobs,
                                 Nfeature = Nfeature)
cor(as.vector(result1$W), as.vector(W))

bruce1995/BayRepulsive documentation built on May 4, 2019, 9:50 a.m.