Skip to content

Instantly share code, notes, and snippets.

@mbk0asis
Created December 20, 2017 12:52
Show Gist options
  • Save mbk0asis/3c1858eebaa19a6e953d119545c3db47 to your computer and use it in GitHub Desktop.
Save mbk0asis/3c1858eebaa19a6e953d119545c3db47 to your computer and use it in GitHub Desktop.
library(ggplot2)
library(ggpubr)
setwd("/home/bio0/00-NGS/SETDB1_TCGA")
dta <- read.csv("exp.LUNG.FPKM.EpiStem.ggplot.2.csv", header = F)
colnames(dta) <- c("Gene","Symbol","Sample","FPKM","Group")
names(dta)
dta2 <- dta[grep("DNMT1", dta$Symbol), ]
dta2$Group<-factor(dta2$Group, levels = c("Gain.Tumor",
"Dipl.Tumor",
"Dipl.Normal",
"Loss.Tumor"))
my_comparisons <- list(c("Gain.Tumor","Dipl.Tumor"),
c("Dipl.Tumor","Dipl.Normal"),
c("Loss.Tumor","Dipl.Normal"),
c("Gain.Tumor","Dipl.Normal"),
c("Gain.Tumor","Loss.Tumor"),
c("Loss.Tumor","Dipl.Tumor"))
q <- ggplot(dta2, aes(x=Group,y=log10(1+FPKM),group=Group))
q + geom_jitter(alpha=0.6,width=0.3, aes(fill=Gene)) + ggtitle("DNMT1") +
geom_violin(alpha=0.6,scale="width",aes(fill=Group)) +
#geom_boxplot(width=.5, outlier.shape = NA) +
stat_compare_means(comparisons = my_comparisons) + guides(fill=FALSE)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment