GithubHelp home page GithubHelp logo

moritzlindner / patchr Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 1.74 MB

An environment for handling and analysing electrophysiological (Patch Clamp) measurements in R

License: Other

R 100.00%
physiology physiological-data neuroscience electrophysiology electrophysiological-data

patchr's Introduction

README

Moritz Lindner 20 January 2021

Installation

if (!requireNamespace("remotes", quietly = TRUE)){
  install.packages("remotes")
}
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

library(PatchR)

# import a PatchMaster file
tmp<-ImportPRecording("test.dat",series = 1,traces = c(1,2))

#alternatively, use the sample data included in the package
data(PRecording)
tmp<-SampleData

# build a Plot superimposing all sweeps and inspect interactivley
tmp<-BuildRecordingPlot(tmp)
Inspect(tmp, what = "I-mon")

# apply any function to the PRecording object. In this case, make mean over all sweeps
tmp<-apply(tmp, "Sweep", mean, ReturnPObject = T)

# and return as data.frame
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.

exp<-newPCollection(list(SampleData,SampleData),Names=c("A","B"),Group=c("Generic1","Generic2"))

#flexible approach
exp<-AddMetaData(exp, #add as metadata to PCollection
            lapply(exp, # for each PRecording stored in PCollection
                   function(x){
                     apply( # average over time
                       GetData(x, # extract values from I-mon trace, Sweep 15, between 1 and 1.19 s only 
                                  Traces="I-mon",
                                  Time =c(1,1.19),
                                  Sweeps=GetSweepNames(x)[c(3)]),
                       "Time",
                       mean)
                     }
                   )
            )

GetMetaData(exp)

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

Developed by Moritz Lindner

patchr's People

Contributors

moritzlindner avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.