Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

💪 Analysis of work loops and other data from muscle physiology experiments

License

NotificationsYou must be signed in to change notification settings

ropensci/workloopR

Repository files navigation

Project Status: Active – The project has reached a stable, usable state and is being actively developed.R build statusDOIDOICRAN status

Documentation website:https://docs.ropensci.org/workloopR/

Accompanying paper in Journal of Open Source Software:https://doi.org/10.21105/joss.01856

Installation

You can installworkloopR from CRAN via:

install.packages("workloopR")

Or to get the latest (developmental) version through GitHub, use:

#install.packages("devtools") # if devtools is not installeddevtools::install_github("ropensci/workloopR")

Please note that vignettes are not built by default. To build vignettes as well, please use the following code:

devtools::install_github("ropensci/workloopR",build_vignettes=TRUE)

Overview

workloopR (pronounced "work looper") provides functions for the import, transformation, and analysis of muscle physiology experiments in R. As the package's title suggests, our initial motivation was to provide functions to analyze work loops. The work loop technique (Josephson 1985) is used in studies of muscle physiology to determine the mechanical work and power output of a muscle. Over the course of developing the package, we expanded this goal to also cover experiments that are often complementary to the work loop technique. There are three currently supported experiment types: work loop, simple twitch, and tetanus.

Figure 1

For more on work loops, we recommend a great review paper by Ahn (2012) as well asthis Wikipedia page.

Example

workloopR offers the ability to import, transform, and then analyze a data file. Here is an example using a work loop file included within the package:

library(workloopR)## import the workloop.ddf file included in workloopRwl_dat<- read_ddf(system.file("extdata","workloop.ddf",package='workloopR'),phase_from_peak=TRUE)## select cycles 3 through 5 using a peak-to-peak definitionwl_selected<- select_cycles(wl_dat,cycle_def="p2p",keep_cycles=3:5)## apply a gear ratio correction, run the analysis function,## and then get the full objectwl_analyzed<- analyze_workloop(wl_selected,GR=2)## for brevity, the print() method for this object produces a simple outputwl_analyzed
File ID: workloop.ddfCycles: 3 cycles kept out of 6Mean Work: 0.00308 JMean Power: 0.08474 W
## but see the structure for the full output, e.g.#str(wl_analyzed)## or run the analysis but get the simplified versionwl_analyzed_simple<- analyze_workloop(wl_selected,simplify=TRUE,GR=2)wl_analyzed_simple
  Cycle        Work  Net_Powera     A 0.002785397 0.07639783b     B 0.003147250 0.08661014c     C 0.003305744 0.09122522

Core features and recommended vignettes

For an overview, please also see our"Introduction to workloopR" vignette

Data import: Importing data creates objects of classmuscle_stim, which we designed to essentially behave asdata.frames but with unique properties that work nicely withworkloopR's core functions. Data that are stored in .ddf format (e.g., generated by Aurora Scientific's Dynamic Muscle Control and Analysis Software) are easily imported. Other file formats are welcome, but need to be constructed intomuscle_stim objects by the user; please see the vignette"Importing data from non .ddf sources".

  • Example:
## import the workloop.ddf file included in workloopRwl_dat<- read_ddf(system.file("extdata","workloop.ddf",package='workloopR'),phase_from_peak=TRUE)## see how the muscle_stim object is organizedwl_datstr(wl_dat)names(attributes(wl_dat))

Data transformations & corrections: Prior to analyses, data can be transformed or corrected. Should data have been recorded incorrectly, the gear ratio of the motor arm and/or the direction of the muscle's length change can be adjusted. Before analyzing work loop data, cycles within the work loop can be labeled (according to various definitions of what constitutes a "cycle"), which allows calculation of metrics on a per-cycle basis.

  • Example:
## correct the gear ratio of the motor arm## we'll use gear ratio = 2## this multiples Force by 2 and divides Position by 2wl_fixed<- fix_GR(wl_dat,GR=2)

Analyses: Core data analytical functions includeanalyze_workloop() for work loop files andisometric_timing() for twitch and tetanus trials.

## import the twitch.ddf file included in workloopRtwitch_dat<- read_ddf(system.file("extdata","twitch.ddf",package='workloopR'))## run isometric_timing() to get info on twitch kinetics## we'll use different set points than the defaultsanalyze_twitch<- isometric_timing(twitch_dat,rising= c(25,50,75),relaxing= c(75,50,25))

Batch processing: We also include functions for batch processing files (e.g., multiple files from a common experiment). These functions allow for the import, cycle selection, gear ratio correction, and ultimately work & power computation for all work loop trial files within a specified directory. This also allows users to correct for potential degradation of the muscle (according to power & work output) over the course of the experiment. See the"Batch processing" vignette

  • Example:
## batch read and analyze files included with workloopRanalyzed_wls<- read_analyze_wl_dir(system.file("extdata/wl_duration_trials",package='workloopR'),phase_from_peak=TRUE,cycle_def="p2p",keep_cycles=2:4,GR=2)

Plotting: Although we do not provide plotting functions, all resultant objects are designed to be friendly to visualization via either base-R plotting ortidyverse functions. Please see the"Plotting data in workloopR" vignette.

Graphical overview

Recommended functions and vignettes:

Figure 2

Citation

The preferred way to citeworkloopR is:

Baliga VB and Senthivasan S. 2019. workloopR: Analysis of work loops and other data from muscle physiology experiments in R.Journal of Open Source Software, 4(43), 1856,https://doi.org/10.21105/joss.01856

Issues/questions/requests

Feedback is welcome! Please feel free to get in touch with either Vikram (@vbaliga) or Shree (@shreeramsenthi).

We are happy to take feature requests, especially those that involve data import from non-ddf file types. Please see our Issues page fortemplates that you can use.

🐢

License

GPL (>= 3) + file LICENSE

ropensci_footer


[8]ページ先頭

©2009-2025 Movatter.jp