The ephys2 package facilitates reading HEKA Patchmaster files into an R session, viewing the tree strucuture, extract and plot single traces or complete series, and perform analyses on them.
library(ephys2) tree<-get_treeinfo(examplefile("NaV")) s<-getSeries(tree,1,1,7) s$set_cursor("peak", curMin_, c(0.0112,0.0117)) s$plot(xlim=c(.011, .013))
s$add_lpinfo(c(0,1,10, 100, 300, 1000), c(5,15,15,15,15,13), "Lidocaine") RESULTS<-s$plotIt("peak", main="I/t plot", bty="l") abline(h=0, lty=3, col="blue")
library(dplyr) # change concentrations #RESULTS$Concentration<-c(1,3,0,.1,.3) # normalize #RESULTS %>% arrange(Concentration) -> RESULTS2 # drc drc_(RESULTS, param=2)
The example file also contains a series that was recorded with the intention to make an I/V plot, showing the activation of the current over voltage. First, we set up the cursors and check the result:
s2<-getSeries(tree,1,1,3) s2$set_cursor("peak", curMin_, c(0.0105,0.013)) s2$set_cursor("base", curMean_, c(0.0,0.002)) s2$plot()
Now, plotting the I/V relationship only requires setting up the stimulus voltages. Note how we use a plot formula to substract the base cursor:
make_stimulus(s2$sweeps, "voltage",base=-80,inc=10) s2$plotresults(peak-base~voltage, type="o", main="activation of the NaV 1.4 sodium channel", bty="l")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.