tests/tests_interactive/interactive_test_showtree.R

# set up a  test project with a tree and show it
# important we dont use get_exampes() in testing because this is for users. 
# in testing it is important to genrerate cUROSRS fresh
# as the cursors stored in get_examples() may well reflect deprecated data structures
rm(list=ls())
library(ephys2)
#load_all()
tree<-get_treeinfo("2014-07-22_CHO hERG.dat")
#showtree(tree, level=5)

set_cursor("hERG", curname = "lateTail", curMax_, c(0,0.1))
set_cursor("hERG", curname = "df", curMax_, c(0,0.1))
set_cursor("hERG", curname = "leak", curMean_, c(0,0.1))
set_cursor("hERG", curname = "peak", curMax_, c(0,0.1))

#CURSORS$hERG$plot.fun<-default.plot.fun  

ser<-getSeries(tree,1,1,1)
set_eventcursor(ser,1, "event.",curMax_,c(1,1.2)) 


ser2<-getSeries(tree,1,1,7)
set_eventcursor(ser2,1, "event.",curMean_,c(1,1.2)) 


ser_3<-getSeries(tree,1,1,1, trace = 3)
set_eventcursor(ser_3,1, "event.",curMax_,c(1,1.2)) 

#showtree(tree,level=5)
#showtree(reorder_tree(tree,1:3), level=5)

doubltree<-c(tree,reorder_tree(tree,1:3))
names(doubltree)<-c("original", "reordered")
class(doubltree)<-class(tree) # this makes it work
get_all(doubltree,"hERG") #ok, but 40 instead of 60
#get_eventresults(doubltree[1],"hERG") # not working
get_eventresults(tree,"hERG") # ok

showtree(doubltree, level=5)

# minor: newcursor must be cleared if it is not a dotName, at least if we change selection
#  
# if we change type of existing cursor, we have to manually clear newcursor
# we shall have an eventlist (as a subtree this would require update of tree) 
# we shall change icons if events are present
tdanker/ephys2 documentation built on Aug. 11, 2019, 12:12 p.m.