acPCoA: Perform AC-PCoA for confounding factor adjustement based on...

Description Usage Arguments Value Examples

Description

Perform AC-PCoA for confounding factor adjustement based on Principle Coordinate Analysis

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
acPCoA(
  DistanceMatrix,
  ConfounderMatrix,
  nPC = 2,
  lambdas = seq(0, 20, 0.05),
  kernel = "linear",
  bandwidth = NULL,
  anov = T,
  perc = 0.05
)

Arguments

DistanceMatrix

the n by n data distance matrix, where n is the number of samples. The (i,j)-th entry stands for the distance (dissimilarity) between the i-th sample and the j-th sample.

ConfounderMatrix

the n by q confounder matrix, where n is the number of samples, q is the number of confounding factors.

nPC

number of principal components to compute

lambdas

the tuning parameter, non-negative.

kernel

the kernel to use: "linear", "gaussian".

bandwidth

bandwidth h for Gaussian kernel. Optional.

anov

True or False. Whether the penalty term has the between groups sum of squares interpretation. Default is True.

perc

the best lambda is defined to be the smallest lambda with R(lambda)<=perc (if anov=T), or R(lambda)<=perc*R(lambda=0) (if anov=F) in the nPC principal components.

Value

The principal components and the projected data

v

the principal components, p by nPC matrix

Xv

the projected data, i.e. X times v

eigenvalueX

eigenvalues for the PCs

varianceX

variance explained by the PCs

varianceX_perc

percentage of total variance in X explained by the PCs. If eval=F, NA is returned.

eigenvalueXperm

eigenvalues for the PCs, permutation. If eval=F, NA is returned.

varianceXperm

variance explained by the PCs, permutation. If eval=F, NA is returned.

sigPC

the significant PCs. If eval=F, NA is returned.

...

Input parameters for the function

Examples

1
2
3
4
5
6
7
## Not run: 
X <- data_mbqc_groupA$DistMat.BC;
Y <- data_mbqc_groupA$ConfounderMat;
result_acPCoA <- acPCoA(DistanceMatrix=X, ConfounderMatrix=Y, nPC=2, lambda=seq(0, 20, 0.05), kernel="linear")
ggplot(as.data.frame(result_acPCoA$Xv),aes(x=V1,y=V2,color=data_mbqc_groupA$Specimen))+geom_point()

## End(Not run)

YuWang28/acPCoA documentation built on Dec. 18, 2021, 8:20 p.m.