Giter Club home page Giter Club logo

metaphlantophyloseq's Introduction

metaphlanToPhyloseq

GitHub Release License Issues - metaphlanToPhyloseq Made with R Made with R

Overview

metaphlanToPhyloseq is a simple R package to transform MetaPhlAn 4 taxonomic microbiome abundance profiles into the right format for easy creation of a phyloseq object.

Installation

You can install the development version of metaphlanToPhyloseq from GitHub with:

# install.packages("devtools")
devtools::install_github("jrotzetter/metaphlanToPhyloseq", build_vignettes = TRUE)

Alternatively you can also use the pak package:

# install.packages("pak")
pak::pak("jrotzetter/metaphlanToPhyloseq")

Or the remotes package:

# install.packages("remotes")
remotes::install_github("jrotzetter/metaphlanToPhyloseq", build_vignettes = TRUE)

Dependencies

  • dplyr (>= 1.1.4)
  • phyloseq (>= 1.46.0)
  • utils

Usage

library(metaphlanToPhyloseq)

# Filter data to only include the specified taxonomic rank
single_profile <- filter_taxa_lvl(df = single_abundance_profile, taxa_lvl = "Genus")
merged_profiles <- filter_taxa_lvl(df = merged_abundance_profiles, taxa_lvl = "s")

# Keep only the columns of interest (clade_name and relative_abundance)
single_profile <- single_profile[, c(1, 3)]

# Create a phyloseq object
physeq_single <- metaphlan_to_phyloseq(
    mtphlan_profile = single_profile,
    taxa_lvl = "genus",
    use_taxa_names = TRUE,
    merged_profiles = FALSE
)

physeq_merged <- metaphlan_to_phyloseq(
  merged_profiles,
  taxa_lvl = "Species"
)

# Above steps are optional as the filtering to a specific taxonomic rank can be
# done directly from within the function or not at all
physeq <- metaphlan_to_phyloseq(
  merged_abundance_profiles,
  taxa_lvl = NULL,
  use_taxa_names = TRUE
)

For more details please see vignette("metaphlanToPhyloseq") or the help pages in the documentation. Both are also available online at https://jrotzetter.github.io/metaphlanToPhyloseq/.

Planned features

  • Add valid, package-specific maintainer e-mail address
  • Add unit tests
  • Potential CRAN submission after further maturation and expansion of the package (tree support, visualisations) in the future

Getting help

If you encounter a bug, please file an issue with a minimal reproducible example on GitHub. For questions or help with MetaPhlAn, please visit the corresponding bioBakery forum. For help with phyloseq, helpful tutorials and articles can be found on GitHub.

License

Released under MIT by @jrotzetter.

This license means:

  • You can freely copy, modify, distribute and reuse this software.
  • The original license must be included with copies of this software.
  • Please link back to this repo if you use a significant portion of the source code.
  • The software is provided β€œas is”, without warranty of any kind.

metaphlantophyloseq's People

Contributors

jrotzetter avatar

Watchers

 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.