Skip to content

Instantly share code, notes, and snippets.

@mbk0asis
Last active September 1, 2015 04:15
Show Gist options
  • Save mbk0asis/44c6b54ae477fd1f2767 to your computer and use it in GitHub Desktop.
Save mbk0asis/44c6b54ae477fd1f2767 to your computer and use it in GitHub Desktop.
library(ggplot2)
All <- read.csv("~/00-NGS/RNAseq/bov/niceM/Sham_Corrected/TopHat_UMD3.1_NCBI/log10_log2_mean.csv")
colnames(All) = c("chr","MI","MN","FI","FN",
"log10_MN_MI","log10_FI_MI","log10_FN_MI",
"log2_MN_MI","log2_FI_MI","log2_FN_MI")
head(All)
# set chr in natural order
All$chr <- factor(All$chr,
levels=c("1","2","3","4","5","6","7","8","9","10",
"11","12","13","14","15","16","17","18","19","20",
"21","22","23","24","25","26","27","28","29","X"))
# draw jitter plots
ggplot(All,aes(x=chr,y=log10_MN.MI))
+ geom_jitter(alpha=0.5, position=position_jitter(width=0.35)), aes(color=chr), size=2)
#+ geom_boxplot() # if you want to overlap with boxplots
# overlyed jitter plot
ggplot(All,aes(x=chr,y=log10_FI.MI))+guides(colour=FALSE)+ylim(c(-1.5,1.5))
+geom_jitter(alpha=1,size=2,position=position_jitter(width=0.4),aes(color="blue"))
+geom_jitter(data=All,aes(x=chr,y=log10_FN.MI,color="red"),alpha=0.5,size=2,position=position_jitter(width=0.4))
+geom_jitter(data=All,aes(x=chr,y=log10_MN.MI),alpha=0.5,size=2,position=position_jitter(width=0.4))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment