require(plyr)
## Loading required package: plyr
require(ggplot2)
## Loading required package: ggplot2
setwd("~/Deletion_Series")
data <- read.delim("DS_R.csv", head =T)
head(data)
## CONSTRUCT BS M avgBS avgM PANEL
## 1 p35S:1-240bpCgNADME1AS 30 10 75.00 25.00 BEN
## 2 p35S:1-240bpCgNADME1AS 42 7 85.71 14.29 BEN
## 3 p35S:1-240bpCgNADME1AS 61 14 81.33 18.67 BEN
## 4 p35S:1-240bpCgNADME1AS 133 31 81.10 18.90 BEN
## 5 p35S:1-240bpCgNADME1AS 34 6 85.00 15.00 BEN
## 6 p35S:1-240bpCgNADME1AS 44 16 73.33 26.67 BEN
summary(data)
## CONSTRUCT BS M
## p35S:1-240bpCgNADME1AS : 12 Min. : 4.0 Min. : 1.0
## p35S:uidA : 9 1st Qu.: 21.0 1st Qu.: 8.0
## p35S:1-141bpCgNADME1 : 8 Median : 31.0 Median :17.0
## p35S:Cg1-162bpCgNADME1(GATCC-): 7 Mean : 37.9 Mean :20.8
## p35S:I-413bp-II : 7 3rd Qu.: 46.0 3rd Qu.:29.0
## 925-240bp : 6 Max. :154.0 Max. :88.0
## (Other) :127
## avgBS avgM PANEL
## Min. :32.6 Min. : 2.58 BEN :12
## 1st Qu.:51.4 1st Qu.:22.25 DS :59
## Median :68.0 Median :32.09 MDH : 2
## Mean :65.7 Mean :34.35 OTHERS :33
## 3rd Qu.:77.8 3rd Qu.:48.61 SUFFIENCY:33
## Max. :97.4 Max. :67.35 TOPOLOGY :37
##
Calculate Means and Standard Deviations
data <- ddply(data, .(CONSTRUCT),
transform, BSm = mean(avgBS),
Mm = mean(avgM),
SD = sd(avgBS))
#Remove BS, M avgBS and avgM columns and keep unique rows only (For PLOTS SAKE!)
data <-data[,c(-2:-5)]
data <-unique(data)
head(data)
## CONSTRUCT PANEL BSm Mm SD
## 1 925-240bp OTHERS 72.99 27.01 5.317
## 7 p35S:112-240bpCgNADME1 DS 47.98 52.02 8.302
## 9 p35S:1-141bpCgNADME1 DS 44.36 55.64 8.371
## 17 p35S:1-162bpCgNADME1 DS 71.16 28.84 3.675
## 22 p35S:1-216bpCgNADME1 DS 70.44 29.56 2.237
## 25 p35S:1-240bpCgNADME1 DS 74.90 25.10 6.014
BS <-data[,c(1,2,3,5)]
colnames(BS) <-c("CONSTRUCT","PANEL","PERCENTAGE","SD")
M <-data[,c(1,2,4,5)]
colnames(M) <-c("CONSTRUCT","PANEL","PERCENTAGE", "SD")
BS["cell"]<- "BS"
M["cell"]<- "M"
data <-rbind(BS, M)
summary(data)
## CONSTRUCT PANEL PERCENTAGE
## 925-240bp : 2 BEN : 2 Min. :15.4
## p35S:112-240bpCgNADME1 : 2 DS :24 1st Qu.:29.0
## p35S:1-141bpCgNADME1 : 2 MDH : 2 Median :50.0
## p35S:1-162bpCgNADME1 : 2 OTHERS :24 Mean :50.1
## p35S:1-216bpCgNADME1 : 2 SUFFIENCY:14 3rd Qu.:71.0
## p35S:1-240bpCgNADME1 : 2 TOPOLOGY :16 Max. :84.6
## (Other) :70
## SD cell
## Min. : 0.832 Length:82
## 1st Qu.: 3.411 Class :character
## Median : 5.184 Mode :character
## Mean : 5.156
## 3rd Qu.: 7.186
## Max. :13.379
## NA's :14
Separate and plot each dataset
BEN <- subset(data, PANEL=="BEN")
limits <- aes(ymax = data$PERCENTAGE + data$SD, ymin=data$PERCENTAGE - data$SD)
dodge <- position_dodge(width=0.9)
barp_BEN <-ggplot(BEN, aes(x= cell, y = PERCENTAGE, ymin=PERCENTAGE -SD, ymax=PERCENTAGE+SD)) +
geom_bar(stat="identity", fill="darkorange4", colour="white") +
theme_classic()+
geom_errorbar(width=0.25)+
theme(strip.background = element_rect(fill = "white", colour="white"))+
theme(strip.text.x = element_text(face = c("italic"), size = 15, hjust = 0.2, vjust = 0.1, ))+
facet_wrap(~ CONSTRUCT , scales="free" ) +
ylab ("Cells with GUS (%)") +
theme( axis.title.x = element_blank()) +
theme(aspect.ratio=0.5) +
ylim(0, 100)
1-240 Antisense Construct
barp_BEN
DS <- subset(data, PANEL=="DS")
DS <- DS[order(DS$CONSTRUCT),]
DS <-DS[c(23,24,9,10,7,
8,5,6,3,4,17,
18,19,20,15,
16,21,22),]
DS$CONSTRUCT <- c("p35S:uidA ","p35S:uidA ",
"p35S:1-240bpCgNADME1","p35S:1-240bpCgNADME1",
"p35S:1-216bpCgNADME1","p35S:1-216bpCgNADME1",
"p35S:1-162bpCgNADME1","p35S:1-162bpCgNADME1",
"p35S:1-141bpCgNADME1","p35S:1-141bpCgNADME1",
"p35S:25-240bpCgNADME1","p35S:25-240bpCgNADME1",
"p35S:79-240bpCgNADME1","p35S:79-240bpCgNADME1",
"p35S:25-162bpCgNADME1","p35S:25-162bpCgNADME1",
"p35S:82-177bpCgNADME1","p35S:82-177bpCgNADME1")
DS$CONSTRUCT <- factor(DS$CONSTRUCT, levels = c("p35S:uidA ",
"p35S:1-240bpCgNADME1",
"p35S:1-216bpCgNADME1",
"p35S:1-162bpCgNADME1",
"p35S:1-141bpCgNADME1",
"p35S:25-240bpCgNADME1",
"p35S:79-240bpCgNADME1",
"p35S:82-177bpCgNADME1",
"p35S:25-162bpCgNADME1"))
limits <- aes(ymax = data$PERCENTAGE + data$SD, ymin=data$PERCENTAGE - data$SD)
dodge <- position_dodge(width=0.9)
barp <-ggplot(DS, aes(x= cell, y = PERCENTAGE, ymin=PERCENTAGE -SD, ymax=PERCENTAGE+SD)) +
geom_bar(stat="identity", fill="goldenrod3", colour="white") +
theme_classic()+
geom_errorbar(width=0.25)+
theme(strip.background = element_rect(fill = "white", colour="white"))+
theme(strip.text.x = element_text(face = c("italic"), size = 10, hjust = 0.2, vjust = 0.1, ))+
facet_wrap(~ CONSTRUCT , scales="free" ) +
ylab ("Cells with GUS (%)") +
theme( axis.title.x = element_blank()) +
theme(aspect.ratio=0.5) +
ylim(0, 100)
Deletion Series
barp
SUFFICIENCY <- subset(data, PANEL=="SUFFIENCY")
SUFFICIENCY <- SUFFICIENCY[order(SUFFICIENCY$CONSTRUCT),]
SUFFICIENCY <- SUFFICIENCY[c(1,2,7,8,9,10,11,12),]
SUFFICIENCY$CONSTRUCT <- c("p35S:63-162bpCgNADME1","p35S:63-162bpCgNADME1",
"p35S:MOSDEF","p35S:MOSDEF",
"p35S:MOSDEF(-I)","p35S:MOSDEF(-I)",
"p35S:MOSDEF(-II)","p35S:MOSDEF(-II)")
SUFFICIENCY$CONSTRUCT <- factor(SUFFICIENCY$CONSTRUCT,
levels = c("p35S:63-162bpCgNADME1",
"p35S:MOSDEF",
"p35S:MOSDEF(-I)",
"p35S:MOSDEF(-II)"))
limits <- aes(ymax = data$PERCENTAGE + data$SD, ymin=data$PERCENTAGE - data$SD)
dodge <- position_dodge(width=0.9)
barp_SUFFICIENCY <-ggplot(SUFFICIENCY, aes(x= cell, y = PERCENTAGE, ymin=PERCENTAGE -SD, ymax=PERCENTAGE+SD)) +
geom_bar(stat="identity", fill="firebrick4", colour="white") +
theme_classic()+
geom_errorbar(width=0.25)+
theme(strip.background = element_rect(fill = "white", colour="white"))+
theme(strip.text.x = element_text(face = c("italic"), size = 12, hjust = 0.2, vjust = 0.1, ))+
facet_wrap(~ CONSTRUCT , scales="free" ) +
ylab ("Cells with GUS (%)") +
theme( axis.title.x = element_blank()) +
theme(aspect.ratio=0.5) +
ylim(0, 100)
Plot Sufficiency
barp_SUFFICIENCY
TOPOLOGY <- subset(data, PANEL=="TOPOLOGY")
TOPOLOGY <- TOPOLOGY[order(TOPOLOGY$CONSTRUCT),]
TOPOLOGY <- TOPOLOGY[c(-5,-6),]
TOPOLOGY$CONSTRUCT <- c( "p35S:gfp:I-75bp-II","p35S:gfp:I-75bp-II",
"p35S:I-21bp-II","p35S:I-21bp-II",
"p35S:I-240bp-II","p35S:I-240bp-II",
"p35S:I-347bp-II","p35S:I-347bp-II",
"p35S:I-413bp-II", "p35S:I-413bp-II",
"p35S:I-999bp-II","p35S:I-999bp-II",
"p35S:I-II","p35S:I-II")
TOPOLOGY$CONSTRUCT <- factor(TOPOLOGY$CONSTRUCT,
levels = c("p35S:I-II",
"p35S:I-21bp-II",
"p35S:I-240bp-II",
"p35S:I-347bp-II",
"p35S:I-413bp-II",
"p35S:I-999bp-II",
"p35S:gfp:I-75bp-II"))
limits <- aes(ymax = data$PERCENTAGE + data$SD, ymin=data$PERCENTAGE - data$SD)
dodge <- position_dodge(width=0.9)
barp_TOPOLOGY <-ggplot(TOPOLOGY, aes(x= cell, y = PERCENTAGE, ymin=PERCENTAGE -SD, ymax=PERCENTAGE+SD)) +
geom_bar(stat="identity", fill="darkseagreen4", colour="white") +
theme_classic()+
geom_errorbar(width=0.25)+
theme(strip.background = element_rect(fill = "white", colour="white"))+
theme(strip.text.x = element_text(face = c("italic"), size = 11, hjust = 0.2, vjust = 0.1, ))+
facet_wrap(~ CONSTRUCT , scales="free" ) +
ylab ("Cells with GUS (%)") +
theme( axis.title.x = element_blank()) +
theme(aspect.ratio=0.5) +
ylim(0, 100)
Plot Topology
barp_TOPOLOGY
OTHERS <- subset(data, PANEL=="OTHERS")
OTHERS <-OTHERS[order(OTHERS$CONSTRUCT),]
OTHERS <- OTHERS[c(-1:-2),]
OTHERS$CONSTRUCT <- c( "p35S:At100-168bpNADME1","p35S:At100-168bpNADME1",
"p35S:At1-240bpNADME1","p35S:At1-240bpNADME1",
"p35S:At16-140bpNADME2","p35S:At16-140bpNADME2",
"p35S:At4-131bpNADME2","p35S:At4-131bpNADME2",
"p35S:At4-140bpNADME2","p35S:At4-140bpNADME2",
"p35S:At90-159bpNADME1", "p35S:At90-159bpNADME1",
"p35S:At90-168bpNADME1","p35S:At90-168bpNADME1",
"p35S:Cg1-240bpNADME2","p35S:Cg1-240bpNADME2",
"p35S:Cg13-134bpNADME2","p35S:Cg13-134bpNADME2",
"p35S:Cg4-113bpNADME2","p35S:Cg4-113bpNADME2",
"p35S:Cg4-134bpNADME2","p35S:Cg4-134bpNADME2")
OTHERS$CONSTRUCT <- factor(OTHERS$CONSTRUCT,
levels = c("p35S:Cg1-240bpNADME2",
"p35S:Cg4-134bpNADME2",
"p35S:Cg4-113bpNADME2",
"p35S:Cg13-134bpNADME2",
"p35S:At1-240bpNADME1",
"p35S:At90-168bpNADME1",
"p35S:At90-159bpNADME1",
"p35S:At100-168bpNADME1",
"p35S:At4-140bpNADME2",
"p35S:At4-131bpNADME2",
"p35S:At16-140bpNADME2"))
limits <- aes(ymax = data$PERCENTAGE + data$SD, ymin=data$PERCENTAGE - data$SD)
dodge <- position_dodge(width=0.9)
barp_OTHERS <-ggplot(OTHERS, aes(x= cell, y = PERCENTAGE, ymin=PERCENTAGE -SD, ymax=PERCENTAGE+SD)) +
geom_bar(stat="identity", fill="blue4", colour="white") +
theme_classic()+
geom_errorbar(width=0.25)+
theme(strip.background = element_rect(fill = "white", colour="white"))+
theme(strip.text.x = element_text(face = c("italic"), size = 10, hjust = 0.2, vjust = 0.1, ))+
facet_wrap(~ CONSTRUCT , scales="free" ) +
ylab ("Cells with GUS (%)") +
theme( axis.title.x = element_blank()) +
theme(aspect.ratio=0.5) +
ylim(0, 100)
Plot other NAD-MEs
barp_OTHERS
MDH <- subset(data, PANEL=="MDH")
limits <- aes(ymax = data$PERCENTAGE + data$SD, ymin=data$PERCENTAGE - data$SD)
dodge <- position_dodge(width=0.9)
barp_MDH <-ggplot(MDH, aes(x= cell, y = PERCENTAGE, ymin=PERCENTAGE -SD, ymax=PERCENTAGE+SD)) +
geom_bar(stat="identity", fill="khaki4", colour="white") +
theme_classic()+
geom_errorbar(width=0.25)+
theme(strip.background = element_rect(fill = "white", colour="white"))+
theme(strip.text.x = element_text(face = c("italic"), size = 15, hjust = 0.2, vjust = 0.1, ))+
facet_wrap(~ CONSTRUCT , scales="free" ) +
ylab ("Cells with GUS (%)") +
theme( axis.title.x = element_blank()) +
theme(aspect.ratio=0.5) +
ylim(0, 100)
Barplot_MDH
barp_MDH