parafac4microbiome
Creation and selection of Parallel Factor Analysis models of longitudinal microbiome data.
Science Score: 49.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 8 DOI reference(s) in README -
✓Academic publication links
Links to: zenodo.org -
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (18.3%) to scientific vocabulary
Keywords
dimensionality-reduction
microbiome
microbiome-data
multiway
multiway-algorithms
parallel-factor-analysis
Last synced: 6 months ago
·
JSON representation
Repository
Creation and selection of Parallel Factor Analysis models of longitudinal microbiome data.
Basic Info
- Host: GitHub
- Owner: GRvanderPloeg
- License: other
- Language: R
- Default Branch: master
- Homepage: https://grvanderploeg.github.io/parafac4microbiome/
- Size: 289 MB
Statistics
- Stars: 8
- Watchers: 2
- Forks: 2
- Open Issues: 0
- Releases: 9
Topics
dimensionality-reduction
microbiome
microbiome-data
multiway
multiway-algorithms
parallel-factor-analysis
Created about 2 years ago
· Last pushed 6 months ago
Metadata Files
Readme
Changelog
License
README.Rmd
---
output: github_document
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
fig.width = 12,
fig.height = 6,
out.width = "100%"
)
options(tibble.print_min = 6L, tibble.print.max = 6L, digits = 3)
```
# parafac4microbiome
[](https://app.codecov.io/gh/GRvanderPloeg/parafac4microbiome?branch=master) [](https://github.com/GRvanderPloeg/parafac4microbiome/actions/workflows/R-CMD-check.yaml)    [](https://doi.org/10.5281/zenodo.15476822)
## Overview
The `parafac4microbiome` package enables R users with an easy way to create Parallel Factor Analysis (PARAFAC) models for longitudinal microbiome data.
- `processDataCube()` can be used to process the microbiome count data appropriately for a multi-way data array.
- `parafac()` allows the user to create a Parallel Factor Analysis model of the multi-way data array.
- `assessModelQuality()` helps the user select the appropriate number of components by randomly initializing many PARAFAC models and inspecting various metrics of interest.
- `assessModelStability()` helps the user select the appropriate number of components by bootstrapping or jack-knifing samples and inspecting if the model outcome is similar.
- `plotPARAFACmodel()` helps visually inspect the PARAFAC model.
This package also comes with three example datasets.
- `Fujita2023`: an in-vitro experiment of ocean inocula on peptide medium, sampled every day for 110 days ().
- `Shao2019`: a large cohort dataset of vaginally and caesarean-section born infants from London ().
- `vanderPloeg2024`: a small gingivitis intervention dataset with response groups ().
## Documentation
A basic introduction to the package is given in `vignette("Introduction")` and modelling the example datasets are elaborated in their respective vignettes `vignette("Fujita2023")`, `vignette("Shao2019")` and `vignette("vanderPloeg2024")`.
These vignettes and all function documentation can be found [here](https://grvanderploeg.com/parafac4microbiome/).
## Installation
The `parafac4microbiome` package can be installed from CRAN using:
``` r
install.packages("parafac4microbiome")
```
## Development version
You can install the development version of `parafac4microbiome` from [GitHub](https://github.com/) with:
``` r
# install.packages("devtools")
devtools::install_github("GRvanderPloeg/parafac4microbiome")
```
## Citation
Please use the following citation when using this package:
- van der Ploeg, G. R., Westerhuis, J., Heintz-Buschart, A., & Smilde, A. (2025). parafac4microbiome: Exploratory analysis of longitudinal microbiome data using Parallel Factor Analysis. mSystems 10:e00472-25.
## Usage
```{r usage}
library(parafac4microbiome)
set.seed(123)
# Process the data cube
processedFujita = processDataCube(Fujita2023,
sparsityThreshold=0.99,
CLR=TRUE,
centerMode=1,
scaleMode=2)
# Make a PARAFAC model
model = parafac(processedFujita$data, nfac=3, nstart=10, output="best")
# Sign flip components to make figure interpretable and comparable to the paper.
# This has no effect on the model or the fit.
model$Fac[[1]][,2] = -1 * model$Fac[[1]][,2] # sign flip mode 1 component 2
model$Fac[[2]][,1] = -1 * model$Fac[[2]][,1] # sign flip mode 2 component 1
model$Fac[[2]][,3] = -1 * model$Fac[[2]][,3] # sign flip mode 2 component 3
model$Fac[[3]] = -1 * model$Fac[[3]] # sign flip all of mode 3
# Plot the PARAFAC model using some metadata
plotPARAFACmodel(model$Fac, processedFujita,
numComponents = 3,
colourCols = c("", "Genus", ""),
legendTitles = c("", "Genus", ""),
xLabels = c("Replicate", "Feature index", "Time point"),
legendColNums = c(0,5,0),
arrangeModes = c(FALSE, TRUE, FALSE),
continuousModes = c(FALSE,FALSE,TRUE),
overallTitle = "Fujita PARAFAC model")
```
## Getting help
If you encounter an unexpected error or a clear bug, please file an issue with a minimal reproducible example here on [Github](https://github.com/GRvanderPloeg/parafac4microbiome/issues). For questions or other types of feedback, feel free to send an email.
Owner
- Login: GRvanderPloeg
- Kind: user
- Repositories: 1
- Profile: https://github.com/GRvanderPloeg
GitHub Events
Total
- Release event: 3
- Watch event: 3
- Push event: 53
- Fork event: 1
- Create event: 3
Last Year
- Release event: 3
- Watch event: 3
- Push event: 53
- Fork event: 1
- Create event: 3
Packages
- Total packages: 1
-
Total downloads:
- cran 361 last-month
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 5
- Total maintainers: 1
cran.r-project.org: parafac4microbiome
Parallel Factor Analysis Modelling of Longitudinal Microbiome Data
- Homepage: https://grvanderploeg.com/parafac4microbiome/
- Documentation: http://cran.r-project.org/web/packages/parafac4microbiome/parafac4microbiome.pdf
- License: MIT + file LICENSE
-
Latest release: 1.3.2
published 7 months ago
Rankings
Dependent packages count: 28.2%
Dependent repos count: 34.7%
Average: 49.8%
Downloads: 86.6%
Maintainers (1)
Last synced:
6 months ago
Dependencies
.github/workflows/test-coverage.yaml
actions
- actions/checkout v4 composite
- actions/upload-artifact v4 composite
- r-lib/actions/setup-r v2 composite
- r-lib/actions/setup-r-dependencies v2 composite
DESCRIPTION
cran
- R >= 2.10 depends
- compositions * imports
- cowplot * imports
- doParallel * imports
- dplyr * imports
- foreach * imports
- ggplot2 * imports
- ggpubr * imports
- magrittr * imports
- methods * imports
- multiway * imports
- parallel * imports
- stats * imports
- tidyr * imports
- vctrs * imports
- knitr * suggests
- rmarkdown * suggests
- testthat >= 3.0.0 suggests
- withr * suggests
.github/workflows/R-CMD-check.yaml
actions
- actions/checkout v4 composite
- r-lib/actions/check-r-package v2 composite
- r-lib/actions/setup-r v2 composite
- r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/test-coverage.yaml.bak
actions
- actions/checkout v4 composite
- actions/upload-artifact v4 composite
- r-lib/actions/setup-r v2 composite
- r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/pkgdown.yaml
actions
- JamesIves/github-pages-deploy-action v4.5.0 composite
- actions/checkout v4 composite
- r-lib/actions/setup-pandoc v2 composite
- r-lib/actions/setup-r v2 composite
- r-lib/actions/setup-r-dependencies v2 composite