This file contains scripts for the phenotypic data for ptcRNAi, CG8177, Nhe2 Overexpression, as well as the code for generating the plots for the smoothend GFP quantifications.
setwd("~/Box Sync/Ulmschneider manuscript/final_plots_with_scripts")
library(ggplot2)
## Warning: package 'ggplot2' was built under R version 3.1.3
library(plyr)
## Warning: package 'plyr' was built under R version 3.1.3
library(reshape2)
## Warning: package 'reshape2' was built under R version 3.1.2
source("commonPlots.R")
norm1= read.csv("CG8177_UASNhe2/160417_normpercentincrease_328rm.csv")
norm2= read.csv("CG8177_UASNhe2/160416_normpercentincrease.csv")
norm1$genotype = factor(norm1$genotype,levels(norm1$genotype)[c(6,2,1,4,5,3)])
norm2$genotype = factor(norm2$genotype,levels(norm2$genotype)[c(6,2,1,4,5,3)])
Making 2 versions of the CG8177 + Nhe2OE data
p1 = ggplot(norm1, aes(x=genotype, y=raw ))
p2 = ggplot(norm2, aes(genotype, y = raw ))
errorBarCrossHatch(p1)
errorBarCrossHatch(p2)
Making Figure for Nhe2 eya+ or eya-
nhe2=read.csv("Nhe2KD/160418_Nhe2KD_all.csv")
nhe2$name = factor(nhe2$name,levels(nhe2$name)[c(6,3,1,5,2,4)])
Making Nhe2 KD plot
p3 = ggplot(nhe2, aes(x= name, y = freq ))
errorBarCrossHatch(p3) + scale_y_continuous(breaks = seq(from = 0, to =1, by =.1), limits = c(-0.1,1))
Making ptcRNAi with Nhe2overexpression plot
ptc = read.csv("ptcRNAi/ptc_28795_withOE.csv")
ptc$name = factor(ptc$name, levels(ptc$name)[c(1,3,2)])
p4 = ggplot(ptc, aes(x = name, y = freqDouble ))
p4 = p4 + stat_summary(fun.data=mean_sdl, mult = 1, geom= "errorbar", color="black", size = 2, width = .6) +
stat_summary(fun.y = mean, geom = "point", colour = "black", pch = "_", size = 25) +
geom_dotplot(binaxis='y', stackdir='center', fill = "grey50", colour = "grey50")
addtheme(p4)
This is for plotting the weak ptc RNAi data
ptcN2 = read.csv("ptcRNAi/ptc28795_withNhe2RNAi.csv")
p5 = ggplot(ptcN2, aes(x= genotype, y = freqPhen)) + stat_summary(fun.data=mean_sdl, mult = 1, geom= "errorbar", color="black", size = 2, width = .3) +
stat_summary(fun.y = mean, geom = "point", colour = "black", pch = "_", size = 25) +
geom_dotplot(binaxis='y', stackdir='center', fill = "grey50", colour = "grey50")
addtheme(p5)
This is for the chi-squared test to test differences between the weak ptc RNAi line and weak ptcRNAi + Nhe2 knockdown with TRIP RNAi
ptcW = c(82, 165)
ptcN2 = c(74, 131)
tbl = rbind(ptcW, ptcN2)
chisq.test(tbl)
##
## Pearson's Chi-squared test with Yates' continuity correction
##
## data: tbl
## X-squared = 0.2982, df = 1, p-value = 0.585
fisher.test(tbl)
##
## Fisher's Exact Test for Count Data
##
## data: tbl
## p-value = 0.5516
## alternative hypothesis: true odds ratio is not equal to 1
## 95 percent confidence interval:
## 0.5853005 1.3236238
## sample estimates:
## odds ratio
## 0.8800226
Making a plot that includes the Nhe2RNAi data
ptcAll = read.csv("ptcRNAi/ptc_28795_withOEandNhe2RNAi.csv")
ptcAll$name = factor(ptcAll$name, levels(ptcAll$name)[c(1,4,3,2)])
p5 = ggplot(ptcAll, aes(x= name, y = freqDouble))
errorBarCrossHatch(p5)
Making a plot for ptc(strong data )
ptcst = read.csv("ptcRNAi/ptc55685_all.csv")
ptcst$genotype = factor(ptcst$genotype, levels(ptcst$genotype)[c(1,3,4,2)])
pSt = ggplot(ptcst, aes(x= genotype, y = totPhen))
errorBarCrossHatch(pSt)
UASsmoGFP data - boxplots Boxplot for UASsmoGFP region quants
d2 = read.csv("smoGFP/160325_region_quants.csv")
p2 = ggplot(d2, aes(x= region, y = GFP))
p2 + geom_boxplot(aes(fill = region), width = 0.7, lwd = 1.5, fatten = .9, colour = "black") + theme_classic() + theme(axis.text = element_text(size = 15), line = element_line(size = 2, colour = "black")) + scale_fill_grey(start = 1, end = 0.4) + scale_y_continuous(breaks = c(0, 25, 50, 75, 100), limits = c(0,100))
Reading in data for UASsmoGFP by region data
d = read.csv("smoGFP/uasSmoGFP.csv")
d$genotype = factor(d$genotype,levels(d$genotype)[c(1,3,2)])
p = ggplot(d, aes(x = genotype, y = Mean ))
Boxplot for UASsmoGFP
p + geom_boxplot(aes(fill = genotype), width = 0.8, lwd = 1.5, fatten = .9, colour = "black") + theme_classic() + theme(axis.text = element_text(size = 15), line = element_line(size = 2, colour = "black")) + scale_fill_grey(start = 1, end = 0.4) + scale_y_continuous(breaks= c(0, 25, 50, 75, 100), limits = c(0, 100))
## Warning in loop_apply(n, do.ply): Removed 1 rows containing non-finite
## values (stat_boxplot).