c(10)
c(0,10)
c(dim=10)
c(len=10)
c(0)*10
c(0, size=10)
a <- c()
a
len(a)=10
len(a) <- 10
size(a)
dim(a)
len(a)
length(a)
length(a) <- 10
a
a<-c(1)
length(a) <- 10
a
a(4)
a
a[4]
a[1]
a[0]
a[1]
a[2]
a[11]
a[19]
a
sum(F)
M <- rep(0, N + 1)
N <- 4 # Number of possible strands to try matching with the target
N <- 4 # Number of possible strands to try matching with the target
source('../recog_stoch_sim.R')
source('~/Code/thesis/recog_stoch_sim/recog_stoch_sim.R')
source('~/Code/thesis/recog_stoch_sim/recog_stoch_sim.R')
F
sum(F)
source('~/Code/thesis/recog_stoch_sim/recog_stoch_sim.R')
N <- 4 # Number of possible strands to try matching with the target
C <- rep(1.0, N) # Code stack concentrations
A <- rep(10.0, N) # Target concentration
Tick <- rep(1.0, N) # Tick strand concentrations
Tock <- rep(1.0, N) # Tock strand concentrations
n <- rep(1, N) # Instructions at the i'th code stack
M <- rep(0, N + 1)
F <- rep(0, N + 1)
h_tick_tock <- 1.0 # yield constant for tick/tock hybridization
h_gamma_alpha <- rep(0.0, N) # yield constant for gate i/target hybridizaiton
h_gamma_gamma <- rep(1.0, N) # yield constant for gate i/anti-gate i hybridization
r <- 0.5 # max reconstruction of flourescence
D <- rep(0, N + 1) # Strands of the i'th gate released at time step i
D[1] <- Tick[1] * C[1]* (( (1 - (h_tick_tock**(n[1] + 1))) / (1 - h_tick_tock) ) - 1)
M[1] <- D[1] * ( (A[1] * h_gamma_alpha[1]) / (A[1] * h_gamma_alpha[1] + C[2]) )
F[1] <- D[1] * ( (C[2] * h_gamma_gamma[1]) / (A[1] + C[2]) )
A[2] <- A[2] - M[1]
F
M
C
A
Tick
Tock
n
M
D
Tick[1]
source('~/Code/thesis/recog_stoch_sim/recog_stoch_sim.R')
F
M
D
T[2]
source('~/Code/thesis/recog_stoch_sim/recog_stoch_sim.R')
F
source('~/Code/thesis/recog_stoch_sim/recog_stoch_sim.R')
F
source('~/Code/thesis/recog_stoch_sim/recog_stoch_sim.R')
F
sum(F)
source('~/Code/thesis/recog_stoch_sim/recog_stoch_sim.R')
F
source('~/.active-rstudio-document')
source('~/Code/thesis/recog_stoch_sim/recog_stoch_sim.R')
F
source('~/Code/thesis/recog_stoch_sim/recog_stoch_sim.R')
F
source('~/Code/thesis/recog_stoch_sim/recog_stoch_sim.R')
F
source('~/Code/thesis/recog_stoch_sim/recog_stoch_sim.R')
F
A
l=rep(3,5)
l
l[2:4]
l[2:5] <- 2
l
l[2:-1]
l[2:length(l)]
source('~/Code/thesis/recog_stoch_sim/recog_stoch_sim.R')
F
A
F
source('~/Code/thesis/recog_stoch_sim/recog_stoch_sim.R')
A
F
source('~/Code/thesis/recog_stoch_sim/recog_stoch_sim.R')
F
source('~/Code/thesis/recog_stoch_sim/recog_stoch_sim.R')
F
source('~/Code/thesis/recog_stoch_sim/recog_stoch_sim.R')
run_sim(N,C,A,Tick,Tock,n,h_gamma_alpha)
run_sim(N,C,A,Tick,Tock,n,h_gamma_alpha)
for (c in 1:10) {}
for (c in 1:10) { A<-rep(10.0, N)
C<-rep(c+0.0, N)
F<-run_sim(N,C,A,Tick,Tock,n,h_gamma_alpha)
print F
print(F)
for (c in 1:10) { A<-rep(10.0, N)
C<-rep(c+0.0, N)
F<-run_sim(N,C,A,Tick,Tock,n,h_gamma_alpha)
print(F)
print(sum(F))
}
source('~/Code/thesis/recog_stoch_sim/recog_stoch_sim.R')
F<-run_sim(N,C,A,Tick,Tock,n,h_gamma_alpha)
F
h_gamma_alpha
fix(run_sim)
fix(l)
fix(h_gamma_alpha)
install.packages("ggplot2")
library("ggplot2")
install.packages(c("Matrix", "boot", "mgcv", "nlme", "rpart"))
load("~/Code/thesis/recog_stoch_sim/.RData")
load("~/Code/thesis/recog_stoch_sim/recog_stoch_sim.Rproj")
data <- read.table(path)
print(path)
data <- read.table(filepath)
data <- read.table(filepath);
filename
data_dir
data_dir<-'../in'
filename<-'reaction_stack1'
join(data_dir, reaction_stack1, sep='/')
paste(data_dir, reaction_stack1, sep='/')
paste(data_dir, filename, sep='/')
filename <- paste('reaction_stack1', 'ppairs', sep='.')
filepath <- paste(data_dir, filename, sep='/')
source('~/Code/thesis/recog_stoch_sim/nupack_pair_plots.R')
source('~/Code/thesis/recog_stoch_sim/nupack_pair_plots.R')
data
source('~/Code/thesis/recog_stoch_sim/nupack_pair_plots.R')
source('~/Code/thesis/recog_stoch_sim/nupack_pair_plots.R')
data
data[2,]
data[1,]
data<-data[seq(2, dim(data)[1]),]
data
install.packages(c("MASS", "cluster", "foreign", "survival"))
order(data[,3])
data[order(data[,3]),]
source('~/Code/thesis/recog_stoch_sim/nupack_pair_plots.R')
source('~/Code/thesis/recog_stoch_sim/nupack_pair_plots.R')
source('~/Code/thesis/recog_stoch_sim/nupack_pair_plots.R')
source('~/Code/thesis/recog_stoch_sim/nupack_pair_plots.R')
p+geom_time(aes(fill=z))
p+geom_tile(aes(fill=z))
df
source('~/Code/thesis/recog_stoch_sim/nupack_pair_plots.R')
p + geom_tile(aes(fill=z))
c(1,3)
df <- expand.grid(x=1:3, y=1:3)
df
df.z <- 1:9
df
df$z  <- 1:9
df
p<-ggplot(df, aes(x=list('a','b','c'), y=list('d','e','f')))
p+geom_tile(aes(fill=z))
p<-ggplot(df, aes(x=x,y=y))
p+geom_tile(aes(fill=z))
df <- expand.grid(x=c('a','b','c'), y=c('d','e','f'))
df$z  <- 1:9
p<-ggplot(df, aes(x=x,y=y))
p+geom_tile(aes(fill=z))
data
df
df <- expand.grid(x=1:3, y=1:3)
df
df$z  <- 1:9
p<-ggplot(df, aes(x=x,y=y))
p+geom_tile(aes(x=c('q','r','s'), y=c('t','u','v'), fill=z))
df
z
source('~/Code/thesis/recog_stoch_sim/nupack_pair_plots.R')
p + geom_tile(aes(fill=z)) #pretty useless!
'ATGC'*11
rep('ATGC', 11)
paste(rep('ATGC', 11))
paste(rep('ATGC', 11), collapse='')
strand=paste(rep('ATGC', 11), collapse='')
strand[c(1,2,3)]
as.vector(strand)
as.character(strand)
as.character(strand)[2]
as.character(strand)[2]
as.character(strand)[1]
strand[1]
strand[1][1]
strand[[1]]
strand[1][2:5]
strsplit(strand)
strsplit(strand, '.')
strsplit(strand, '..')
strsplit(strand, '')
splstrand<-strsplit(strand, '')
splstrand[44]
splstrand[43]
splstrand
splstrand[[1]]
splstrand<-splstrand[[1]]
splstrand
splstrand[44]
splstrand[45]<-"U"
splstrand
splstrand[45]<-"X"
splstrand
p <- ggplot(df, aes(x=x,y=y))
p + geom_tile(aes(fill=z)) #pretty useless!
p<- ggplit(df, aes(x=splstrand, y=splstrand))
p<- ggplot(df, aes(x=splstrand, y=splstrand))
p <- ggplot(df, aes(x=x,y=y))
p + geom_tile(aes(fill=z)) #pretty useless!
p<- ggplot(df, aes(x=splstrand, y=splstrand))
p + geom_tile(aes(fill=z)) #pretty useless!
df
p <- ggplot(df, aes(x=x,y=y))
p + geom_tile(aes(fill=z))
p + geom_tile(aes(fill=z, x=splstrand, y=splstrand))
p <- ggplot(df, aes(x=splstrand[df$x],y=splstrand[df$y]))
p + geom_tile(aes(fill=z))
splstrand[df$y]
df$label=splstrand[df$x]
df
p <- ggplot(df, aes(x=x,y=y,label=label))
p + geom_tile(aes(fill=z))
p + geom_tile(aes(fill=z, label=label))
p <- ggplot(df, aes(x=x,y=y,label=label))
p + geom_tile(aes(fill=z, label=label))
p <- ggplot(df, aes(x=x,y=y,label=label))
p + geom_tile(aes(fill=z, label=label))
df
p + xlab(df$label)
p <- ggplot(df, aes(x=x,y=y))
p + geom_tile(aes(fill=z)) + xlab(splstrand[df$x]) + ylab(splstrand[df$y])
p + xlab(splstrand[df$x])
p + geom_tile(aes(fill=z)) + xlab(splstrand[df$x]) + ylab(splstrand[df$y])
p + geom_tile(aes(fill=z)) + xlim(splstrand[df$x]) + ylim(splstrand[df$y])
p + geom_tile(aes(fill=z)) + breaks(splstrand[df$x]) + breaks(splstrand[df$y])
p + geom_tile(aes(fill=z)) + scale_x_discrete(splstrand[df$x])
p + geom_tile(aes(fill=z)) + scale_x_discrete(breaks=splstrand[df$x])
p + geom_tile(aes(fill=z)) + xbreaks(splstrand[df$x])
?discrete_scale
p + geom_tile(aes(fill=z)) + discrete_scale(breaks=splstrand[df$x])
p + geom_tile(aes(fill=z)) + discrete_scale(x, breaks=splstrand[df$x])
p + geom_tile(aes(fill=z)) + scale_x_discrete(breaks=splstrand[df$x])
newdata = expand.grid(1:45, 1:45)
newdata
newdata[data[,1], data[,2]] = data[,3]
newdata[data[,1] * 45 + data[,2]] = data[,3]
data[,1]*45 + data[,2]
newdata[79]
newdata[79,]
data[1,1]
data[1,2]
data[1,3]
(data[,1]-1)*45 + data[,2]
newdata[67,]
data[3,1]
data[3,2]
newdata[1:10,]
newdata$xlab<-c(45**2)
newdata[1:10,]
newdata$ylab<-c(45**2)
newdata$z <- c(0)
newdata$z[(data[,1]-1)*45 + data[,2]] <- data[,3]
data[1:10,3]
newdata$xlab <- splstrand[newdata[,2]]
newdata$ylab <- splstrand[newdata[,1]]
newdata[1:10,]
p <- ggplot(df, aes(x=xlab, y=ylab))
p + geom_tile(aes(fill=z))
p <- ggplot(newdata, aes(x=xlab, y=ylab))
p + geom_tile(aes(fill=z))
p <- ggplot(newdata, aes(x=V1, y=V2))
p + geom_tile(aes(fill=z))
p <- ggplot(newdata, aes(x=Var1, y=Var2))
p + geom_tile(aes(fill=z))
p + geom_tile(aes(fill=z)) + scale_x_discrete(breaks=newdata$xlab)
p + geom_tile(aes(fill=z)) + scale_x_discrete(newdata$xlab)
p + scale_fill_gradient(low="white", high="red")
p + geom_tile(aes(fill=z)) + scale_x_discrete(newdata$xlab) + scale_fill_gradient(low="white", high="red")
source('~/Code/thesis/recog_stoch_sim/nupack_pair_plots.R')
p <- ggplot(data, aes(x=data[,1],y=data[,2]))
p + geom_tile(aes(fill=data[,3])) + scale_fill_gradient(low="white", high="red")
?geom_tile
p + geom_tile(aes(fill=data[,3])) + scale_fill_gradient(low="white", high="red") + scale_fill_identity(labels=letters[1:5], breaks=col)
last_plot() + opts(panel.background = theme_blank())
p <- ggplot(data, aes(x=data[,1],y=data[,2]))
p + geom_tile(aes(fill=data[,3])) + scale_fill_gradient(low="white", high="red")
last_plot() + opts(panel.background = theme_blank())
p <- ggplot(data, aes(x=data[,1],y=data[,2]))
p + geom_tile(aes(fill=data[,3])) + scale_fill_gradient(low="white", high="red") + opts(panel.background = theme_blank()) + scale_x_discrete(breaks=1)
p <- ggplot(data, aes(x=data[,1],y=data[,2]))
p + geom_tile(aes(fill=data[,3])) + scale_fill_gradient(low="white", high="red") + opts(panel.background = theme_blank()) + scale_x_discrete(breaks=1:45)
p <- ggplot(data, aes(x=data[,1],y=data[,2]))
p + geom_tile(aes(fill=data[,3])) + scale_fill_gradient(low="white", high="red") + opts(panel.background = theme_blank()) + scale_x_discrete(breaks=rep('A', 45))
p <- ggplot(data, aes(x=data[,1],y=data[,2]))
p + geom_tile(aes(fill=data[,3])) + scale_fill_gradient(low="white", high="red") + opts(panel.background = theme_blank()) + scale_x_discrete(breaks=1:45)
p <- ggplot(data, aes(x=data[,1],y=data[,2]))
p + geom_tile(aes(fill=data[,3])) + scale_fill_gradient(low="white", high="red") + opts(panel.background = theme_blank()) + scale_x_discrete(breaks=1:45) + scale_y_discrete(breaks=1:45)
p <- ggplot(newdata, aes(x=Var1, y=Var2))
p + geom_tile(aes(fill=data[,3])) + scale_fill_gradient(low="white", high="red") + opts(panel.background = theme_blank()) + scale_x_discrete(breaks=1:45) + scale_y_discrete(breaks=1:45)
p + geom_tile(aes(fill=newdata[,3])) + scale_fill_gradient(low="white", high="red") + opts(panel.background = theme_blank()) + scale_x_discrete(breaks=1:45) + scale_y_discrete(breaks=1:45)
p <- ggplot(newdata, aes(x=Var1, y=Var2))
p + geom_tile(aes(fill=newdata[,3])) + scale_fill_gradient(low="white", high="red") + opts(panel.background = theme_blank()) + scale_x_discrete(breaks=1:45) + scale_y_discrete(breaks=1:45)
p <- ggplot(newdata, aes(x=Var1, y=Var2))
newdata[1:10]
newdata[1:10,]
p + geom_tile(aes(fill=newdata$z)) + scale_fill_gradient(low="white", high="red") + opts(panel.background = theme_blank()) + scale_x_discrete(breaks=1:45) + scale_y_discrete(breaks=1:45)
source('~/Code/thesis/recog_stoch_sim/nupack_pair_plots.R')
source('~/Code/thesis/recog_stoch_sim/nupack_pair_plots.R')
source('~/Code/thesis/recog_stoch_sim/nupack_pair_plots.R')
source('~/Code/thesis/recog_stoch_sim/nupack_pair_plots.R')
source('~/Code/thesis/recog_stoch_sim/nupack_pair_plots.R')
p + geom_tile(aes(fill=newdata$z)) + scale_fill_gradient(low="white", high="red") + opts(panel.background = theme_blank()) + scale_x_discrete(breaks=1:N) + scale_y_discrete(breaks=1:N)
source('~/Code/thesis/recog_stoch_sim/nupack_pair_plots.R')
p + geom_tile(aes(fill=newdata$z)) + scale_fill_gradient(low="white", high="red") + opts(panel.background = theme_blank()) + scale_x_discrete(breaks=1:N) + scale_y_discrete(breaks=1:N)
source('~/Code/thesis/recog_stoch_sim/nupack_pair_plots.R')
source('~/Code/thesis/recog_stoch_sim/nupack_pair_plots.R')
source('~/Code/thesis/recog_stoch_sim/nupack_pair_plots.R')
source('~/Code/thesis/recog_stoch_sim/nupack_pair_plots.R')
source('~/Code/thesis/recog_stoch_sim/nupack_pair_plots.R')
source('~/Code/thesis/recog_stoch_sim/nupack_pair_plots.R')
p + geom_tile(aes(fill=newdata$z)) + scale_fill_gradient(low="white", high="red") + opts(panel.background = theme_blank()) + scale_x_discrete(breaks=1:N) + scale_y_discrete(breaks=1:N)
p + geom_tile(aes(fill=newdata$z)) + scale_fill_gradient(low="white", high="red") + opts(panel.background = theme_blank()) + scale_x_discrete(breaks=1:N) + scale_y_discrete(breaks=1:N)
pdf('whatever.pdf')
print(p)
dev.off()
p + geom_tile(aes(fill=newdata$z)) + scale_fill_gradient(low="white", high="red") + opts(panel.background = theme_blank()) + scale_x_discrete(breaks=1:N) + scale_y_discrete(breaks=1:N)
pdf('whatever.pdf')
p + geom_tile(aes(fill=newdata$z)) + scale_fill_gradient(low="white", high="red") + opts(panel.background = theme_blank()) + scale_x_discrete(breaks=1:N) + scale_y_discrete(breaks=1:N)
print(p)
dev.off()
source('~/Code/thesis/recog_stoch_sim/nupack_pair_plots.R')
seq(1, 10, by=2)
seq(1, 10, 2)
load("~/Code/thesis/recog_stoch_sim/recog_stoch_sim.Rproj")
filepath="../in/example_stack.analysis"
newdata <- read.table(filepath, header=TRUE)
newdata <- read.table(filepath, header=TRUE)
newdata
newdata <- read.csv(filepath, header=TRUE)
newdata
p<-ggplot(newdata, aes(x=newdata[,1], y=newdata[,2]))
library(ggplot2)
p<-ggplot(newdata, aes(x=newdata[,1], y=newdata[,2]))
p+geom_line()
p+aes(y=newdata[,3])
p<-ggplot(newdata, aes(x=newdata[,1], y=newdata[,3]))
p+geom_line()
p<-ggplot(newdata, aes(x=newdata[,1], y=newdata[,5]))
p+geom_line()
p+geom_line(aes(y=newdata[,3]))
p <- ggplot(newdata, aes(x=newdata[,1],y=newdata[,2]))
source('~/Code/thesis/recog_stoch_sim/nupack_analysis_plots.R')
args <- c('example_stack')
filename <- paste(args[1], 'analysis', sep='.')
filepath <- paste(data_dir, filename, sep='/')
newdata <- read.csv(filepath, header=TRUE)
# data[order(data[,3]),] # Sort by number of matches
pdf(paste('in/', args[1], '-pairplot.pdf', sep=''))
p <- ggplot(newdata, aes(x=newdata[,1],y=newdata[,2]))
print(p + geom_tile(aes(fill=newdata$z)) + scale_fill_gradient(low="white", high="red") + opts(panel.background = theme_blank()) + scale_x_discrete(breaks=seq(1, N, 2)) + scale_y_discrete(breaks=seq(1, N, 2)))
dev.off()
args <- c('../in/example_stack')
filename <- paste(args[1], 'analysis', sep='.')
filepath <- paste(data_dir, filename, sep='/')
newdata <- read.csv(filepath, header=TRUE)
# data[order(data[,3]),] # Sort by number of matches
pdf(paste('in/', args[1], '-pairplot.pdf', sep=''))
p <- ggplot(newdata, aes(x=newdata[,1],y=newdata[,2]))
print(p + geom_tile(aes(fill=newdata$z)) + scale_fill_gradient(low="white", high="red") + opts(panel.background = theme_blank()) + scale_x_discrete(breaks=seq(1, N, 2)) + scale_y_discrete(breaks=seq(1, N, 2)))
dev.off()
newdata <- read.csv(filepath, header=TRUE)
data_dir <- '.'
newdata <- read.csv(filepath, header=TRUE)
filepath <- paste(data_dir, filename, sep='/')
newdata <- read.csv(filepath, header=TRUE)
View(newdata)
View(newdata)
p <- ggplot(newdata, aes(temp, mfe_energy))
print(p + geom_tile(aes(fill=newdata$z)) + scale_fill_gradient(low="white", high="red") + opts(panel.background = theme_blank()) + scale_x_discrete(breaks=seq(1, N, 2)) + scale_y_discrete(breaks=seq(1, N, 2)))
View(newdata)
p <- ggplot(newdata, aes(temp, mfe_energy))
p <- p + layer(geom="line", data=mfe_prob)
p <- p + layer(geom="line", data=desired_energy)
p <- p + layer(geom="line", data=desired_prob)
p <- ggplot(newdata, aes(temp, mfe_energy))
p <- p + geom_line(data=mfe_prob)
p <- p + geom_line(data=desired_energy)
p <- p + geom_line(data=desired_prob)
p <- ggplot(newdata, aes(temp, mfe_energy))
p <- p + aes(temp, mfe_prob)
p
p <- p + geom_line()
p
p <- p + aes(temp, desired_prob)
p
p <- p + geom_line((aes(temp, mfe_prob)))
p
p <- p + geom_line((aes(temp, mfe_energy)))
p
energy_plot <- ggplot(newdata, aes(temp, mfe_energy)) + geom_line()
energy_plot <- energy_plot + geom_line(aes(temp, desired_energy))
energy_plot
prob_plot <- ggplot(newdata, aes(temp, mfe_prob)) + geom_line()
prob_plot <- prob_plot + geom_line(aes(temp, desired_prob))
prob_plot
energy_plot <- ggplot(newdata, aes(temp, mfe_energy, colour="red")) + geom_line()
energy_plot <- energy_plot + geom_line(aes(temp, desired_energy, colour="blue"))
energy_plot
energy_plot <- ggplot(newdata, aes(temp, mfe_energy, colour="MFE energy")) + geom_line()
energy_plot <- energy_plot + geom_line(aes(temp, desired_energy, colour="blue"))
energy_plot
energy_plot <- ggplot(newdata, aes(temp, mfe_energy, colour="MFE")) + geom_line()
energy_plot <- energy_plot + geom_line(aes(temp, desired_energy, colour="Desired"))
energy_plot
energy_plot <- ggplot(newdata, aes(temp, mfe_energy, colour="MFE")) + geom_line()
energy_plot <- energy_plot + geom_line(aes(temp, desired_energy, colour="Desired"))
energy_plot
energy_plot <- ggplot(newdata, aes(temp, mfe_energy, colour="MFE")) + geom_line()
energy_plot <- energy_plot + geom_line(aes(temp, desired_energy, colour="Desired")) + opts(title="Free energy for structure")
energy_plot
help(png)
