Skip to content

Repository files navigation

STRUCT: STatistics in R Using Class Templates

GitBiocondaLicenseCoverage

Overview

struct is an R package that helps you build consistent, reusable data-analysis workflows using object-oriented templates. In simple terms, it gives you a standard way to define:

  • what inputs an analysis method expects,
  • what outputs it returns, and
  • how methods are documented and combined into larger pipelines.

This makes code easier to understand, test, and share across collaborators, especially when projects involve many statistical methods.

Install

Choose one of the installation methods below.

Github

library(devtools)
install_github('computational-metabolomics/struct')
library(struct)

Conda

conda create -n struct struct -c conda-forge -c bioconda -c computational-metabolomics
conda activate struct

Then start R and load the package:

library(struct)
library(structToolbox)

Quick Start

The example below shows a simple two-step analysis pipeline using objects from the companion package structToolbox: mean centring followed by PCA.

# Load struct and companion toolbox
library(struct)
library(structToolbox)
# Example dataset, in struct formatDE= iris_DatasetExperiment()
# Build model sequenceMS= mean_centre() + PCA()
# Train the model using the dataMS= model_train(MS,DE)
# Get predictions for the data using the modelMS= model_predict(MS,DE)
# Access results via outputscores<-MS[2]$scoresloadings<-MS[2]$loadings

References

About

R/Bioconductor package - STRUCT: STatistics in R Using Class Templates

Topics

Resources

Stars

6 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages