An S4 class that contains all elements needed for CA.
cacomp-class.RdThis class contains elements necessary to computer CA coordinates or Association Plot coordinates, as well as other informative data such as row/column inertia, gene-wise APL-scores, etc. ...
Creates new cacomp object.
Slots
Uclass "matrix". Left singular vectors of the original input matrix.
Vclass "matrix". Right singular vectors of the original input matrix.
Dclass "numeric". Singular values of the original inpt matrix.
std_coords_rowsclass "matrix". Standardized CA coordinates of the rows.
std_coords_colsclass "matrix". Standardized CA coordinates of the columns.
prin_coords_rowsclass "matrix". Principal CA coordinates of the rows.
prin_coords_colsclass "matrix". Principal CA coordinates of the columns.
apl_rowsclass "matrix". Association Plot coordinates of the rows for the direction defined in slot "group"
apl_colsclass "matrix". Association Plot coordinates of the columns for the direction defined in slot "group"
APL_scoreclass "data.frame". Contains rows sorted by the APL score. Columns: Rowname (gene name in the case of gene expression data), APL score calculated for the direction defined in slot "group", the original row number and the rank of the row as determined by the score.
dimsclass "numeric". Number of dimensions in CA space.
groupclass "numeric". Indices of the chosen columns for APL calculations.
row_massesclass "numeric". Row masses of the frequency table.
col_massesclass "numeric". Column masses of the frequency table.
top_rowsclass "numeric". Number of most variable rows chosen.
tot_inertiaclass "numeric". Total inertia in CA space.
row_inertiaclass "numeric". Row-wise inertia in CA space.
col_inertiaclass "numeric". Column-wise inertia in CA space.
permuted_dataclass "list". Storage slot for permuted data.
paramsclass "list". List of parameters.
Examples
set.seed(1234)
# Simulate counts
cnts <- mapply(function(x){rpois(n = 500, lambda = x)},
x = sample(1:20, 50, replace = TRUE))
rownames(cnts) <- paste0("gene_", 1:nrow(cnts))
colnames(cnts) <- paste0("cell_", 1:ncol(cnts))
res <- APL:::comp_std_residuals(mat=cnts)
SVD <- svd(res$S)
names(SVD) <- c("D", "U", "V")
SVD <- SVD[c(2, 1, 3)]
ca <- new_cacomp(U = SVD$U,
V = SVD$V,
D = SVD$D,
row_masses = res$rowm,
col_masses = res$colm)