plot_factor_scores: plot_factor_scores

Description Usage Arguments Examples

View source: R/plot_factor_scores.R

Description

Plot the matrix of factor scores as an interactive heatmap. The user will be able to identify which groups of observations strongly influence a particular factor. If that group of observations share a common variable value, this may indicate potential confounding of the differential expression study.

Usage

1
plot_factor_scores(fi_mat, num_factors = NULL)

Arguments

fi_mat

Full matrix of factor scores for the observations.

num_factors

An optional parameter specifying the topmost number of factors to subset for visualization.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# Using tcga_metadata from package.
library(MetaConIdentifier)
ca_info <- run_ca(tcga_meta_clean)

# Plot the matrix of factor scores as a heatmap to visualize which
# groups of observations are contributing the most to each factor.

# Example 1: Plot all factors.
plot_factor_scores(ca_info$fi_mat)

# Example 2: Plot a subset of factors by using the return value from
# identify_elbow().
num_factors <- identify_elbow(ca_info$fi_var)
plot_factor_scores(ca_info$fi_mat, num_factors)

ahnjedid/MetaConIdentifier documentation built on Dec. 18, 2021, 11:26 p.m.