Commit a3e6801d authored by Antonio Politi's avatar Antonio Politi

Plotting function R

parent 067d60d4
# ----
library("ggplot2")
if (Sys.info()['sysname'] == 'Darwin'){
setwd('/Users/toni/Dropbox/NPCMaturation/results/emdata/delay')
} else {
setwd('C:\\Users\\toni\\Dropbox\\NPCMaturation\\results\\emdata\\delay')
}
inData = list()
fname <- 'delayedMaturation_v0.015_ts10_den.txt'
tmpCsv = read.csv(fname, skip=0, sep='\t')
tmpCsv['dtauM'] = 0
tmpCsv['idx'] = 6
inData = rbind(inData, tmpCsv)
delay = c(5,10,15, 20, 30)
for (idx in seq(1,length(delay),1)) {
fname <- paste(c('delayedMaturationDistrubutedDelay_ts10_v0.015_dtau', as.character(delay[idx]), '_den.txt'), collapse = '')
tmpCsv = read.csv(fname, skip=0, sep='\t')
tmpCsv['dtauM'] = delay[idx]
tmpCsv['idx'] = length(delay)-idx
inData = rbind(inData, tmpCsv)
}
# -----
addOpt <- function(p) {
p <- p + xlab(' Time after AO (min)') + ylab(expression(paste("Density (pores/", mu, m^2, ")"))) +
scale_x_continuous(expand = c(0, 0), limits = c(0,120), breaks=seq(0,120,20)) +
scale_y_continuous(expand = c(0, 0), limits = c(0, 13), breaks=seq(0,13,4)) +
theme_classic(base_size = 8) +
theme(legend.position = 'none', axis.line.x = element_line(color="black", size = 0.5),
axis.line.y = element_line(color="black", size = 0.5)) +
theme(axis.text.x = element_text(size=8),
axis.text.y = element_text(size=8),
plot.margin = unit(c(5,5,0,0), "mm"))
return(p)
}
# ----
pint <- ggplot(data = inData) + geom_line(data = inData, aes(time, inter_i, group = idx, colour = -idx)) +
geom_line(data = inData, aes(time, mature_i, group = idx, colour = idx))
#pmat <- ggplot(data = inData) +
# geom_line(aes(time, mature_i, group = N+200, colour = N+200))
pint <- addOpt(pint) + scale_color_gradient2(midpoint = 0, low="red", mid = "gray", high="blue")
#pint <- addOpt(pint) + scale_color_gradient2(midpoint = 0,space='Lab', low="black", mid = "gray", high="black")
pint
if (Sys.info()['sysname'] == 'Darwin'){
setwd('/Users/toni/Dropbox/NPCMaturation/results/emdata/figures')
} else {
setwd('C:\\Users\\toni\\Dropbox\\NPCMaturation\\results\\emdata\\figures')
}
ggsave(filename="inner_distributedDelay.pdf", plot=pint, width = 71, height = 44, units = 'mm')
gp <- ggplot_build(pint)
cp <- unique(gp$data[[1]]["colour"])
# -----
cols = c("#BEBEBE", "#9B9B9B", "#7A7A7A", "#5B5B5B", "#3D3D3D", "#000000")
dtauM_distr = c(0.1, 5, 10, 15, 20, 30)
times = seq(20, 60, 0.1)
distr = list()
for (dtau in dtauM_distr){
distrloc = data.frame(time = seq(20,60,0.1), dis =0 , dtauM=0)
distrloc$dis = 1/dtau*(distrloc$time>40-dtau/2)*(distrloc$time<40+dtau/2)
distrloc$dtauM = dtau
distr = rbind(distr, distrloc)
}
distr$dtauM = factor(distr$dtauM, c(0.1, 5, 10, 15, 20, 30))
pdtauM <- ggplot() + geom_line(data = distr, aes(x=time, y = dis, group = dtauM, colour = dtauM)) +
theme_classic(base_size = 8) + xlab('Maturtion time (min)') + scale_colour_manual(values = cols[seq(6,1,-1)]) + ylab('Probability') +
coord_cartesian(ylim= c(0,0.3)) +
theme(legend.position = 'none', axis.line.x = element_line(color="black", size = 0.5),
axis.line.y = element_line(color="black", size = 0.5)) +
theme(axis.text.x = element_text(size=8),
axis.text.y = element_text(size=8),
plot.margin = unit(c(5,5,0,0), "mm"))
pdtauM
ggsave(filename="distributedDelay_dtauM.pdf", plot=pdtauM, width = 72, height = 22, units = 'mm')
library("ggplot2")
# ----
if (Sys.info()['sysname'] == 'Darwin'){
indatadir <-'/Users/toni/Dropbox/NPCMaturation/expdata/emdata'
indir <- '/Users/toni/Dropbox/NPCMaturation/results/emdata/delay'
outdir <- '/Users/toni/Dropbox/NPCMaturation/results/emdata/figures'
} else {
indatadir <- 'C:\\Users\\toni\\Dropbox\\NPCMaturation\\expdata\\emdata'
indir <- 'C:\\Users\\toni\\Dropbox\\NPCMaturation\\results\\emdata\\delay'
outdir <- 'C:\\Users\\toni\\Dropbox\\NPCMaturation\\results\\emdata\\figures'
}
setwd(indir)
inData = list()
fname <- 'delayedMaturation_v0.015_ts10.txt'
tmpCsv = read.csv(fname, skip=6, sep='\t')
idx = which.min(tmpCsv$norm)
concatDF = tmpCsv[idx,]
concatDF['dtauM'] = 0
concatDF['idx'] = 0
inData = rbind(inData, concatDF[,c('idx', 'norm', 'tauM', 'dtauM')])
delay = c(5,10,15,20, 30)
for (idx in seq(1,length(delay),1)) {
fname <- paste(c('delayedMaturationDistrubutedDelay_ts10_v0.015_dtau', as.character(delay[idx]), '.txt'), collapse = '')
tmpCsv = read.csv(fname, skip=6, sep='\t')
idxC = which.min(tmpCsv$norm)
concatDF = tmpCsv[idxC,]
concatDF['idx'] = idx
concatDF['dtauM'] = concatDF['dtauM']/2
inData = rbind(inData, concatDF[,c('idx','norm', 'tauM', 'dtauM')])
}
inData$dtauM = factor(inData$dtauM,levels = c(0, 5, 10,15,20,30)/2)
inData$idx = factor(inData$idx,levels = c(0,1,2,3,4,5))
# ----
cols = c("#BEBEBE", "#9B9B9B", "#7A7A7A", "#5B5B5B", "#3D3D3D", "#000000")
pChi2<- ggplot(inData, aes(x = dtauM, y = norm, fill = idx))+
geom_bar(stat = "identity", position = 'dodge') + coord_cartesian(ylim= c(20,40)) +
theme_classic(base_size = 8) + xlab('Half-width distribution (min)') + ylab('Sum of squared \n residuals') +
theme(legend.position = 'none', axis.line.x = element_line(color="black", size = 0.5),
axis.line.y = element_line(color="black", size = 0.5)) +
theme(axis.text.x = element_blank(),
axis.text.y = element_text(size=8),
plot.margin = unit(c(5,5,0,0), "mm")) + scale_fill_manual(values = cols[seq(6,1,-1)])
pChi2
setwd(outdir)
ggsave(filename="distributedDelay_chi2.pdf", plot=pChi2, width = 71, height = 30, units = 'mm')
# ----
ptaum<- ggplot(inData, aes(x = dtauM, y = tauM, fill = idx)) + geom_bar(stat = "identity", position = 'dodge') +
theme_classic(base_size = 8) + xlab('Half-width distribution (min)') + scale_fill_manual(values = cols[seq(6,1,-1)]) + ylab('Avg. Mat. time (min)\n') +
coord_cartesian(ylim= c(0,50), xlim = c(0.4,6.6), expand = c(0)) +
theme(legend.position = 'none', axis.line.x = element_line(color="black", size = 0.5),
axis.line.y = element_line(color="black", size = 0.5)) +
theme(axis.text.x = element_text(size=8),
axis.text.y = element_text(size=8),
plot.margin = unit(c(5,5,0,0), "mm"))
ptaum
ggsave(filename="distributedDelay_tauM.pdf", plot=ptaum, width = 71, height = 35, units = 'mm')
#----
library("ggplot2")
# ----
if (Sys.info()['sysname'] == 'Darwin'){
setwd('/Users/toni/Dropbox/NPCMaturation/results/emdata/linearChain')
} else {
setwd('C:\\Users\\toni\\Dropbox\\NPCMaturation\\results\\emdata\\linearChain')
}
inData = list()
for (N in c(5, 10, 20, 40, 100)) {
tmpCsv = read.csv(paste(c('linearChainApproximation_N', as.character(N), '_v0.015.txt'), collapse = '')
, skip=6, sep='\t')
tmpCsv['N'] = N
tmpCsv['model'] = 'multi step'
colnames(tmpCsv)[1] <- 'ts'
idx = which.min(tmpCsv$norm)
concatDF = tmpCsv[idx,]
concatDF['tauM'] = (N-1)/concatDF$k
inData = rbind(inData, concatDF[, c('norm', 'N', 'model', 'tauM')])
}
if (Sys.info()['sysname'] == 'Darwin'){
setwd('/Users/toni/Dropbox/NPCMaturation/results/emdata/delay')
} else {
setwd('C:\\Users\\toni\\Dropbox\\NPCMaturation\\results\\emdata\\delay')
}
fname <- 'delayedMaturation_v0.015_ts10.txt'
tmpCsv = read.csv(fname, skip=6, sep='\t')
colnames(tmpCsv)[1] <- 'ts'
colnames(tmpCsv)[3] <- 'k'
idx = which.min(tmpCsv$norm)
concatDF = tmpCsv[idx,]
concatDF['model'] = 'delay'
concatDF['N'] = 'delay'
inData = rbind(inData, concatDF[, c('norm', 'N', 'model', 'tauM')])
inData$N = factor(inData$N,levels = c(5, 10,20,40,100, 'delay'))
# ----
if (Sys.info()['sysname'] == 'Darwin'){
setwd('/Users/toni/Dropbox/NPCMaturation/results/emdata/figures')
} else {
setwd('C:\\Users\\toni\\Dropbox\\NPCMaturation\\results\\emdata\\figures')
}
cols = c("#BEBEBE", "#9B9B9B", "#7A7A7A", "#5B5B5B", "#3D3D3D", "#000000")
pChi2<- ggplot(inData, aes(x = N, y = norm, fill = N)) +
geom_bar(stat = "identity", position = 'dodge') + coord_cartesian(ylim= c(20,40)) +
theme_classic(base_size = 8) + xlab('') + ylab('Sum of squared \n residuals') +
theme(legend.position = 'none', axis.line.x = element_line(color="black", size = 0.5),
axis.line.y = element_line(color="black", size = 0.5)) +
theme(axis.text.x = element_blank(),
axis.text.y = element_text(size=8),
plot.margin = unit(c(5,5,0,0), "mm")) + scale_fill_manual(values = cols)
pChi2
ggsave(filename="linearChain_delay_chi2.pdf", plot=pChi2, width = 71, height = 30, units = 'mm')
# ----
ptaum<- ggplot(inData, aes(x = N, y = tauM, fill = N)) + geom_bar(stat = "identity", position = 'dodge') +
theme_classic(base_size = 8) + xlab('Number of steps (N)') + scale_fill_manual(values = cols) + ylab('Maturation time (min)\n') +
coord_cartesian(ylim= c(0,50), xlim = c(0.4,6.6), expand = c(0)) +
theme(legend.position = 'none', axis.line.x = element_line(color="black", size = 0.5),
axis.line.y = element_line(color="black", size = 0.5)) +
theme(axis.text.x = element_text(size=8),
axis.text.y = element_text(size=8),
plot.margin = unit(c(5,5,0,0), "mm"))
ptaum
ggsave(filename="linearChain_delay_tauM.pdf", plot=ptaum, width = 71, height = 35, units = 'mm')
# ----
library("ggplot2")
if (Sys.info()['sysname'] == 'Darwin'){
setwd('/Users/toni/Dropbox/NPCMaturation/results/emdata/linearChain')
} else {
setwd('C:\\Users\\toni\\Dropbox\\NPCMaturation\\results\\emdata\\linearChain')
}
inData = list()
Nval = c(5,10,20,40,100)
for (idx in c(1,2,3,4,5)) {
fname <- paste(c('linearChainApproximation_N', as.character(Nval[idx]), '_v0.015_den.txt'), collapse = '')
tmpCsv = read.csv(fname, skip=0, sep='\t')
tmpCsv['N'] = Nval[idx]
tmpCsv['id'] = idx-1
inData = rbind(inData, tmpCsv)
}
if (Sys.info()['sysname'] == 'Darwin'){
setwd('/Users/toni/Dropbox/NPCMaturation/results/emdata/delay')
} else {
setwd('C:\\Users\\toni\\Dropbox\\NPCMaturation\\results\\emdata\\delay')
}
fname <- 'delayedMaturation_v0.015_ts10_den.txt'
tmpCsv = read.csv(fname, skip=0, sep='\t')
tmpCsv['N'] = 1000
tmpCsv['id'] = 5
inData = rbind(inData, tmpCsv)
addOpt <- function(p) {
p <- p + xlab(' Time after AO (min)') +ylab(expression(paste("Density (pores/", mu, m^2, ")"))) +
scale_x_continuous(expand = c(0, 0), limits = c(0,120), breaks=seq(0,120,20)) +
scale_y_continuous(expand = c(0, 0), limits = c(0, 13), breaks=seq(0,13,4)) +
theme_classic(base_size = 8) +
theme(legend.position = 'none', axis.line.x = element_line(color="black", size = 0.5),
axis.line.y = element_line(color="black", size = 0.5)) +
theme(axis.text.x = element_text(size=8),
axis.text.y = element_text(size=8),
plot.margin = unit(c(5,5,0,0), "mm"))
return(p)
}
# ----
if (Sys.info()['sysname'] == 'Darwin'){
setwd('/Users/toni/Dropbox/NPCMaturation/results/emdata/figures')
} else {
setwd('C:\\Users\\toni\\Dropbox\\NPCMaturation\\results\\emdata\\figures')
}
pint <- ggplot(data = inData) + geom_line(data = inData, aes(time, inter_i, group = id, colour = -id)) +
geom_line(data = inData, aes(time, mature_i, group = id, colour = id))
#pmat <- ggplot(data = inData) +
# geom_line(aes(time, mature_i, group = N+200, colour = N+200))
pint <- addOpt(pint) + scale_color_gradient2( midpoint = 0, low="red", mid = "gray", high="blue")
pint
ggsave(filename="inner_linearChain_delay.pdf", plot=pint, width = 71, height = 44, units = 'mm')
gp <- ggplot_build(pint)
cp <- unique(gp$data[[1]]["colour"])
# ----
library("ggplot2")
# ------
if (Sys.info()['sysname'] == 'Darwin'){
setwd('/Users/toni/Dropbox/NPCMaturation/results/emdata/delay')
} else {
setwd('C:\\Users\\toni\\Dropbox\\NPCMaturation\\results\\emdata\\delay')
}
fnames = c('delayedMaturation_v0_ts10.txt',
'delayedMaturation_noPrecursor_ts10.txt',
'delayedMaturationExponentialV_noPrecursor_ts10_v0.015.txt',
'delayedMaturation_v0.015_ts10.txt',
'delayedMaturationExponentialV_ts10_v0.015.txt')
#vbasal is kept constant
#nrpar = c(6, 5, 6, 6, 8)
nrpar = c(6, 5, 7, 7, 8)
# fnames = c('delayedMaturation_v0_ts10.txt',
# 'delayedMaturation_noPrecursor_ts10.txt',
# 'delayedMaturationExponentialV_noPrecursor_ts10.txt',
# 'delayedMaturationSteadyRho_noPrecursor_ts10.txt',
# 'delayedMaturation_ts10.txt',
# 'delayedMaturationExponentialV_ts10.txt',
# 'delayedMaturationSteadyRho_ts10.txt')
#
#nrpar = c(6, 5, 7, 6, 7, 9, 8)
varNames = c('Var 1', 'Var 2', 'Var 3', 'Var 1+2', 'Var 1+3')
inData = list()
seq_plot = c(1, 2, 3, 4, 5)
for (i in seq_along(fnames) ) {
tmpCsv = read.csv(fnames[i], skip=6, sep='\t')
tmpCsv['model'] = varNames[i]
tmpCsv['nrpar']= nrpar[i]
idx = which.min(tmpCsv$norm)
inData = rbind(inData, tmpCsv[idx, c('tauM', 'norm', 'model', 'nrpar')])
}
inData$model = factor(inData$model, levels = varNames[seq_plot])
#-----
if (Sys.info()['sysname'] == 'Darwin'){
setwd('/Users/toni/Dropbox/NPCMaturation/results/emdata/figures')
} else {
setwd('C:\\Users\\toni\\Dropbox\\NPCMaturation\\results\\emdata\\figures')
}
pChi2<- ggplot(inData, aes(x = model, y = norm, fill = model)) + geom_bar(stat = "identity") + coord_cartesian(ylim= c(20,55)) +
theme_classic(base_size = 8) + xlab('') + ylab('Sum of squared \n residuals') +
theme(legend.position = 'none', axis.line.x = element_line(color="black", size = 0.5),
axis.line.y = element_line(color="black", size = 0.5)) +
theme(axis.text.x = element_blank(),
axis.text.y = element_text(size=8),
plot.margin = unit(c(5,5,0,0), "mm"))
pChi2
gp <- ggplot_build(pChi2)
cp <- unique(gp$data[[1]]["fill"])
ggsave(filename="production_rates_Chi2.pdf", plot=pChi2, width = 71, height = 30, units = 'mm')
# -----
ptaum<- ggplot(inData, aes(x = model, y = tauM, fill = model)) + geom_bar(stat = "identity") +
coord_cartesian(ylim= c(0,50), expand = c(0), xlim = c(0.4,5.6)) +
theme_classic(base_size = 8) + xlab('') + ylab('Maturation time (min)\n') +
theme(legend.position = 'none', axis.line.x = element_line(color="black", size = 0.5),
axis.line.y = element_line(color="black", size = 0.5)) +
theme(axis.text.x = element_text(size=8, angle = 45, vjust = 0.5),
axis.text.y = element_text(size=8),
plot.margin = unit(c(5,5,0,0), "mm"))
ptaum
ggsave(filename="production_rates_tauM.pdf", plot=ptaum, width = 71, height = 43, units = 'mm')
# ----
testPairs = rbind(c(1,2), c(1,3),c(1,4), c(1,5), c(2,3), c(2,4), c(2,5), c(3,5))
for(i in seq(1,8,1)) {
print(1 - pchisq(abs(inData$norm[testPairs[i,1]]-inData$norm[testPairs[i,2]]),abs(inData$nrpar[testPairs[i,2]]-inData$nrpar[testPairs[i,1]])))
}
#----
#----
if (Sys.info()['sysname'] == 'Darwin'){
setwd('/Users/toni/Dropbox/NPCMaturation/results/emdata/delay')
} else {
setwd('C:\\Users\\toni\\Dropbox\\NPCMaturation\\results\\emdata\\delay')
}
fnames = c('delayedMaturation_v0_ts10_prodrate.txt',
'delayedMaturation_noPrecursor_ts10_prodrate.txt',
'delayedMaturationExponentialV_noPrecursor_ts10_v0.015_prodrate.txt',
'delayedMaturation_v0.015_ts10_prodrate.txt',
'delayedMaturationExponentialV_ts10_v0.015_prodrate.txt')
inData = list()
seq_plot = c(1, 4, 2, 5, 3)
for (i in seq_along(fnames) ) {
tmpCsv = read.csv(fnames[i], skip=0, sep='\t')
tmpCsv['model'] = varNames[i]
if (i== 2 || i == 3 || i==5) {
tmpCsv['ProdDensity_inner'] = tmpCsv['ProdDensity_inner']*0.25
}
inData = rbind(inData, tmpCsv)
}
inData$model = factor(inData$model, levels = varNames[seq_plot])
p <- ggplot(inData, aes(time, ProdDensity_inner, colour = model)) + geom_line(size = 1) + theme_classic(base_size = 8) +
coord_cartesian(ylim = c(0, 0.1), xlim = c(0, 50)) + facet_wrap(~ model, ncol = 2) + xlab('Time after AO (min)') +
ylab('Production density (pores/um2/min)') +
theme(legend.position = 'none',
strip.background = element_blank(), axis.line.y = element_blank(), #element_line(color="black", size = 0.5),
axis.line.x = element_blank(),
strip.text.x = element_text(size = 8, angle = 0),
legend.key = element_blank(),
#axis.text.x = element_blank(),
#axis.text.y = element_blank(),
#axis.ticks.x=element_blank(),
#axis.ticks.y=element_blank(),
plot.margin = unit(c(5,5,0,0), "mm")) + scale_colour_manual(values=cp$fill[seq_plot])
p
if (Sys.info()['sysname'] == 'Darwin'){
setwd('/Users/toni/Dropbox/NPCMaturation/results/emdata/figures')
} else {
setwd('C:\\Users\\toni\\Dropbox\\NPCMaturation\\results\\emdata\\figures')
}
ggsave(filename="production_rates.pdf", plot=p, width = 100, height = 60, units = 'mm')
# ----
# -----
addOpt <- function(p) {
p <- p + xlab(' Time after AO (min)') +
scale_x_continuous(expand = c(0, 0), limits = c(0,120), breaks=seq(0,120,20)) +
scale_y_continuous(expand = c(0, 0), limits = c(0, 13), breaks=seq(0,13,4)) +
theme_classic(base_size = 8) +
theme(legend.position = 'none', axis.line.x = element_line(color="black", size = 0.5),
axis.line.y = element_line(color="black", size = 0.5)) +
theme(axis.text.x = element_text(size=8),
axis.text.y = element_text(size=8),
plot.margin = unit(c(5,5,0,0), "mm"))
return(p)
}
if (Sys.info()['sysname'] == 'Darwin'){
setwd('/Users/toni/Dropbox/NPCMaturation/expdata/emdata')
} else {
setwd('C:\\Users\\toni\\Dropbox\\NPCMaturation\\expdata\\emdata')
}
denData = read.csv('density_innercore.txt', skip=0, sep='\t')
if (Sys.info()['sysname'] == 'Darwin'){
setwd('/Users/toni/Dropbox/NPCMaturation/results/emdata/delay')
} else {
setwd('C:\\Users\\toni\\Dropbox\\NPCMaturation\\results\\emdata\\delay')
}
fnames = c('delayedMaturation_v0_ts10_den.txt',
'delayedMaturation_noPrecursor_ts10_den.txt',
'delayedMaturationExponentialV_noPrecursor_ts10_v0.015_den.txt',
'delayedMaturation_v0.015_ts10_den.txt',
'delayedMaturationExponentialV_ts10_v0.015_den.txt')
varNames = c('Var 1', 'Var 2', 'Var 3', 'Var 1+2', 'Var 1+3')
inData = list()
seq_plot = c(1, 2, 3, 4, 5)
for (i in seq_along(fnames) ) {
tmpCsv = read.csv(fnames[i], skip=0, sep='\t')
tmpCsv['model'] = varNames[i]
tmpCsv['nrpar']= nrpar[i]
inData = rbind(inData, tmpCsv)
}
inData$model = factor(inData$model, levels = varNames[seq_plot])
# ----
pint_inter <- ggplot() + geom_bar(data=denData, stat = 'identity', width = 1.5, aes(time, int_avg, fill = 'red')) +
geom_line(data = inData, size = 0.8, aes(time, inter_i, group = model, colour = model)) + ylab(expression(paste("Intermediate density (pores/", mu, m^2, ")")))
pint_mature <- ggplot() + geom_bar(data=denData, stat = 'identity', width = 2, aes(time, mat_avg, fill = '#1E477E')) +
geom_line(data = inData, size = 0.8, aes(time, mature_i, group = model, colour = model))+ ylab(expression(paste("Mature density (pores/", mu, m^2, ")")))
pint_inter <- addOpt(pint_inter) + scale_fill_manual(values = c('red'))
pint_mature <- addOpt(pint_mature) + scale_fill_manual(values = c('#1E477E'))
pint_inter
pint_mature
if (Sys.info()['sysname'] == 'Darwin'){
setwd('/Users/toni/Dropbox/NPCMaturation/results/emdata/figures')
} else {
setwd('C:\\Users\\toni\\Dropbox\\NPCMaturation\\results\\emdata\\figures')
}
ggsave(filename="prodVariants_inter_inner_den.pdf", plot=pint_inter, width = 71, height = 44, units = 'mm')
ggsave(filename="prodVariants_mature_inner_den.pdf", plot=pint_mature, width = 71, height = 44, units = 'mm')
library("ggplot2")
# ----
if (Sys.info()['sysname'] == 'Darwin'){
setwd('/Users/toni/Dropbox/NPCMaturation/results/emdata/delay')
} else {
setwd('C:\\Users\\toni\\Dropbox\\NPCMaturation\\results\\emdata\\delay')
}
fnames = c('delayedMaturation_v0_ts10_den.txt',
'delayedMaturation_noPrecursor_ts10_den.txt',
'delayedMaturationExponentialV_noPrecursor_ts10_v0.015_den.txt',
'delayedMaturation_v0.015_ts10_den.txt',
'delayedMaturationExponentialV_ts10_v0.015_den.txt')
# ----
library("ggplot2")
if (Sys.info()['sysname'] == 'Darwin'){
indatadir <-'/Users/toni/Dropbox/NPCMaturation/expdata/emdata'
indir <- '/Users/toni/Dropbox/NPCMaturation/results/emdata/delay'
outdir <- '/Users/toni/Dropbox/NPCMaturation/results/emdata/figures'
} else {
indatadir <- 'C:\\Users\\toni\\Dropbox\\NPCMaturation\\expdata\\emdata'
indir <- 'C:\\Users\\toni\\Dropbox\\NPCMaturation\\results\\emdata\\delay'
outdir <- 'C:\\Users\\toni\\Dropbox\\NPCMaturation\\results\\emdata\\figures'
}
setwd(indir)
fnames = c('delayedMaturation_noPrecursor_ts10.txt',
'delayedMaturationExponentialV_noPrecursor_ts10_v0.015.txt',
'delayedMaturation_v0.015_ts10.txt')
varNames = c('Var 1', 'Var 2', 'Var 3')
inData = list()
seq_plot = c(1, 2, 3)
for (i in seq_along(fnames) ) {
tmpCsv = read.csv(fnames[i], skip=6, sep='\t')
tmpCsv['model'] = varNames[i]
idx = which.min(tmpCsv$norm)
inData = rbind(inData, tmpCsv[idx, c('tauM', 'kM', 'norm', 'model', 'nrpara')])
}
inData$model = factor(inData$model, levels = varNames[seq_plot])