Miscellaneous R functions, with a focus on microbiome data analysis. Inspired by kylebittinger/kylemisc.
See the docs for more info.
Agglomerates the sample metadata, counts, and taxa info into one melted df.
Default BLAST outfmt 6 column names
Test for an OTU's (inverse) correlation between its abundance and amplicon concentration.
Creates a chunk for a plot with a given figure height and width.
Find the dimensions of a ggplot2 heatmap.
Uses the number of columns and number of rows in a heatmap to fix the
Find the mode of a logical or numeric vector
Set zeros to NA
Create a named vector using the values from one column in the second.
Uses a Dirichlet multinomial distribution to test for OTUs in the first
Reads an output file from BLAST in the outfmt=6 format (tab delimited)
Reorder levels of subtaxa by parent taxa
Saturated rainbow for counts
Saturated rainbow for proportions
Grouped color palette for factors
Subset a (counts) matrix based on the column from a dataframe.
Finds the lowest taxonomic rank that isn't NA, stopping at `end`.