Developer Guide - LebeerLab/tidytacos GitHub Wiki

Package Guidelines

This page contains some guidelines for people that want to develop new tidytacos functions or extend existing functions.

A tidytacos object should obey the following rules:

  • It should be a list containing at least the following items:
    • A tibble named "samples", with a column "sample_id" containing unique values
    • A tibble named "taxa", with a column "taxon_id" containing unique values; all taxon ids should occur in the count table
    • A tibble named "counts", with a column "taxon_id" and a column "sample_id"; all taxon ids should occur in the taxon table and all sample ids should occur in the sample table
  • A tidytacos object should contain a "class" attribute with at least "tidytacos" as item.
  • The count table should not contain counts of zero.

A typical tidytacos function takes a tidytacos object as first argument and returns a tidytacos object. This makes it easy to construct "pipe chains" with tidytacos functions. Many tidytacos functions calculate an extra variable that is a property of the samples or taxa of the tidytacos object. These functions should be named "add_", where refers to the variable being created.

When a tidytacos function needs some other information that can easily be calculated but is not yet present in the tidytacos object, it should calculate said information without permanently adding it to the tidytacos object. For example:

Some naming conventions:

  • Tidytacos functions that return a plot should be named "tacoplot_" where is the name of the specific plot. For example: tacoplot_stack returns a stacked bar plot of the most abundant taxa.
⚠️ **GitHub.com Fallback** ⚠️