| plot_sample_space | R Documentation |
Create a dimensional reduction plot to visualize sample relationships in gene expression space using PCA or UMAP.
plot_sample_space(
phyex_set,
method = c("PCA", "UMAP"),
colour_by = c("identity", "TXI"),
seed = 42,
...
)
phyex_set |
A PhyloExpressionSet object (BulkPhyloExpressionSet or ScPhyloExpressionSet) |
method |
Character string specifying the dimensionality reduction method: "PCA" or "UMAP" (default: "PCA") |
colour_by |
Character string specifying what to colour by: "identity" (default), "TXI" |
seed |
Integer seed for reproducible UMAP results (default: 42) |
... |
Additional arguments passed to specific methods |
This function performs log1p transformation on expression data, removes genes with zero variance, and applies the specified dimensionality reduction method. Samples are coloured by their group assignments or TAI values.
A ggplot2 object showing the sample space visualisation
# Create PCA plot coloured by identity
pca_plot <- plot_sample_space(example_phyex_set, method = "PCA", colour_by = "identity")
# Create UMAP plot coloured by TXI
if (requireNamespace("uwot", quietly = TRUE)) {
umap_plot <- plot_sample_space(example_phyex_set, method = "UMAP", colour_by = "TXI")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.