The function displays the loadings plot and returns invisible a list of the plot,
the data.frame of the PCA loadings.
Arguments
pca_res
A result returned from plot_pca()
PC
Number of the principal component to plot
square
Whether to plot squared loadings. The squared loading is equal to the fraction of variance explained by the respective feature in the given principal component.
color_by
Variable (column in pca_res$loadings) to color points by. Can also be 'pc_sign' to color by the sign of the loading (useful in combination with the square = TRUE parameter).
annotate_top_n
Annotate the top n features with positive or negative loading
highlight_genes
Vector of gene names or gene IDs to highlight on the plot (overwrites top_n annotation)