A helper function draws biplots of selected PCA results from TCGA and GTEX combined data.
.selected_biplot(res.pca, df, sample_type, column_name, color)
PCA results from from TCGA and GTEX combined RNAseq data
combined RNAseq data with sample type annotation
sample types for plot labeling
column name of annotation of primary diseases or healthy tissues for color of individuals
color scheme used for individual sample on the PCA
sub directory name to store the output files
This function
uses RNAseq data generated from .get_df_subset(.TCGA_GTEX_sampletype_subset, "All")
for PCA
calls .biplot_title()
to generate plot title using the input argument
sample_type
It should not be used directly, only inside .plot_PCA_TCGA_GTEX()
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.
Other helper function for PCA plotting:
.biplot_title()
,
.biplot()
if (FALSE) {
.selected_biplot(
res.pca = .RNAseq_PCA(df[[1]], 10), df = df[[2]],
x = "Healthy Tissue (GTEx)", y = "sample.type", color = "#D55E00"
)
.selected_biplot(
res.pca = .RNAseq_PCA(df[[1]], 10), df = df[[2]],
x = "Healthy Tissue (GTEx)", y = "primary.site", color = col_vector
)
}