forked from mguiraoortiz/Cohesin_project
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDAPI_Content.R
More file actions
85 lines (73 loc) · 2.92 KB
/
Copy pathDAPI_Content.R
File metadata and controls
85 lines (73 loc) · 2.92 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
library("ggplot2")
library("beeswarm")
n <- c('1', '2', '3','4','5')
# Open and append to new dataframe all intensity measurements for single cells
# Calculate the sum intensity for each cell
# Control
kontrolle<-data.frame()
for (x in n){
a <- 'D:/work/Cohesin_Paper/DAPI_Content/HCT_Kontrolle_Chr4_12_19_00'
b <- x
path <- paste(a,b, sep="")
csvs <- list.files(path=path, pattern="*.csv", full.names=TRUE, recursive=FALSE)
matrix <- data.frame()
for (i in seq_along(csvs)){
f <- read.delim(csvs[i], header=T, sep=",")
sumint <-sum(f$RawIntDen)
sumarea<-sum(f$Area)
cellNr<-paste('Cell_', strsplit(csvs[i], 'Results')[[1]][2], sep='')
series<-paste('Series', x, sep='')
df<-cbind(sumint,sumarea, cellNr, series)
df<-data.frame(df)
matrix<-rbind(matrix, df)
}
kontrolle <- rbind(kontrolle, matrix)
}
# Auxin treatment
auxin<-data.frame()
for (x in n){
a <- 'D:/work/Cohesin_Paper/DAPI_Content/HCT_24hAuxin_Chr4_12_19_00'
b <- x
path <- paste(a,b, sep="")
csvs <- list.files(path=path, pattern="*.csv", full.names=TRUE, recursive=FALSE)
matrix <- data.frame()
for (i in seq_along(csvs)){
f <- read.delim(csvs[i], header=T, sep=",")
sumint <-sum(f$RawIntDen)
sumarea<-sum(f$Area)
cellNr<-paste('Cell_', strsplit(csvs[i], 'Results')[[1]][2], sep='')
series<-paste('Series', x, sep='')
df<-cbind(sumint,sumarea, cellNr, series)
df<-data.frame(df)
matrix<-rbind(matrix, df)
}
auxin <- rbind(auxin, matrix)
}
kontrolle[5]<-"Kontrolle"
colnames(kontrolle)[5]<-'Condition'
auxin[5]<-"Treat_Auxin"
colnames(auxin)[5]<-'Condition'
# Combine and save all measurements
all <- rbind(kontrolle, auxin)
all[1] = as.numeric(as.character(all$sumint))
all[2] = as.numeric(as.character(all$sumarea))
write.csv(all, 'D:/work/Resaved_Colors_Multil/Measurements.csv')
write.csv(auxin, 'D:/work/Resaved_Colors_Multil/Measurements_Auxin.csv')
write.csv(kontrolle, 'D:/work/Resaved_Colors_Multil/Measurements_Kontrolle.csv')
# Test plots
ggplot(data=all[all$Condition=="Auxin",], aes(x = Condition, y=sumint))+
geom_jitter(data=all[all$Condition=="Auxin",], aes(x = Condition, y=sumint),width=0.1)+
geom_jitter(data=all[all$Condition=="Kontrolle",], aes(x = Condition, y=sumint), width=0.1)+
labs(y='Integrated Intensity')+
theme_minimal()
beeswarm(sumint ~ Condition, data = all,
log = FALSE, pch = 16, col = rainbow(8), method = "hex", ylim = c(1000000,100000000),
main = 'beeswarm')
bxplot(sumint ~ Condition, data = all, add = TRUE, width=0.2)
beeswarm(sumint ~ Condition, data = all,
log = FALSE, pch = 16, col = rainbow(8), ylim = c(1000000,200000000),
main = 'beeswarm')
bxplot(sumint ~ Condition, data = all, add = TRUE, width=0.2)
median(all[all$Condition=="Kontrolle",]$sumint)
median(all[all$Condition=="Treat_Auxin",]$sumint)
median(all[all$Condition=="Treat_Auxin",]$sumint)/median(all[all$Condition=="Kontrolle" & all$sumint <20000000,]$sumint)