Skip to content

How to label the points on the graph itself using plot_gsva_pca()? #31

Answered by jgriss
levinhein asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @levinhein,

Thanks a lot for your interest in ReactomeGSA!

You can do this quite easily using standard ggplot2 functions. The following code adds labels on top of the points:

# After you received your GSVA result
plot_gsva_pca(gsva_result) + 
    geom_text(aes(label=sample), 
         nudge_x = 0.005, 
         nudge_y = 0.005, 
         check_overlap = T)

You'll probably have to adapt nudge_x and nudge_y to your result since it's based on the arbitrary PCA units.

Kind regards,
Johannes

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by jgriss
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
help wanted Extra attention is needed
2 participants
Converted from issue

This discussion was converted from issue #19 on July 09, 2021 19:12.