A helper function draws biplot, screen and matrix plots for PCA results

.biplot(res.pca, df, sample_type, column_name, color, folder)

Arguments

res.pca

PCA results from selected RNAseq data

df

selected RNAseq data with sample type annotation

sample_type

selected sample types for plot label

column_name

column name of annotation of primary diseases or healthy tissues for color of individuals

color

color scheme used for individual sample on the PCA

folder

sub directory name to store the output files

Details

This function

It should not be used directly, only inside .plot_PCA_TCGA_GTEX(), .plot_PCA_TCGA_GTEX_tumor(), or .plot_PCA_CPTAC_LUAD() function.

Side effects:

(1) PCA biplots (PCA score plot + loading plot) on screen and as pdf files: PCA score plot shows the clusters of samples based on their similarity and loading plot shows how strongly each characteristic influences a principal component. (2) matrix plots on screen and as pdf files to show the quality of representation of the variables. (3) scree plots on screen and as pdf files to display how much variation each principal component captures from the data.

See also

Other helper function for PCA plotting: .biplot_title(), .selected_biplot()

Examples

if (FALSE) {
.biplot(
  res.pca = .RNAseq_PCA(df[[1]], 10), df = df[[2]],
  sample_type = "Metastatic Tumor (TCGA)",
  y = "primary.disease", color = col_vector, folder = "TCGA"
)
}