useDynLib(rbiom, C_alpha_div, C_beta_div, C_pthreads, C_rarefy, C_read_tree, C_unifrac)
  
importFrom("ape", "pcoa")
importFrom("emmeans", "emmeans", "emtrends", "eff_size")

importFrom("dplyr", 
           ".data", "any_of", "mutate", "pull", "rename", "select", 
           "slice", "slice_head", "slice_tail", "slice_min", "slice_max", "slice_sample",
           "filter", "relocate", "across", "everything", "left_join")

importFrom("fillpattern", "fill_pattern", "scale_fill_pattern")
importFrom("ggbeeswarm", "geom_beeswarm", "geom_quasirandom")
importFrom("ggnewscale", "new_scale_fill")
importFrom("ggplot2", "aes")
importFrom("ggrepel", "geom_label_repel")
importFrom("ggtext", "element_markdown", "geom_textbox")
importFrom("jsonlite", "base64_enc", "read_json", "toJSON")
importFrom("magrittr","%>%", "%<>%")
importFrom("methods", "as", "formalArgs")
importFrom("patchwork", "free", "inset_element", "wrap_plots")
importFrom("parallelly", "availableCores")
importFrom("pillar", "tbl_sum", "glimpse")
importFrom("plyr", ".", "ddply", "ldply", "llply")

importFrom("stats", 
           "as.formula", "median", "na.omit", "p.adjust", "runif", 
           "sd", "setNames", "t.test", "var")

importFrom("readr", "read_delim")
importFrom("readxl", "read_excel")

importFrom("slam", 
           "simple_triplet_matrix", "as.simple_triplet_matrix", "is.simple_triplet_matrix",
           "col_sums", "row_sums", "rollup")

importFrom("utils",
           "capture.output", "combn", "download.file", "getFromNamespace", "hasName", 
           "head", "object.size", "packageVersion", "read.table", "str", "tail", 
           "write.csv", "write.table")


export(`adiv_boxplot`)
export(`adiv_corrplot`)
export(`adiv_matrix`)
export(`adiv_stats`)
export(`adiv_table`)
export(`as_rbiom`)
export(`bdiv_boxplot`)
export(`bdiv_clusters`)
export(`bdiv_corrplot`)
export(`bdiv_distmat`)
export(`bdiv_heatmap`)
export(`bdiv_matrix`)
export(`bdiv_ord_plot`)
export(`bdiv_ord_table`)
export(`bdiv_stats`)
export(`bdiv_table`)
export(`bdply`)
export(`biom_merge`)
export(`blply`)
export(`convert_to_phyloseq`)
export(`convert_to_SE`)
export(`convert_to_TSE`)
export(`distmat_ord_table`)
export(`distmat_stats`)
export(`plot_heatmap`)
export(`rare_corrplot`)
export(`rare_multiplot`)
export(`rare_stacked`)
export(`rarefy`)
export(`rarefy_cols`)
export(`read_biom`)
export(`read_fasta`)
export(`read_tree`)
export(`rescale_cols`)
export(`rescale_rows`)
export(`sample_apply`)
export(`sample_sums`)
export(`stats_boxplot`)
export(`stats_corrplot`)
export(`stats_table`)
export(`subset_taxa`)
export(`taxa_apply`)
export(`taxa_boxplot`)
export(`taxa_clusters`)
export(`taxa_corrplot`)
export(`taxa_heatmap`)
export(`taxa_map`)
export(`taxa_matrix`)
export(`taxa_max`)
export(`taxa_means`)
export(`taxa_stacked`)
export(`taxa_stats`)
export(`taxa_sums`)
export(`taxa_table`)
export(`tree_subset`)
export(`write_biom`)
export(`write_counts`)
export(`write_fasta`)
export(`write_metadata`)
export(`write_mothur`)
export(`write_qiime2`)
export(`write_taxonomy`)
export(`write_tree`)
export(`write_xlsx`)


# Deprecated functions
export(`alpha.div`)
export(`as.percent`)
export(`beta.div`)
export(`comments`)
export(`comments<-`)
export(`counts`)
export(`counts<-`)
export(`depth`)
export(`depths_barplot`)
export(`has.phylogeny`)
export(`has.sequences`)
export(`id`)
export(`id<-`)
export(`info`)
export(`is.rarefied`)
export(`metadata`)
export(`metadata<-`)
export(`nsamples`)
export(`ntaxa`)
export(`phylogeny`)
export(`phylogeny<-`)
export(`rarefy`)
export(`read.biom`)
export(`read_biom`)
export(`read.fasta`)
export(`read.tree`)
export(`repair`)
export(`sample.names`)
export(`sample.names<-`)
export(`sample_subset`)
export(`sample.sums`)
export(`sequences`)
export(`sequences<-`)
export(`subtree`)
export(`taxa.means`)
export(`taxa.names`)
export(`taxa.names<-`)
export(`taxa.ranks`)
export(`taxa.ranks<-`)
export(`taxa.rollup`)
export(`taxa.sums`)
export(`taxonomy`)
export(`taxonomy<-`)
export(`tips`)
export(`top.taxa`)
export(`top_taxa`)
export(`unifrac`)
export(`write.biom`)
export(`write.fasta`)
export(`write.tree`)
export(`write.xlsx`)



S3method(as_rbiom,     rbiom)
S3method(as_rbiom,     phyloseq)
S3method(as_rbiom,     SummarizedExperiment)
S3method(as_rbiom,     TreeSummarizedExperiment)
S3method(as_rbiom,     default)
S3method("[",          rbiom)
S3method(as.list,      rbiom)
S3method(as.matrix,    rbiom)
S3method(glimpse,      rbiom)
S3method(mutate,       rbiom)
S3method(na.omit,      rbiom)
S3method(pull,         rbiom)
S3method(rename,       rbiom)
S3method(subset,       rbiom)
S3method(slice,        rbiom)
S3method(slice_head,   rbiom)
S3method(slice_tail,   rbiom)
S3method(slice_min,    rbiom)
S3method(slice_max,    rbiom)
S3method(slice_sample, rbiom)
S3method(with,         rbiom)
S3method(within,       rbiom)
S3method(tbl_sum,      rbiom_tbl)
S3method("$",          rbiom_tbl)
S3method("$",          rbiom_plot)
S3method(print,        rbiom_code)

# Deprecated S3 functions
S3method(select, rbiom)

# Re-exports
export(".")
export("%>%")
export("%<>%")
export("availableCores")
export("ddply")
export("glimpse")
export("left_join")
export("ldply")
export("llply")
export("mutate")
export("na.omit")
export("pull")
export("relocate")
export("rename")
export("select")
export("slice")
export("slice_head")
export("slice_tail")
export("slice_min")
export("slice_max")
export("slice_sample")
