I am a beginner in rstudio and interested to obtain the adjusted p values and save it as .csv file for a set of manually selected genes from single cell RNA seq data using the below code.
tumor.plot = melt(tumor.dat,id.vars="condition",variable.name="Gene",value.name="data")%>%
ggplot(aes(x=condition,y=data,fill=condition))+geom_violin()+facet_wrap(~Gene,scales = "free_y",ncol=4)+
stat_pwc(method = "wilcox.test",label="{p.adj.format}{p.adj.signif}",hide.ns = T,
label.size = 3.25,p.adjust.method ="fdr")+theme_cowplot()+
theme(axis.text.x.bottom = element_text(angle=45,hjust = 1))+
labs(x = "Condition", y = "Log-Normalized Counts",fill="Condition")
I get the violin plots with the significance in the plot
I tried to run stat_pwc function separately but did not work
New contributor
SSIL is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.