# function to plot an arbitrary subset of traces from a tree
# question is do we really want to have the intermediate result
devtools::load_all()
t1<-get_treeinfo("non_package_files/2014-07-22_CHO hERG.dat")
t2<-get_treeinfo("non_package_files/VG_Blocker.dat")
t<-c(t1,t2)
get_traceCollection <-
function(tree, selection) {
list_of_series <- lapply(selection, function(sel_element){
getSeries_from_node(tree[[sel_element[1:3]]],sweeps = sel_element[4], trace = sel_element[5] )
})
list_of_series
}
plot_tracecollection<-function(tc){
xrange<-range(lapply(tc, function(trace){range(trace$x)}))
yrange<-range(lapply(tc, function(trace){range(trace$y)}))
plot(NULL, xlim=xrange, ylim=yrange, ylab="", xlab="")
lapply(tc, function(trace){
lines(trace$x,trace$y)
})
invisible(NULL)
}
tc<-get_traceCollection(t, list(c(1,1,1,1,1), c(2,1,7,1,2)))
plot_tracecollection(tc)
tc<-get_traceCollection(t, list(c(2,1,7,1,4), c(2,1,7,1,2)))
plot_tracecollection(tc)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.