Including Plots

options(warn = -1)
library(ggplot2)

#设置工作目录
setwd("D:/RData/violin/hg19_exac")
dat = read.table("Mut.txt", header = T, sep = "\t")
mydat = dat[dat$muteType=="LOF",]
ggplot(mydat, aes(class, ratio, fill = class))+
  geom_violin()+
  geom_boxplot(width=.05, fill="black", outlier.colour=NA) +
  stat_summary(fun.y=median, geom="point", fill="white", shape=21, size=2.5)+
  scale_y_continuous(limits=c(0,1))+
  scale_x_discrete(limits=c("background","le50", "gt50_le80", "gt80", "Control"))+
  theme(axis.title = element_blank(),
        axis.text = element_text(size = 14,color = "black"),
        axis.text.x = element_text(angle=45, hjust=1),
        axis.ticks = element_line(colour = "black"),
        legend.position = "none",
        panel.grid = element_blank(),
        panel.background = element_rect(fill = "white",colour = "black"))