Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

we should just make our own clusterProfiler plotting function #2

Open
andrewejaffe opened this issue Mar 5, 2019 · 0 comments
Open

Comments

@andrewejaffe
Copy link
Collaborator

there's been a bit of instability with returning NAs in the clusters using dotplot....something like the below almost completely reproduces their plotting. i think this would be useful 1) so we start with data frames, 2) so we can also more easily pick gene sets to highlight in figures (which is super hard now) and 3) so we can add newline breaks in super long descriptions

library(ggplot2)
library(jaffelab)
library(DOSE)
load("/dcl02/lieber/ptsd/RNAseq/VA_PTSD_RNAseq/rdas/geneSet_threeGroups_qSVA_BasoAmyg_onlyPTSD_q0.2.rda")
d = as.data.frame(go_basoamyg)

## write code to add newline breaks to long descriptions as a new variable...ie find a space to add a newline for every N characters

## make the ratio numeric
d$GeneProp = as.numeric(ss(d$GeneRatio, "/"))/as.numeric(ss(d$GeneRatio, "/",2))

## you can filter way easier
dd = d[d$p.adjust < 0.05,]

## and plot
ggplot(dd, aes(x=Cluster, y=Description)) +
    geom_point(aes(size = GeneProp, color = p.adjust)) +
    scale_colour_gradient(limits=c(0, max(dd$p.adjust)), low="red",high="blue") +
    theme_dose() + ylab(NULL)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants