# Associate Microbial Prevalence, Specificity, and Abundance with Gene Presence

## Documentation for package ‘phylogenize’ version 2.0.0.0001

- DESCRIPTION file.

## Help Pages

add.below.LOD | Add in taxa that were not observed, assuming this means they were zero-prevalence.
add.sig.descs | Add gene descriptions to significant results; return in a tibble.
adjust.db | Clean up imported database.
alt.multi.enrich | An alternative way to get the enrichment table, using a tbl of results instead of separate inputs for significant results, effect signs, etc.
calc.alpha.power | Calculate the FPR and (1 - FNR) for results of a set of tests.
calc.ess | Main function to calculate environmental specificity scores.
check.process.metadata | Check and process metadata
clean.pheno | Remove taxa from a phenotype that aren't in our trees and gene matrices (usually only necessary for testing).
do.clust.plot | Make a hybrid tree-heatmap plot showing the taxon distribution of significant hits.
do.fisher | Wrapper around 'fisher.test' that starts with string vectors instead of a contingency table.
gene.annot | Annotate genes using a gene-to-function table.
get.pheno.plotting.scales | Get phenotype plotting scales.
get.top.N | Return the significant hits with the N smallest p-values.
get.vsearch.results | Read in results from vsearch.
gg.cont.tree | Plot continuous trait on a tree.
harmonize.abd.meta | Check metadata and abundance matrix against one another
import.pz.db | Import the data necessary for *phylogenize* analysis.
install.data.figshare | Download data from figshare (or provide it locally) and un-gzip it into the package directory so that it can be imported.
kable.recolor | Function to obtain HTML colors for a particular value.
keep.tips | Keep some tips on a tree.
lm.fx.pv | Wrapper around _lm_ that returns just the effect size and p-value.
logistic | Calculate inverse-logit of a value or vector of values.
logit | Calculate logit of a value or vector of values.
make.pos.sig | Get vectors of significant genes with positive effect sizes.
make.results.matrix | Convert results into a long (vs. wide) format.
make.signs | Get effect sizes of genes from result tables.
make.sigs | Get vectors of significant genes from result tables.
matrix.plm | Perform phylogenetic (or linear) modeling for a single taxon.
multi.enrich | Given lists of significant genes (at different thresholds), effect sizes, and gene set mappings, assemble a tbl of results.
non.interactive.plot | A fall-back plotting option for when 'hack.tree.labels' fails, designed to produce the same kind of output.
nonequiv.pos.sig | Get vectors of significant genes with positive effect sizes.
nonparallel.results.generator | Fit phylogenetic (or linear) models (single core version, single taxon).
output.enr.table | Make a pretty enrichment table.
phylolm.fx.pv | Wrapper around _phylolm_ that returns just the effect size and p-value.
plot.labeled.phenotype.trees | Edit a list of plotted trees to add fancy highlight labels.
plot.pheno.distributions | Plot distributions of a phenotype across taxa.
plot.phenotype.trees | Plot a phenotype along a list of trees.
prepare.vsearch.input | Prepare input file for alignment
prev.addw | Main function to calculate taxon prevalences with additive smoothing.
process.16s | Map denoised 16S sequence variants to MIDAS IDs using vsearch.
pv1 | Fix p-values that are above 1.
pz.error | Throw an error and optionally log it in errmsg.txt.
pz.message | Report a message and optionally log it in errmsg.txt.
pz.options | Set and get options for phylogenize.
pz.warning | Report a warning and optionally log it in errmsg.txt.
read.abd.metadata | Read in abundance and metadata file(s).
remove.allzero.abundances | Remove rows and columns of a matrix that are all zero.
result.wrapper.plm | Fit phylogenetic (or linear) models, or perform POMS.
results.report | Create a summary table giving how many tests were significant.
retain.observed.taxa | Modify trees to retain only observed taxa (for use with specificity only).
run.vsearch | Run vsearch analysis on a FASTA file of sequences.
sanity.check.abundance | Sanity-check abundance data
sanity.check.metadata | Check that dataset, environment, and sample columns all present
set_data_internal | Set data directory to internal
single.cluster.plot | Make a hybrid tree-heatmap plot showing the taxon distribution of significant hits.
sum.nonunique.vsearch | Sum non-unique rows after vsearch mapping.
tax.annot | Annotate taxa using a taxonomy table.
tbl.result.qvs | Get q-values for results in tbl format.
threshold.pos.sigs | Filter out genes that are almost always present or absent.