GithubHelp home page GithubHelp logo

rvent's Introduction

rvent

The goal of rvent is to summarize, analyze and plot experimental data recorded with the SCIREQ pletysmograph.

The package was originally developed for being used by people with limited knowledge of R. For example, when function parameter inter = TRUE, dialog windows allow to interactively insert all others required parameters.

The rvent packaged is used by a the shiny app (link, github).

Installation

# install.packages("devtools")

devtools::install_github("c1au6i0/rvent")

Example

This is a basic example of how to use the package:

library(rvent)

# open dialog to select the directory with iox files to import
# import them and make them tidy
sess1 <- import_session() 

# open a series of interactive windows to select bin and baseline duration,
# missing info and drug treatments. Summarizes the data in an excel file
summarize_vent(sess1)

# for each subject creates a plot with 20 facets corresponding to the 20 recorded
# variables
session_plots(sess1)

You can bind tighter multiple excel-summary files into a single file by moving them into the same folder and then running:

bind_summary()

This is the example plot generated by session_plot for a subject Alex_DeLarge that received milk-plus.

Accepted files and recording

The rvent package extract some of the metadata from the subject name and comments provide in the output file. Thus, it is important to follow some rules for recording sessions.

—Subject name—

Subject name needs to contain a numeric ID (rest of the name will be discarded) followed by a drug name. These are all examples of accepted formats for subject 1 receiving 3 mg/kg of milk:

1 milk 3 mg/kg # prefered
1_milk_3_mg/kg
1 milk
1 milk ignoredinfo

These are examples of not accepted formats:

milk 1
milk rat1

—Comments—

Comments are used to identify the injection time. When one or more subjects receive an injection, use the SCIREQ software to add a comment in the form “ID DRUG DOSE UNIT”. For example, these are the accepted formats for a session in which subjects 1, 2 and 3 received 3 mg/kg of milk:

1 2 3 milk 3 mg/kg # prefered
rat 1 and 2 and 3 milk 3 mg/kg
rat1_2_3_milk 3 mg/kg
rat1 2 3 milk

If dose or unit are not inserted, the package will ask you to fill that info.

Note, that subjects are expected to get one injection per session.

For each subject, the time of the injection is identified by:

  • extracting rows with comments and columns relative to time, date and comments.
  • extracting from that dataframe, subject ID DRUG DOSE UNIT.
  • clean it up to have a single subject for each row.
  • inner-joining it with the dataframe of data by ID and DATE(this last one introduced in v0.0.2.100).

This means that you can analyze together different sessions of the same subject, as long as they are not from the same day.

—Example of iox file—

This is an example of a recording file (containing randomly generated data).

rvent's People

Contributors

c1au6i0 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.