@@ -88,9 +88,9 @@ plotPCA <- function(se, count.data, group.variable) {
8888 p <- ggplot2 :: ggplot(plotData , ggplot2 :: aes(x = PC1 , y = PC2 )) +
8989 ggplot2 :: geom_point(ggplot2 :: aes(col = groupVar )) +
9090 ggplot2 :: ylab(paste0(" PC2 (" ,
91- round(pca_result $ sdev [2 ] / sum(pca_result $ sdev ) * 100 , 1 ), " %)" )) +
91+ round(pca_result $ sdev [2 ]^ 2 / sum(pca_result $ sdev ^ 2 ) * 100 , 1 ), " %)" )) +
9292 ggplot2 :: xlab(paste0(" PC1 (" ,
93- round(pca_result $ sdev [1 ] / sum(pca_result $ sdev ) * 100 , 1 ), " %)" )) +
93+ round(pca_result $ sdev [1 ]^ 2 / sum(pca_result $ sdev ^ 2 ) * 100 , 1 ), " %)" )) +
9494 ggplot2 :: theme_minimal()
9595 } else {
9696 pca_result <- prcomp(t(as.matrix(count.data )))
@@ -99,9 +99,9 @@ plotPCA <- function(se, count.data, group.variable) {
9999 p <- ggplot2 :: ggplot(plotData , ggplot2 :: aes(x = PC1 , y = PC2 )) +
100100 ggplot2 :: geom_point(ggplot2 :: aes(col = runname )) +
101101 ggplot2 :: ylab(paste0(" PC2 (" ,
102- round(pca_result $ sdev [2 ] / sum(pca_result $ sdev ) * 100 , 1 ), " %)" )) +
102+ round(pca_result $ sdev [2 ]^ 2 / sum(pca_result $ sdev ^ 2 ) * 100 , 1 ), " %)" )) +
103103 ggplot2 :: xlab(paste0(" PC1 (" ,
104- round(pca_result $ sdev [1 ] / sum(pca_result $ sdev ) * 100 , 1 ), " %)" )) +
104+ round(pca_result $ sdev [1 ]^ 2 / sum(pca_result $ sdev ^ 2 ) * 100 , 1 ), " %)" )) +
105105 ggplot2 :: theme_minimal()
106106 }
107107 return (p )
@@ -140,4 +140,4 @@ plotHeatmap <- function(se, count.data, group.variable) {
140140 show_row_names = FALSE , column_names_gp = grid :: gpar(fontsize = 9 ))
141141 }
142142 return (p )
143- }
143+ }
0 commit comments