项目作者: moritzlindner

项目描述 :
An environment for handling and analysing electrophysiological (Patch Clamp) measurements in R
高级语言: R
项目地址: git://github.com/moritzlindner/PatchR.git
创建时间: 2021-01-18T15:17:25Z
项目社区:https://github.com/moritzlindner/PatchR

开源协议:GNU General Public License v2.0

下载


README

Moritz Lindner
20 January 2021

Installation

  1. if (!requireNamespace("remotes", quietly = TRUE)){
  2. install.packages("remotes")
  3. }
  4. remotes::install_github("moritzlindner/PatchMasteR")

Description

Core component of PatchR is the PRecording class, wich stores a series
imported from a Patchmaster *.dat file. Several integrety checks are
implemented into the PRecording class to assure data integrity is
maintained. Multiple recordings (PRecording) objects can be stored and
processed within the PCollection class using mostly identical commands
and synthax.

Import procedures are currently implemented for HEKA’s PachtMaster file
format.

Examples

Example 1: Improting and inspecting data

Import a PatchMaster *.dat file, inspect visually and make an average
over all sweeps

  1. library(PatchR)
  2. # import a PatchMaster file
  3. tmp<-ImportPRecording("test.dat",series = 1,traces = c(1,2))
  4. #alternatively, use the sample data included in the package
  5. data(PRecording)
  6. tmp<-SampleData
  7. # build a Plot superimposing all sweeps and inspect interactivley
  8. tmp<-BuildRecordingPlot(tmp)
  9. Inspect(tmp, what = "I-mon")
  10. # apply any function to the PRecording object. In this case, make mean over all sweeps
  11. tmp<-apply(tmp, "Sweep", mean, ReturnPObject = T)
  12. # and return as data.frame
  13. as.data.frame(tmp)

Example 2: Flexible data analysis

Create a PCollection, perform a classical time series data extraction
(in this case: from each stored PRecording, take current trace “I-mon”,
extract values between 0.8s and 1s from sweep 15 and average these),
and add thesse as metadata.

  1. exp<-newPCollection(list(SampleData,SampleData),Names=c("A","B"),Group=c("Generic1","Generic2"))
  2. #flexible approach
  3. exp<-AddMetaData(exp, #add as metadata to PCollection
  4. lapply(exp, # for each PRecording stored in PCollection
  5. function(x){
  6. apply( # average over time
  7. GetData(x, # extract values from I-mon trace, Sweep 15, between 1 and 1.19 s only
  8. Traces="I-mon",
  9. Time =c(1,1.19),
  10. Sweeps=GetSweepNames(x)[c(3)]),
  11. "Time",
  12. mean)
  13. }
  14. )
  15. )
  16. GetMetaData(exp)

The import functions have been adopted from the ephys2
package
from Timm Danker

Developed by Moritz
Lindner