Principal Coordinates Analysis (PCoA) is a dimensionality reduction method that transforms a distance matrix from a high-dimensional space into a low-dimensional space while retaining the original data's essential properties.
Usage
dr_pcoa(
processed_se,
dist_method = "euclidean",
correction = "cailliez",
clustering = "kmeans",
cluster_num = 2,
kmedoids_metric = NULL,
distfun = NULL,
hclustfun = NULL,
eps = NULL,
minPts = NULL
)Arguments
- processed_se
A SummarizedExperiment object constructed by
as_summarized_experimentand processed bydata_process.- dist_method
Character. The distance measure to be used for constructing the distance matrix. One of "bray", "euclidean", "manhattan", "jaccard", "canberra", etc. Default is
"euclidean".- correction
Character. Correction methods for negative eigenvalues. One of "none", "lingoes", "cailliez". Default is
"cailliez".- clustering
Character. The method to be used for clustering. Allowed method include "kmeans", "kmedoids", "hclustering", "dbscan", "group_info". Default is
"kmeans". The option"group_info"is currently available only when the input is a SummarizedExperiment object resulting from differential expression analysis (e.g.,deSp_twoGroup(),deSp_multiGroup()); in this case, dimensionality reduction is performed based on the significant features and group information derived from the DE results.- cluster_num
Numeric. The interpretation of
cluster_numdepends on the value ofclustering:"group_info": A positive integer equal to the number of groups."kmeans"or"kmedoids": A positive integer between 2 and (number of samples - 1)."hclustering": A positive integer between 2 and the number of samples."dbscan": Should beNULL.
Default is
2.- kmedoids_metric
Character. The metric to be used for calculating dissimilarities between observations when choosing
"kmedoids"as clustering method. Must be one of "euclidean" and "manhattan". If "kmedoids" is not selected as the clustering method, set the value to NULL.- distfun
Character. The distance measure to be used when choosing
"hclustering"as clustering method. Allow method include "pearson", "kendall", "spearman", "euclidean", "manhattan", "maximum", "canberra", "binary", and "minkowski". If "hclustering" is not selected as the clustering method, set the value to NULL.- hclustfun
Character. The agglomeration method to be used when choosing
"hclustering"as clustering method. This should be (an unambiguous abbreviation of) one of "ward.D", "ward.D2", "single", "complete", "average" (=UPGMA), "mcquitty" (= WPGMA), "median" (= WPGMC), or "centroid" (= UPGMC). If "hclustering" is not selected as the clustering method, set the value to NULL.- eps
Numeric. The size of the epsilon neighborhood when choosing
"dbscan"as clustering method. If "dbscan" is not selected as the clustering method, set the value to NULL.- minPts
Numeric. The number of minimum points in the eps region (for core points) when choosing
"dbscan"as clustering method. If "dbscan" is not selected as the clustering method, set the value to NULL.
Value
Return a list with 2 tables, 1 interactive plot, and 1 static plot.
pcoa_rotated_data: a data frame of PCoA coordinates
table_pcoa_contribution: a data frame, variance explained by each axis
interactive_pcoa & static_pcoa: PCoA plot
Examples
data("profiling_data")
processed_se <- data_process(profiling_data, exclude_missing=TRUE, exclude_missing_pct=70,
replace_na_method='min', replace_na_method_ref=0.5, normalization='Percentage', transform='log10')
result_pca <- dr_pcoa(processed_se, dist_method='euclidean', correction='cailliez',
clustering='kmeans', cluster_num=2, kmedoids_metric=NULL, distfun=NULL,
hclustfun=NULL, eps=NULL, minPts=NULL)
#> Registered S3 methods overwritten by 'vegan':
#> method from
#> reorder.hclust seriation
#> rev.hclust dendextend