metacoder v0.1.2


Monthly downloads



by Zachary Foster

Tools for Parsing, Manipulating, and Graphing Hierarchical Data

A set of tools for parsing, manipulating, and graphing data classified by a hierarchy (e.g. a taxonomy).


Build Status

An R package for metabarcoding research planning and analysis

Metabarcoding is revolutionizing microbial ecology and presenting new challenges:

  • Numerous database formats make taxonomic data difficult to parse, combine, and subset.
  • Stacked bar charts, commonly used to depict community diversity, lack taxonomic context.
  • Barcode loci and primers are a source of under-explored bias.

MetacodeR is an R package that attempts to addresses these issues:

  • Sources of taxonomic data can be extracted from any file format and manipulated.
  • Community diversity can be visualized by color and size in a tree plot.
  • Primer specificity can be estimated with in silico PCR.


Documentation is under construction at

Download the current version

While this project is in development it can be installed through Github:

devtools::install_github(repo="grunwaldlab/metacoder", build_vignettes = TRUE)

If you've built the vignettes, you can browse them with:



The function that runs in silico PCR requires primersearch from the EMBOSS tool kit to be installed. This is not an R package, so it is not automatically installed. Type ?primersearch after installing and loading MetcodeR for installation instructions.


We are about to submit the mansucript to a pre-print server followed by submission for peer-review. Meanwhile, cite:

ZSL Foster, TJ Sharpton and NJ Grünwald. 2016. MetacodeR: An R package for manipulation and heat tree visualization of community taxonomic data from metabarcoding. BioRxiv, to be submitted.

Functions in metacoder

