gautierstoll / StatMetCage

0 stars 0 forks source link

StatMetCage: a package for statistical analysis of metabolic cage data.

Introduction

StatMetCage performs statistical analysis of data produced by metabolic cages.

Installation

StatMetCage is installed from Github:

install.packages("devtools")
devtools::install_github("https://github.com/gautierstoll/StatMetCage")

Some dependent packages may not be available directly. They have to be installed first:

lubridate:

install.packages("lubridate")

lme:

install.packages("nlme")

shiny:

install.packages("shiny")

shinyFiles:

install.packages("shinyFiles")

fs:

install.packages("fs")

readxl:

install.packages("readxl")

HowTo

Useful helps:

? `RawMetaboData-class`
? `initialize,RawMetaboData-method`
? `AnalysisMetaboData-class`
? `initialize,AnalysisMetaboData-method`
? `ResStatMetabo-class`
? `initialize,ResStatMetabo-method`
? `metaboPlot,ResStatMetabo-method`
  1. Activate the package:

    library(StatMetCage)
  2. Download your data stored in a .csv file (eg myData.csv):

    RawMetaData = new("RawMetaboData",fileName = "myData.csv")
  3. Create an analysis object that contains the observation of interests(eg "VO2" and "VCO2""). An annotation data frame can be included (eg myAnnotation) that must contains "Animal", "Date" and "Time" column, with qualitative annotation (eg "Treatment", "Mutation"), the other columns will be treated as numeric data, with a time dependence evaluated by spline:

    AnalysisMeta = new("AnalysisMetaboData",rawData = RawMetaData,obs = c("VO2","VCO2"),annotation = myAnnotation,annotGroups = c("Treatment","Mutation"))
  4. Create a statistical result object:

    ResStatMeta = new("ResStatMetabo",anMetData = AnalysisMeta,observation = "VO2",model = "quadratic",group = "Treatment")

The results can be plotted:

metaboPlot(ResStatMeta,type = "data.model")

and statistical results can be extracted:

ResStatMeta@lmeRes$tTable

Shiny application

There s a shiny application for handling StatMetPackage.

After activating the package

library(StatMetCage)

Launch the shiny application:

StatShiny()
  1. Click on "Raw Data File" to download the raw data (a .csv file)

  2. Click on "Annotation File" to download the annotation file. It needs to be a .xlsx file that must contain the columns "Date","Time","Animal","Group". Each line describes an animal. The "Group" column must have some lines with the name "control".

  3. Click on "Run Analysis". Every animal in the Raw Data File must have at least one corresponding line in the Annotation File

The application produces a table of p-values, regarding the effect of each group compared to control. The application also produces a .pdf for each analyzed values.