Giter Site home page Giter Site logo

phyloseq-extras's Introduction

Functions and scripts that make microbiome data analysis using phyloseq easier. Compatible with phyloseq version 1.24.0

Functions to help with use of phyloseq (functions folder)

negative control functions.R: Contains four functions; the first removes OTUs identified as contaminants in a single step and outputs the new phyloseq object. If the user wishes to examine the abundance and/or identity of the contaminant OTUs before removing them, use one of the other functions instead. The function assumes there is a column named "Control_type" in the sample_data() slot of the physeq input which designates whether or not samples are controls. See annotations under "remove_contaminants" function for other assumptions about each argument (in particular the assumption about the ratio argument).

taxa_abundance function.R: Outputs dataframe similar to the plot_bar() function that comes with phyloseq (using the justDF = T option). However, this function gives the additional option to set a cutoff for the most abundant taxa in the given taxonomic rank (e.g. "Phylum"); any taxa that are below this cutoff will be relabeled as "Other" and grouped together as the same color in the bar graph. This makes it easier for the user to control how the graph looks and how many colors are needed for the stacked bars. This function assumes the user has already converted abundance to relative abundance if desired.

phyloseq_NA_tax function.R: Replaces NAs in phyloseq object taxonomy table with the name of lowest identified taxonomic level. Useful to prep for taxa_abundance function.

get_taxonomy function.R: Simple function to access full taxonomy from tax_table for a vector of OTU IDs.

Example graphs and workflows that use the above functions (demos folder)

negative control removal example.R: A workflow example of my functions for removing OTUs identified as potential contaminants found in negative controls (see "negative control functions.R" above). Uses the GlobalPatterns data set, and for demonstration purposes treats the mock community samples like negative controls.

taxa_abundance_demo.Rmd: A workflow example of how to use the taxa_abundance and phyloseq_NA_tax functions. See the HTML output here: http://htmlpreview.github.io/?https://github.com/EISprague/phyloseq-extras/blob/master/demos/taxa_abundance_demo.html

phyloseq-extras's People

Contributors

eisprague avatar

Watchers

James Cloos 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.