Name Description
arrange_obs Sort columns of taxmap objects
class_from_name Retrieve classifications from taxon names
class_from_class Parse embedded classifications
bryophytes_ex_data Example dataset of bryophytes
add_alpha add_alpha
arrange_taxa Sort columns of taxmap objects
apply_color_scale Covert numbers to colors
class_from_taxon_id Retrieve classifications from taxon IDs
class_from_obs_id Retrieve classifications from observation IDs
check_element_length Check length of graph attributes
diverging_palette The defualt diverging color palette
DNAbin_to_char Converts DNAbin to a named character vector
contaminants Example dataset of comtamination
edge_list_depth Get distance from root of edgelist observations
delete_vetices_and_children delete_vetices_and_children
convert_numeric_cols Convert columns to numeric if appropriate
count_capture_groups Count capture groups
drawDetails.resizingTextGrob Draws a resizingTextGrob
class_to_taxonomy List of classifications to taxonomy tree
contains dplyr select_helpers
get_edge_children get_edge_children
extract_taxonomy Extract taxonomy information from sequence headers
everything dplyr select_helpers
format_taxon_subset Format taxon subset value
genbank_ex_data Fungal ITS Genbank refseq
get_class_from_el Get classification for taxa in edge list
get_edge_parents get_edge_parents
ends_with dplyr select_helpers
get_id_from_name Get taxon ID from name
fasta_headers Get line numbers of FASTA headers
get_name_from_id Get taxon name from ID
hierarchies Get classification of taxa
get_node_children get_node_children
get_taxonomy_levels Get taxonomy levels
get_optimal_range Find optimal range
%>% magrittr forward-pipe operator
heat_tree Plot a taxonomic tree
inter_circle_gap Finds the gap/overlap of circle coordinates
its1_ex_data Example of ITS1 fungal data
inverse Generate the inverse of a function
molten_dist Get all distances beween points
mutate_obs Add columns to taxmap objects
matches dplyr select_helpers
metacoder Metacoder
make_text_grobs Create a list of text grobs
make_plot_legend Make color/size legend
make_new_ids Generate new unique IDs
map_unique Run a function on unique values of a iterable
layout_functions Layout functions
line_coords Makes coordinates for a line
num_range dplyr select_helpers
obs_data_colnames Get column names of obs_data
parse_primersearch Parse EMBOSS primersearch output
n_subtaxa_1 Get number of subtaxa
n_obs Count observations in taxmap
parse_summary_seqs Parse summary.seqs output
quantative_palette The defualt quantative color palette
read_fasta Read a FASTA file
rdp_ex_data Example of RDP Archea data
read_lines_apply Apply a function to chunks of a file
split_by_level Splits a taxonomy at a specific level or rank
mutate_taxa Add columns to taxmap objects
split_class_list Split a list of classifications by a row/column value
parse_taxonomy_table Parse taxonomic data in a tsv/csv file
n_obs_1 Count observation assigned in taxmap
plot_alignment Display sequence alignment
postDrawDetails.resizingTextGrob Clean up after the drawing.
polygon_coords Makes coordinates for a regualr polygon
run_primersearch Execute EMBOSS Primerseach
sample_frac_obs Sample a proportion of observations from taxmap
sample_n_taxa Sample n taxa from taxmap
obs_data_cols_used Get names of obs_data in an unevaluated expression
primersearch Use EMBOSS primersearch for in silico PCR
obs_data Return observation data from taxmap
primersearch_is_installed Test if primersearch is installed
roots Get root taxa
resizingTextGrob Adds text grob that scales with viewport size
subtaxa Get all subtaxa of a taxon
starts_with dplyr select_helpers
taxon_data_colnames Get column names of taxon_data
recursive_sample Recursivly sample observations with a heirarchical classification
remove_redundant_names Remove the redundant taxon names
taxonomic_sample Recursivly sample a set of taxonomic assignments
taxon_data Return taxon data from taxmap
verify_color_range Verify color range parameters
validate_regex_match Check that all match input
ncbi_sequence Downloads sequences from ids
ncbi_taxon_sample Download representative sequences for a taxon
parse_hmp_qiime Parse HMP QIIME results
parse_mothur_summary Parse mothur classification summary file
pr2_ex_data Example of PR2 SSU data
preDrawDetails.resizingTextGrob Adjusts text size to viewport
rescale Rescale numeric vector to have specified minimum and maximum.
rename_duplicated Number duplicated names
silva_ex_data Example dataset from SILVA
select_labels Pick labels to show
obs Get observations associated with taxa
n_subtaxa Get number of subtaxa
one_of dplyr select_helpers
n_supertaxa Get number of supertaxa
print.taxmap Print a taxmap object
qualitative_palette The defualt qualitative color palette
sample_n_obs Sample n observations from taxmap
sample_frac_taxa Sample a proportion of taxa from taxmap
transmute_obs Replace columns in taxmap objects
transform_data Transformation functions
taxon_data_cols_used Get names of taxon_data in an unevaluated expression
unite_ex_data_2 Example of UNITE fungal ITS data
unite_ex_data_1 Example of UNITE fungal ITS data
scale_bar_coords Make scale bar division
text_grob_length Estimate text grob length
taxonomy_ranks Get ordered ranks from taxonomy
verify_label_count Verify label count
verify_size_range Verify size range parameters
verify_trans Verify transformation function parameters
verify_size Verify size parameters
transmute_taxa Replace columns in taxmap objects
unique_mapping get indexes of a unique set of the input
vigilant_report Report a error/warning if needed
supertaxa Get all supertaxa of a taxon
taxmap Create an instance of taxmap
unite_ex_data_3 Example of UNITE fungal ITS data
validate_regex_key_pair Check a regex-key pair
No Results!

Last month downloads


License GPL-2 | GPL-3
LazyData true
VignetteBuilder knitr
RoxygenNote 5.0.1
Date 2016-08-01
Encoding UTF-8
NeedsCompilation no
Packaged 2016-08-26 20:21:09 UTC; USDA-ARS\fosterz
Repository CRAN
Date/Publication 2016-08-27 00:35:09

Include our badge in your README