├── .Rbuildignore ├── .github └── workflows │ └── rhub.yaml ├── .gitignore ├── .travis.yml ├── CRAN-SUBMISSION ├── DESCRIPTION ├── LICENSE ├── NAMESPACE ├── NEWS.md ├── R ├── RcppExports.R ├── as_phyloseq.R ├── calculations--differential_abundance.R ├── calculations--internal.R ├── calculations.R ├── dataset_documentation.R ├── heat_tree--internal.R ├── heat_tree--layouts.R ├── heat_tree--legend.R ├── heat_tree--mapping.R ├── heat_tree--resizing_text.R ├── heat_tree--shape_generators.R ├── heat_tree--vertex_size.R ├── heat_tree.R ├── heat_tree_matrix.R ├── imports.R ├── internal.R ├── metacoder-package.R ├── mothur.R ├── old_taxa--dataset_documentation.R ├── old_taxa--globals.R ├── old_taxa--hierarchies.R ├── old_taxa--hierarchy.R ├── old_taxa--imports.R ├── old_taxa--internal.R ├── old_taxa--lazyhelpers.R ├── old_taxa--package.R ├── old_taxa--taxa.R ├── old_taxa--taxmap--class.R ├── old_taxa--taxmap--docs.R ├── old_taxa--taxmap--internal.R ├── old_taxa--taxmap--option_parsers.R ├── old_taxa--taxmap--parsers.R ├── old_taxa--taxmap--printers.R ├── old_taxa--taxmap--s3.R ├── old_taxa--taxon.R ├── old_taxa--taxon_database.R ├── old_taxa--taxon_id.R ├── old_taxa--taxon_name.R ├── old_taxa--taxon_rank.R ├── old_taxa--taxonomy--class.R ├── old_taxa--taxonomy--docs.R ├── old_taxa--taxonomy--internal.R ├── old_taxa--taxonomy--s3.R ├── old_taxa--temp.R ├── old_taxa--zzz.R ├── option_parsers.R ├── parsers.R ├── primersearch.R ├── read_fasta.R ├── remove_ambiguous.R ├── sequence_download.R ├── startup.R ├── tools.R └── writers.R ├── README.Rmd ├── README.md ├── cran-comments.md ├── data ├── ex_taxmap.rda ├── hmp_otus.rda ├── hmp_samples.rda └── ranks_ref.rda ├── hex_sticker ├── hex_sticker.png ├── hex_sticker.svg ├── hex_sticker_tree.R └── hex_sticker_tree.svg ├── inst ├── CITATION └── extdata │ ├── .gitignore │ └── silva_subset.fa ├── man ├── DNAbin_to_char.Rd ├── add_alpha.Rd ├── all_functions.Rd ├── all_names.Rd ├── ambiguous_patterns.Rd ├── ambiguous_synonyms.Rd ├── apply_color_scale.Rd ├── arrange_obs.Rd ├── arrange_taxa.Rd ├── as_id.Rd ├── as_phyloseq.Rd ├── branches.Rd ├── calc_diff_abund_deseq2.Rd ├── calc_group_mean.Rd ├── calc_group_median.Rd ├── calc_group_rsd.Rd ├── calc_group_stat.Rd ├── calc_n_samples.Rd ├── calc_obs_props.Rd ├── calc_prop_samples.Rd ├── calc_taxon_abund.Rd ├── can_be_num.Rd ├── can_be_used_in_taxmap.Rd ├── capitalize.Rd ├── check_class_col.Rd ├── check_element_length.Rd ├── check_for_pkg.Rd ├── check_option_groups.Rd ├── check_taxmap_data.Rd ├── classifications.Rd ├── compare_groups.Rd ├── complement.Rd ├── contains.Rd ├── convert_base.Rd ├── correct_taxon_names.Rd ├── count_capture_groups.Rd ├── counts_to_presence.Rd ├── data_used.Rd ├── database_list.Rd ├── desc_font.Rd ├── diverging_palette.Rd ├── do_calc_on_num_cols.Rd ├── dot-onAttach.Rd ├── edge_list_depth.Rd ├── ends_with.Rd ├── error_font.Rd ├── everything.Rd ├── ex_hierarchies.Rd ├── ex_hierarchy1.Rd ├── ex_hierarchy2.Rd ├── ex_hierarchy3.Rd ├── ex_taxmap.Rd ├── extract_tax_data.Rd ├── fasta_headers.Rd ├── figures │ └── readme_figure.jpg ├── filter_ambiguous_taxa.Rd ├── filter_obs.Rd ├── filter_taxa.Rd ├── filtering-helpers.Rd ├── get_class_from_el.Rd ├── get_data.Rd ├── get_data_frame.Rd ├── get_database_name.Rd ├── get_dataset.Rd ├── get_dots_or_list.Rd ├── get_edge_children.Rd ├── get_edge_parents.Rd ├── get_expected_data.Rd ├── get_node_children.Rd ├── get_numeric_cols.Rd ├── get_numerics.Rd ├── get_optimal_range.Rd ├── get_sort_var.Rd ├── get_taxmap_cols.Rd ├── get_taxmap_data.Rd ├── get_taxmap_other_cols.Rd ├── get_taxmap_table.Rd ├── get_taxonomy_levels.Rd ├── grapes-greater-than-grapes.Rd ├── heat_tree.Rd ├── heat_tree_matrix.Rd ├── hierarchies.Rd ├── hierarchy.Rd ├── highlight_taxon_ids.Rd ├── hmp_otus.Rd ├── hmp_samples.Rd ├── id_classifications.Rd ├── init_taxmap_data.Rd ├── inter_circle_gap.Rd ├── internodes.Rd ├── inverse.Rd ├── is_ambiguous.Rd ├── is_branch.Rd ├── is_internode.Rd ├── is_leaf.Rd ├── is_root.Rd ├── is_stem.Rd ├── label_bounds.Rd ├── layout_functions.Rd ├── leaves.Rd ├── leaves_apply.Rd ├── length_of_thing.Rd ├── limited_print.Rd ├── line_coords.Rd ├── look_for_na.Rd ├── lookup_tax_data.Rd ├── make_dada2_asv_table.Rd ├── make_dada2_tax_table.Rd ├── make_fasta_with_u_replaced.Rd ├── make_plot_legend.Rd ├── map_data.Rd ├── map_data_.Rd ├── map_unique.Rd ├── matches.Rd ├── metacoder.Rd ├── molten_dist.Rd ├── multi_sep_split.Rd ├── mutate_obs.Rd ├── my_print.Rd ├── n_leaves.Rd ├── n_leaves_1.Rd ├── n_obs.Rd ├── n_obs_1.Rd ├── n_subtaxa.Rd ├── n_subtaxa_1.Rd ├── n_supertaxa.Rd ├── n_supertaxa_1.Rd ├── name_font.Rd ├── names_used.Rd ├── ncbi_sequence.Rd ├── ncbi_taxon_sample.Rd ├── num_range.Rd ├── obs.Rd ├── obs_apply.Rd ├── one_of.Rd ├── parse_dada2.Rd ├── parse_dataset.Rd ├── parse_edge_list.Rd ├── parse_greengenes.Rd ├── parse_heirarchies_to_taxonomy.Rd ├── parse_mothur_tax_summary.Rd ├── parse_mothur_taxonomy.Rd ├── parse_newick.Rd ├── parse_phylo.Rd ├── parse_phyloseq.Rd ├── parse_possibly_named_logical.Rd ├── parse_primersearch.Rd ├── parse_qiime_biom.Rd ├── parse_raw_heirarchies_to_taxonomy.Rd ├── parse_rdp.Rd ├── parse_seq_input.Rd ├── parse_silva_fasta.Rd ├── parse_summary_seqs.Rd ├── parse_tax_data.Rd ├── parse_ubiome.Rd ├── parse_unite_general.Rd ├── polygon_coords.Rd ├── prefixed_print.Rd ├── primersearch.Rd ├── primersearch_is_installed.Rd ├── primersearch_raw.Rd ├── print__character.Rd ├── print__data.frame.Rd ├── print__default_.Rd ├── print__factor.Rd ├── print__integer.Rd ├── print__list.Rd ├── print__logical.Rd ├── print__matrix.Rd ├── print__numeric.Rd ├── print__ordered.Rd ├── print__tbl_df.Rd ├── print__vector.Rd ├── print_item.Rd ├── print_tree.Rd ├── progress_lapply.Rd ├── punc_font.Rd ├── qualitative_palette.Rd ├── quantative_palette.Rd ├── ranks_ref.Rd ├── rarefy_obs.Rd ├── read_fasta.Rd ├── read_lines_apply.Rd ├── remove_redundant_names.Rd ├── replace_taxon_ids.Rd ├── repo_url.Rd ├── rescale.Rd ├── rev_comp.Rd ├── reverse.Rd ├── roots.Rd ├── run_primersearch.Rd ├── sample_frac_obs.Rd ├── sample_frac_taxa.Rd ├── sample_n_obs.Rd ├── sample_n_taxa.Rd ├── scale_bar_coords.Rd ├── select_labels.Rd ├── select_obs.Rd ├── simplify.Rd ├── split_by_level.Rd ├── starts_with.Rd ├── startup_msg.Rd ├── stems.Rd ├── subtaxa.Rd ├── subtaxa_apply.Rd ├── supertaxa.Rd ├── supertaxa_apply.Rd ├── taxa.Rd ├── taxmap.Rd ├── taxon.Rd ├── taxon_database.Rd ├── taxon_id.Rd ├── taxon_ids.Rd ├── taxon_indexes.Rd ├── taxon_name.Rd ├── taxon_names.Rd ├── taxon_rank.Rd ├── taxon_ranks.Rd ├── taxonomy.Rd ├── taxonomy_table.Rd ├── text_grob_length.Rd ├── tid_font.Rd ├── to_percent.Rd ├── transform_data.Rd ├── transmute_obs.Rd ├── unique_mapping.Rd ├── validate_regex_key_pair.Rd ├── validate_regex_match.Rd ├── validate_taxmap_funcs.Rd ├── verify_color_range.Rd ├── verify_label_count.Rd ├── verify_size.Rd ├── verify_size_range.Rd ├── verify_taxmap.Rd ├── verify_trans.Rd ├── write_greengenes.Rd ├── write_mothur_taxonomy.Rd ├── write_rdp.Rd ├── write_silva_fasta.Rd ├── write_unite_general.Rd └── zero_low_counts.Rd ├── metacoder.Rproj ├── scratch ├── .gitignore ├── arrange_taxa_gc_weirdness.Rmd ├── default_plotting.Rmd ├── example.phyloseq ├── figure.svg ├── figure_text.Rmd ├── hmp_example_data.Rmd ├── in_silico_pcr_data.Rmd ├── issue_123--warning_for_invalid_class_regex.Rmd ├── issue_127--heat_tree_inf_usage.Rmd ├── issue_140.Rmd ├── issue_141--phyloseq_converter.Rmd ├── issue_328.R ├── resizing_text_test.Rmd ├── search_ncbi.R ├── silva_subset.fa ├── taxon_abund_optimize.Rmd ├── test.RData └── vocabulary.Rmd ├── src ├── RcppExports.cpp └── repel_boxes.cpp ├── tests ├── testthat.R └── testthat │ ├── example_data │ ├── dada2.RData │ ├── gg_seq_example.fa │ ├── gg_tax_example.txt │ ├── mothur_summary.txt │ ├── newick_example_1.txt │ ├── nexus_example_1.nex │ ├── rdp_example.fa │ ├── silva_example.fa │ ├── small_abund_mat.tsv │ └── unite_general.fa │ ├── test--calculations.R │ ├── test--heat_tree.R │ ├── test--parsers_and_writers.R │ ├── test--simulated_pcr.R │ ├── test--taxa.R │ ├── test--taxmap.R │ ├── test--taxmap_parsers.R │ ├── test--taxonomy.R │ ├── test-taxon.R │ ├── test-taxon_id.R │ ├── test-taxon_name.R │ └── test-taxon_rank.R └── vignettes └── introduction.Rmd /.Rbuildignore: -------------------------------------------------------------------------------- 1 | ^\.travis\.yml$ 2 | ^README\.html$ 3 | ^README\.Rmd$ 4 | ^.+\.Rproj$ 5 | ^\.Rproj\.user$ 6 | ^scratch$ 7 | ^\.gitignore$ 8 | ^\.Rhistory$ 9 | ^cran-comments\.md$ 10 | ^readme_figure\.png$ 11 | ^LICENSE$ 12 | ^README_files$ 13 | ^hex_sticker$ 14 | ^CRAN-RELEASE$ 15 | ^CRAN-SUBMISSION$ 16 | .github 17 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .Rproj.user* 2 | .Rproj.user 3 | .Rhistory 4 | .RData 5 | *_cache 6 | vignettes/*_files*/ 7 | vignettes/.build.timestamp 8 | trainset10_082014.rdp.fasta 9 | **.html 10 | inst/doc/vignettes_info.* 11 | .pdf 12 | big_data/** 13 | scratch 14 | inst/doc 15 | 16 | # Compiled objects 17 | **.o 18 | **.so 19 | **.dll 20 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: r 2 | r: 3 | - release 4 | 5 | r_github_packages: 6 | - jimhester/covr 7 | 8 | r_check_args: "--as-cran" 9 | 10 | before_install: 11 | - Rscript -e "install.packages('BiocManager')" 12 | - Rscript -e "BiocManager::install(c('zlibbioc', 'phyloseq', 'biomformat'), version = '3.12')" 13 | 14 | # bioc_required: false 15 | # bioc_use_devel: true 16 | # bioc-packages: BiocManager, zlibbioc, phyloseq, biomformat 17 | 18 | sudo: false 19 | cran: http://cran.at.r-project.org 20 | 21 | cache: packages 22 | 23 | os: 24 | - linux 25 | 26 | after_success: 27 | - Rscript -e 'library(covr);codecov()' 28 | 29 | notifications: 30 | email: 31 | on_success: change 32 | on_failure: always 33 | 34 | 35 | -------------------------------------------------------------------------------- /CRAN-SUBMISSION: -------------------------------------------------------------------------------- 1 | Version: 0.3.8 2 | Date: 2025-02-07 23:49:53 UTC 3 | SHA: 5903d8d485afb70d21fff93a42af56246a4e2b84 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Zachary S.L. Foster and Niklaus J. Grunwald 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | Permission to incorporate this software into commercial products may be 10 | obtained by contacting USDA ARS and OREGON STATE UNIVERSITY Office for 11 | Commercialization and Corporate Development. 12 | 13 | The software program and documentation are supplied "as is", without any 14 | accompanying services from the USDA or the University. USDA ARS or the 15 | University do not warrant that the operation of the program will be 16 | uninterrupted or error-free. The end-user understands that the program was 17 | developed for research purposes and is advised not to rely exclusively on the 18 | program for any reason. 19 | 20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /R/dataset_documentation.R: -------------------------------------------------------------------------------- 1 | #' A HMP subset 2 | #' 3 | #' A subset of the Human Microbiome Project abundance matrix produced by QIIME. 4 | #' It contains OTU ids, taxonomic lineages, and the read counts for 50 samples. 5 | #' See \code{\link{hmp_samples}} for the matching dataset of sample information. 6 | #' 7 | #' The 50 samples were randomly selected such that there were 10 in each of 5 8 | #' treatments: "Saliva", "Throat", "Stool", "Right_Antecubital_fossa", 9 | #' "Anterior_nares". For each treatment, there were 5 samples from men and 5 10 | #' from women. 11 | #' 12 | #' @name hmp_otus 13 | #' @format A 1,000 x 52 tibble. 14 | #' @source Subset from data available at https://www.hmpdacc.org/hmp/HMQCP/ 15 | #' @family hmp_data 16 | #' @keywords data 17 | NULL 18 | 19 | 20 | #' Sample information for HMP subset 21 | #' 22 | #' The sample information for a subset of the Human Microbiome Project data. It 23 | #' contains the sample ID, sex, and body site for each sample in the abundance 24 | #' matrix stored in \code{\link{hmp_otus}}. The "sample_id" column corresponds 25 | #' to the column names of \code{\link{hmp_otus}}. 26 | #' 27 | #' The 50 samples were randomly selected such that there were 10 in each of 5 28 | #' treatments: "Saliva", "Throat", "Stool", "Right_Antecubital_fossa", 29 | #' "Anterior_nares". For each treatment, there were 5 samples from men and 5 30 | #' from women. "Right_Antecubital_fossa" was renamed to "Skin" and 31 | #' "Anterior_nares" to "Nose". 32 | #' 33 | #' @name hmp_samples 34 | #' @format A 50 x 3 tibble. 35 | #' @source Subset from data available at https://www.hmpdacc.org/hmp/HMQCP/ 36 | #' @family hmp_data 37 | #' @keywords data 38 | NULL 39 | -------------------------------------------------------------------------------- /R/heat_tree--resizing_text.R: -------------------------------------------------------------------------------- 1 | #' Estimate text grob length 2 | #' 3 | #' Estimate the printed length of `resizingTextGrob` text 4 | #' 5 | #' @param text \code{character} The text to be printed 6 | #' @param rot The rotation in radians 7 | #' 8 | #' @return The estimated length of the printed text as a multiple of its text size (height) 9 | #' 10 | #' @keywords internal 11 | text_grob_length <- function(text, rot = 0) { 12 | do_one <- function(text) { 13 | as.numeric(grid::widthDetails(grid::textGrob(text, rot = rot * 180 / pi))) / as.numeric(grid::heightDetails(grid::textGrob(text))) * .8 14 | } 15 | vapply(text, do_one, numeric(1)) 16 | } 17 | 18 | -------------------------------------------------------------------------------- /R/imports.R: -------------------------------------------------------------------------------- 1 | #' magrittr forward-pipe operator 2 | #' @name %>% 3 | #' @importFrom magrittr %>% 4 | #' @export 5 | #' @keywords internal 6 | NULL 7 | 8 | 9 | #' dplyr select_helpers 10 | #' @name starts_with 11 | #' @importFrom dplyr starts_with 12 | #' @export 13 | #' @keywords internal 14 | NULL 15 | 16 | #' dplyr select_helpers 17 | #' @name ends_with 18 | #' @importFrom dplyr ends_with 19 | #' @export 20 | #' @keywords internal 21 | NULL 22 | 23 | #' dplyr select_helpers 24 | #' @name contains 25 | #' @importFrom dplyr contains 26 | #' @export 27 | #' @keywords internal 28 | NULL 29 | 30 | #' dplyr select_helpers 31 | #' @name matches 32 | #' @importFrom dplyr matches 33 | #' @export 34 | #' @keywords internal 35 | NULL 36 | 37 | #' dplyr select_helpers 38 | #' @name num_range 39 | #' @importFrom dplyr num_range 40 | #' @export 41 | #' @keywords internal 42 | NULL 43 | 44 | #' dplyr select_helpers 45 | #' @name one_of 46 | #' @importFrom dplyr one_of 47 | #' @export 48 | #' @keywords internal 49 | NULL 50 | 51 | #' dplyr select_helpers 52 | #' @name everything 53 | #' @importFrom dplyr everything 54 | #' @export 55 | #' @keywords internal 56 | NULL 57 | -------------------------------------------------------------------------------- /R/mothur.R: -------------------------------------------------------------------------------- 1 | #=================================================================================================== 2 | #' Parse summary.seqs output 3 | #' 4 | #' Extract statistics from the command line output of mothur command \code{summary.seqs} and 5 | #' return the results in a \code{data.frame} 6 | #' 7 | #' @param text The text output of \code{summary.seqs} 8 | #' @param file The path to saved output of \code{summary.seqs} 9 | #' 10 | #' @return A \code{data.frame} of statistics 11 | #' 12 | #' @keywords internal 13 | parse_summary_seqs <- function(text = NULL, file = NULL) { 14 | # Parse arguments 15 | if (sum(missing(text), missing(file)) != 1) 16 | stop("Either 'text' or 'file' must be specified, but not both") 17 | if (!missing(file)) text = readLines(file) 18 | # Split into lines 19 | text <- unlist(strsplit(text, split = "\n", fixed = TRUE)) 20 | # Subset the lines with statistics 21 | text <- text[17:25] 22 | # Remove extra tab on header line 23 | text[1] <- gsub("\\t\\t", "\\\t", text[1]) 24 | # Add missing tab onto 'mean' line 25 | text[length(text)] <- paste0(text[length(text)], "\t") 26 | # Parse into a data.frame 27 | utils::read.table(text = text, sep = "\t", header = TRUE, row.names = 1) 28 | } 29 | -------------------------------------------------------------------------------- /R/old_taxa--globals.R: -------------------------------------------------------------------------------- 1 | if (getRversion() >= "2.15.1") { 2 | utils::globalVariables('ranks_ref') 3 | } 4 | -------------------------------------------------------------------------------- /R/old_taxa--hierarchies.R: -------------------------------------------------------------------------------- 1 | #' Make a set of many [hierarchy()] class objects 2 | #' 3 | #' NOTE: This will soon be depreciated. 4 | #' Make a set of many [hierarchy()] class objects. 5 | #' This is just a thin wrapper over a standard list. 6 | #' 7 | #' @export 8 | #' @param ... Any number of object of class [hierarchy()] 9 | #' @param .list Any number of object of class [hierarchy()] in a list 10 | #' 11 | #' @family classes 12 | #' 13 | #' @return An `R6Class` object of class [hierarchy()] 14 | hierarchies <- function(..., .list = NULL) { 15 | # Get intput 16 | input <- get_dots_or_list(..., .list = .list) 17 | 18 | if (!all(vapply(input, inherits, logical(1), what = "Hierarchy"))) { 19 | stop("all inputs to 'hierarchies' must be of class 'Hierarchy'", 20 | call. = FALSE) 21 | } 22 | structure(input, class = "hierarchies") 23 | } 24 | 25 | #' @export 26 | print.hierarchies <- function(x, ...) { 27 | cat("", "\n") 28 | cat(" no. hierarchies: ", length(x), "\n") 29 | if (length(x)) { 30 | for (i in seq_along(x[1:min(10, length(x))])) { 31 | if (is.null(x[[i]]$taxa)) { 32 | cat(" Empty hierarchy", sep = "\n") 33 | } else { 34 | cat( 35 | paste0(" ", paste0(vapply(x[[i]]$taxa, function(x) x$name$name, ""), 36 | collapse = " / ")), 37 | "\n" 38 | ) 39 | } 40 | } 41 | } 42 | if (length(x) > 10) cat(" ...") 43 | } 44 | -------------------------------------------------------------------------------- /R/old_taxa--imports.R: -------------------------------------------------------------------------------- 1 | #' magrittr forward-pipe operator 2 | #' @name %>% 3 | #' @importFrom magrittr %>% 4 | #' @export 5 | #' @keywords internal 6 | NULL 7 | 8 | 9 | #' dplyr select_helpers 10 | #' @name starts_with 11 | #' @importFrom dplyr starts_with 12 | #' @export 13 | #' @keywords internal 14 | NULL 15 | 16 | #' dplyr select_helpers 17 | #' @name ends_with 18 | #' @importFrom dplyr ends_with 19 | #' @export 20 | #' @keywords internal 21 | NULL 22 | 23 | #' dplyr select_helpers 24 | #' @name contains 25 | #' @importFrom dplyr contains 26 | #' @export 27 | #' @keywords internal 28 | NULL 29 | 30 | #' dplyr select_helpers 31 | #' @name matches 32 | #' @importFrom dplyr matches 33 | #' @export 34 | #' @keywords internal 35 | NULL 36 | 37 | #' dplyr select_helpers 38 | #' @name num_range 39 | #' @importFrom dplyr num_range 40 | #' @export 41 | #' @keywords internal 42 | NULL 43 | 44 | #' dplyr select_helpers 45 | #' @name one_of 46 | #' @importFrom dplyr one_of 47 | #' @export 48 | #' @keywords internal 49 | NULL 50 | 51 | #' dplyr select_helpers 52 | #' @name everything 53 | #' @importFrom dplyr everything 54 | #' @export 55 | #' @keywords internal 56 | NULL 57 | -------------------------------------------------------------------------------- /R/old_taxa--taxa.R: -------------------------------------------------------------------------------- 1 | #' A class for multiple taxon objects 2 | #' 3 | #' Stores one or more [taxon()] objects. This is just a thin wrapper for a list 4 | #' of [taxon()] objects. 5 | #' 6 | #' This is the documentation for the class called `taxa`. If you are looking for 7 | #' the documentation for the package as a whole: [taxa-package]. 8 | #' 9 | #' @export 10 | #' @param ... Any number of object of class [taxon()] 11 | #' @param .list An alternate to the `...` input. Any number of object of class 12 | #' [taxon()]. Cannot be used with `...`. 13 | #' @return An `R6Class` object of class `Taxon` 14 | #' @family classes 15 | #' @examples 16 | #' (a <- taxon( 17 | #' name = taxon_name("Poa annua"), 18 | #' rank = taxon_rank("species"), 19 | #' id = taxon_id(93036) 20 | #' )) 21 | #' taxa(a, a, a) 22 | #' 23 | #' # a null set 24 | #' x <- taxon(NULL) 25 | #' taxa(x, x, x) 26 | #' 27 | #' # combo non-null and null 28 | #' taxa(a, x, a) 29 | taxa <- function(..., .list = NULL) { 30 | tt <- get_dots_or_list(..., .list = .list) 31 | if (!all(vapply(tt, inherits, logical(1), what = "Taxon"))) { 32 | stop("all inputs to 'taxa' must be of class 'Taxon'", 33 | call. = FALSE) 34 | } 35 | structure(tt, class = "taxa") 36 | } 37 | 38 | #' @export 39 | print.taxa <- function(x, ...) { 40 | cat("", "\n") 41 | cat(" no. taxa: ", length(x), "\n") 42 | if (length(x)) { 43 | if (all(vapply(x, function(z) z$is_empty(), logical(1)))) { 44 | cat(" empty set", "\n") 45 | } else { 46 | for (i in seq_along(x[1:min(10, length(x))])) { 47 | if (x[[i]]$is_empty()) { 48 | cat(" empty", "\n") 49 | } else { 50 | cat( 51 | sprintf(" %s / %s / %s", 52 | x[[i]]$name$name %||% "", 53 | x[[i]]$rank$name %||% "", 54 | x[[i]]$id$id %||% "" 55 | ), "\n") 56 | } 57 | } 58 | } 59 | } 60 | if (length(x) > 10) cat(" ...") 61 | } 62 | -------------------------------------------------------------------------------- /R/old_taxa--taxon_id.R: -------------------------------------------------------------------------------- 1 | #' Taxon ID class 2 | #' 3 | #' Used to store taxon IDs, either arbitrary or from a taxonomy database. This 4 | #' is typically used to store taxon IDs in [taxon()] objects. 5 | #' 6 | #' @export 7 | #' @param id (character/integer/numeric) a taxonomic id, required 8 | #' @param database (database) database class object, optional 9 | #' 10 | #' @return An `R6Class` object of class `TaxonId` 11 | #' @family classes 12 | #' 13 | #' @examples 14 | #' (x <- taxon_id(12345)) 15 | #' x$id 16 | #' x$database 17 | #' 18 | #' (x <- taxon_id( 19 | #' 12345, 20 | #' database_list$ncbi 21 | #' )) 22 | #' x$id 23 | #' x$database 24 | #' 25 | #' # a null taxon_name object 26 | #' taxon_name(NULL) 27 | taxon_id <- function(id, database = NULL) { 28 | TaxonId$new( 29 | id = id, 30 | database = database 31 | ) 32 | } 33 | 34 | TaxonId <- R6::R6Class( 35 | "TaxonId", 36 | public = list( 37 | id = NULL, 38 | database = NULL, 39 | 40 | initialize = function(id = NULL, database = NULL) { 41 | assert(id, c("character", "integer", "numeric")) 42 | assert(database, c("character", "TaxonDatabase")) 43 | 44 | # Convert characters to appropriate classes 45 | if (is.character(database)) { 46 | database <- taxon_database(database) 47 | } 48 | 49 | self$id <- id 50 | self$database <- database 51 | }, 52 | 53 | print = function(indent = "") { 54 | cat(paste0(indent, sprintf(" %s\n", self$id %||% "none"))) 55 | cat(paste0(indent, paste0(" database: ", 56 | get_database_name(self$database) %||% "none", 57 | "\n"))) 58 | invisible(self) 59 | } 60 | ) 61 | ) 62 | -------------------------------------------------------------------------------- /R/old_taxa--taxon_name.R: -------------------------------------------------------------------------------- 1 | #' Taxon name class 2 | #' 3 | #' Used to store the name of taxa. This is typically used to 4 | #' store where taxon names in [taxon()] objects. 5 | #' 6 | #' @export 7 | #' @param name (character) a taxonomic name. required 8 | #' @param database (character) database class object, optional 9 | #' 10 | #' @return An `R6Class` object of class `TaxonName` 11 | #' 12 | #' @family classes 13 | #' @examples 14 | #' (poa <- taxon_name("Poa")) 15 | #' (undef <- taxon_name("undefined")) 16 | #' (sp1 <- taxon_name("species 1")) 17 | #' (poa_annua <- taxon_name("Poa annua")) 18 | #' (x <- taxon_name("Poa annua L.")) 19 | #' 20 | #' x$name 21 | #' x$database 22 | #' 23 | #' (x <- taxon_name( 24 | #' "Poa annua", 25 | #' database_list$ncbi 26 | #' )) 27 | #' x$rank 28 | #' x$database 29 | #' 30 | #' # a null taxon_name object 31 | #' taxon_name(NULL) 32 | taxon_name <- function(name, database = NULL) { 33 | TaxonName$new( 34 | name = name, 35 | database = database 36 | ) 37 | } 38 | 39 | TaxonName <- R6::R6Class( 40 | "TaxonName", 41 | public = list( 42 | name = NULL, 43 | database = NULL, 44 | 45 | initialize = function( 46 | name = NULL, database = NULL 47 | ) { 48 | assert(name, "character") 49 | assert(database, c("character", "TaxonDatabase")) 50 | 51 | # Convert characters to appropriate classes 52 | if (is.character(database)) { 53 | database <- taxon_database(database) 54 | } 55 | 56 | self$name <- name 57 | self$database <- database 58 | }, 59 | 60 | print = function(indent = "") { 61 | cat(paste0(indent, sprintf(" %s\n", self$name %||% "none"))) 62 | cat(paste0(indent, paste0(" database: ", 63 | get_database_name(self$database) %||% "none", 64 | "\n"))) 65 | invisible(self) 66 | } 67 | ) 68 | ) 69 | -------------------------------------------------------------------------------- /R/old_taxa--taxon_rank.R: -------------------------------------------------------------------------------- 1 | #' Taxon rank class 2 | #' 3 | #' Stores the rank of a taxon. This is typically used to store where taxon 4 | #' information came from in [taxon()] objects. 5 | #' 6 | #' @export 7 | #' @param name (character) rank name. required 8 | #' @param database (character) database class object, optional 9 | #' 10 | #' @return An `R6Class` object of class `TaxonRank` 11 | #' @family classes 12 | #' 13 | #' @examples 14 | #' taxon_rank("species") 15 | #' taxon_rank("genus") 16 | #' taxon_rank("kingdom") 17 | #' 18 | #' (x <- taxon_rank( 19 | #' "species", 20 | #' database_list$ncbi 21 | #' )) 22 | #' x$rank 23 | #' x$database 24 | #' 25 | #' # a null taxon_name object 26 | #' taxon_name(NULL) 27 | taxon_rank <- function(name, database = NULL) { 28 | TaxonRank$new( 29 | name = name, 30 | database = database 31 | ) 32 | } 33 | 34 | TaxonRank <- R6::R6Class( 35 | "TaxonRank", 36 | public = list( 37 | name = NULL, 38 | database = NULL, 39 | 40 | initialize = function(name = NULL, database = NULL) { 41 | assert(name, c("character", "TaxonName")) 42 | assert(database, c("character", "TaxonDatabase")) 43 | 44 | # Convert characters to appropriate classes 45 | if (is.character(database)) { 46 | database <- taxon_database(database) 47 | } 48 | 49 | self$name <- name 50 | self$database <- database 51 | }, 52 | 53 | print = function(indent = "") { 54 | cat(paste0(indent, sprintf(" %s\n", self$name %||% "none"))) 55 | cat(paste0(indent, paste0(" database: ", 56 | get_database_name(self$database) %||% "none", 57 | "\n"))) 58 | invisible(self) 59 | } 60 | ) 61 | ) 62 | -------------------------------------------------------------------------------- /R/old_taxa--temp.R: -------------------------------------------------------------------------------- 1 | 2 | # file_path <- system.file("extdata", "unite_general_release.fasta", package = "metacoder") 3 | # sequences <- ape::read.FASTA(file_path) 4 | # library(taxa) # The parsers in taxa are used 5 | # unite_ex_data_2 <- extract_tax_data(names(sequences)[1], 6 | # regex = "^(.*)\\|(.*)\\|(.*)\\|.*\\|(.*)$", 7 | # key = c(seq_name = "info", seq_id = "info", 8 | # other_id = "info", my_class = "class"), 9 | # class_regex = "^(.*)__(.*)$", 10 | # class_key = c(unite_rank = "info", my_name = "taxon_name"), 11 | # class_sep = ";", 12 | # database = "ncbi") 13 | -------------------------------------------------------------------------------- /R/old_taxa--zzz.R: -------------------------------------------------------------------------------- 1 | ct <- function(l) Filter(Negate(is.null), l) 2 | 3 | `%||%` <- function(x, y) { 4 | if (is.null(x)) y else x 5 | } 6 | 7 | add_names <- function(...) { 8 | tt <- sapply(match.call(), deparse)[-1] 9 | nms <- unname(sapply(tt, function(x) strsplit(x, split = "\\$")[[1]][2])) 10 | stats::setNames(list(...), nms) 11 | } 12 | 13 | # assert <- function(x, y) { 14 | # if (!is.null(x)) { 15 | # if (!class(x) %in% y) { 16 | # stop(deparse(substitute(x)), " must be of class ", 17 | # paste0(y, collapse = ", "), call. = FALSE) 18 | # } 19 | # } 20 | # } 21 | 22 | assert <- function(x, y) { 23 | if (!is.null(x)) { 24 | if (!any(class(x) %in% y)) { 25 | stop(deparse(substitute(x)), " must be of class ", 26 | paste0(y, collapse = ", "), call. = FALSE) 27 | } 28 | } 29 | } 30 | 31 | csep2vec <- function(z, uniq = TRUE) { 32 | tmp <- unlist(lapply(z, function(w) strsplit(w, split = ",")[[1]]), FALSE) 33 | if (uniq) return(unique(tmp)) 34 | return(tmp) 35 | } 36 | 37 | strex <- function(str, pattern) regmatches(str, regexpr(pattern, str)) 38 | -------------------------------------------------------------------------------- /R/startup.R: -------------------------------------------------------------------------------- 1 | #' Return startup message 2 | #' 3 | #' Return startup message 4 | #' 5 | #' @keywords internal 6 | startup_msg <- function() { 7 | my_version <- utils::packageVersion("metacoder") 8 | is_devel <- stringr::str_count(as.character(my_version), "\\.") == 3 9 | paste0('This is metacoder version ', my_version, ' ', 10 | ifelse(is_devel, crayon::bold("(development version)"), "(stable)"))#, 11 | # '. If you use metacoder for published research, please cite our paper:\n\n', 12 | # 'Foster Z, Sharpton T and Grunwald N (2017). "Metacoder: An R package for', 13 | # ' visualization and manipulation of community taxonomic diversity data." ', 14 | # crayon::italic('PLOS Computational Biology'), ', ', crayon::bold('13'), 15 | # '(2), pp. 1-15. doi: 10.1371/journal.pcbi.1005404\n\n', 16 | # 'Enter `citation("metacoder")` for a BibTeX entry for this citation.') 17 | } 18 | 19 | 20 | #' Run when package loads 21 | #' 22 | #' Run when package loads 23 | #' 24 | #' @keywords internal 25 | .onAttach <- function(libname, pkgname) { 26 | packageStartupMessage(startup_msg()) 27 | } 28 | -------------------------------------------------------------------------------- /cran-comments.md: -------------------------------------------------------------------------------- 1 | ## Test environments and check results 2 | 3 | ### Local computer: Pop!_OS 22.04 LTS, R version 4.4.2 4 | 5 | 0 errors | 0 warnings | 1 notes 6 | 7 | ❯ checking dependencies in R code ... NOTE 8 | Namespace in Imports field not imported from: ‘R6’ 9 | All declared Imports should be used. 10 | 11 | I am not sure why this note exists. I am using `R6::` in about 10 places in the package. 12 | All of the classes in the package are R6 classes, so it is definitely used. 13 | 14 | 15 | 16 | ### Winbuilder 17 | 18 | 0 errors | 0 warnings | 1 notes 19 | 20 | ``` 21 | * checking CRAN incoming feasibility ... [16s] NOTE 22 | Maintainer: 'Zachary Foster ' 23 | 24 | New submission 25 | 26 | Package was archived on CRAN 27 | 28 | CRAN repository db overrides: 29 | X-CRAN-Comment: Archived on 2024-10-01 as issues were not corrected 30 | in time. 31 | 32 | Possibly misspelled words in DESCRIPTION: 33 | al (32:18) 34 | bioinformatics (30:16) 35 | et (32:15) 36 | metabarcoding (26:22) 37 | metagenomics (26:56, 27:5) 38 | microbiome (30:5) 39 | 40 | Suggests or Enhances not in mainstream repositories: 41 | traits 42 | ``` 43 | 44 | `metacoder` was removed from CRAN because it dependency `taxize` was removed from CRAN. 45 | `taxize` is back on CRAN now, so `metacoder` is being resubmitted. 46 | The package `traits` was also removed from CRAN because it depends on `taxize` as well. 47 | It is only a suggested package for `metacoder` used for one function and I expect `traits` will be returned to CRAN as well soon. 48 | I am not sure if it is required for all packages in "Suggests" to be on CRAN or not. 49 | The "Possibly misspelled words" are all real words. 50 | 51 | 52 | ### Response to CRAN review 53 | 54 | I added Scott Chamberlain and Kamil Slowikowski to authors in the DESCRIPTION. -------------------------------------------------------------------------------- /data/ex_taxmap.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grunwaldlab/metacoder/e881d1bc67fd323d916ff2bb955b7a8d48bc4664/data/ex_taxmap.rda -------------------------------------------------------------------------------- /data/hmp_otus.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grunwaldlab/metacoder/e881d1bc67fd323d916ff2bb955b7a8d48bc4664/data/hmp_otus.rda -------------------------------------------------------------------------------- /data/hmp_samples.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grunwaldlab/metacoder/e881d1bc67fd323d916ff2bb955b7a8d48bc4664/data/hmp_samples.rda -------------------------------------------------------------------------------- /data/ranks_ref.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grunwaldlab/metacoder/e881d1bc67fd323d916ff2bb955b7a8d48bc4664/data/ranks_ref.rda -------------------------------------------------------------------------------- /hex_sticker/hex_sticker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grunwaldlab/metacoder/e881d1bc67fd323d916ff2bb955b7a8d48bc4664/hex_sticker/hex_sticker.png -------------------------------------------------------------------------------- /hex_sticker/hex_sticker_tree.R: -------------------------------------------------------------------------------- 1 | library(metacoder) 2 | x = parse_tax_data(hmp_otus, class_cols = "lineage", class_sep = ";", 3 | class_key = c(tax_rank = "info", tax_name = "taxon_name"), 4 | class_regex = "^(.+)__(.+)$") 5 | 6 | x$taxa[[1]]$name$name <- "metacoder" 7 | 8 | x %>% 9 | filter_taxa(n_supertaxa <= 3) %>% 10 | heat_tree(node_size = n_obs, 11 | node_color = n_obs, 12 | # node_color_range = c("#EEEEEE", "#999999"), 13 | # node_label = ifelse(is_root, taxon_names, NA), 14 | # node_label_size_range = c(.2, .2), 15 | make_node_legend = FALSE, 16 | output_file = "hex_sticker/hex_sticker_tree.svg") 17 | -------------------------------------------------------------------------------- /inst/CITATION: -------------------------------------------------------------------------------- 1 | bibentry(bibtype = "Article", 2 | title = "Metacoder: An R package for visualization and manipulation of community taxonomic diversity data.", 3 | author = c(person("Zachary", "Foster"), 4 | person("Thomas", "Sharpton"), 5 | person("Niklaus", "Grünwald")), 6 | journal = "PLOS Computational Biology", 7 | publisher = "Public Library of Science", 8 | year = "2017", 9 | month = "02", 10 | volume = "13", 11 | pages = "1-15", 12 | number = "2", 13 | doi = "10.1371/journal.pcbi.1005404", 14 | url = "https://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1005404") -------------------------------------------------------------------------------- /inst/extdata/.gitignore: -------------------------------------------------------------------------------- 1 | mothur.summary 2 | -------------------------------------------------------------------------------- /man/DNAbin_to_char.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/internal.R 3 | \name{DNAbin_to_char} 4 | \alias{DNAbin_to_char} 5 | \title{Converts DNAbin to a named character vector} 6 | \usage{ 7 | DNAbin_to_char(dna_bin) 8 | } 9 | \arguments{ 10 | \item{dna_bin}{(\code{DNAbin} of length 1) the input.} 11 | } 12 | \description{ 13 | Converts an object of class DNAbin (as produced by ape) to a named character vector. 14 | } 15 | \keyword{internal} 16 | -------------------------------------------------------------------------------- /man/add_alpha.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/internal.R 3 | \name{add_alpha} 4 | \alias{add_alpha} 5 | \title{add_alpha} 6 | \usage{ 7 | add_alpha(col, alpha = 1) 8 | } 9 | \description{ 10 | add_alpha 11 | } 12 | \keyword{internal} 13 | -------------------------------------------------------------------------------- /man/all_functions.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--taxmap--internal.R 3 | \name{all_functions} 4 | \alias{all_functions} 5 | \title{Get list of usable functions} 6 | \usage{ 7 | all_functions() 8 | } 9 | \value{ 10 | vector 11 | } 12 | \description{ 13 | Returns the names of all functions that can be called from any environment 14 | } 15 | \keyword{internal} 16 | -------------------------------------------------------------------------------- /man/ambiguous_patterns.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/remove_ambiguous.R 3 | \name{ambiguous_patterns} 4 | \alias{ambiguous_patterns} 5 | \title{Get patterns for ambiguous taxa} 6 | \usage{ 7 | ambiguous_patterns( 8 | unknown = TRUE, 9 | uncultured = TRUE, 10 | case_variations = FALSE, 11 | whole_match = FALSE, 12 | name_regex = "." 13 | ) 14 | } 15 | \arguments{ 16 | \item{unknown}{If \code{TRUE}, Remove taxa with names the suggest they are 17 | placeholders for unknown taxa (e.g. "unknown ...").} 18 | 19 | \item{uncultured}{If \code{TRUE}, Remove taxa with names the suggest they are 20 | assigned to uncultured organisms (e.g. "uncultured ...").} 21 | 22 | \item{case_variations}{If \code{TRUE}, include variations of letter case.} 23 | 24 | \item{whole_match}{If \code{TRUE}, add "^" to front and "$" to the back of each 25 | pattern to indicate they are to match whole words.} 26 | 27 | \item{name_regex}{The regex code to match a valid character in a taxon name. 28 | For example, "[a-z]" would mean taxon names can only be lower case letters.} 29 | } 30 | \description{ 31 | This function stores the regex patterns for ambiguous taxa. 32 | } 33 | \keyword{internal} 34 | -------------------------------------------------------------------------------- /man/ambiguous_synonyms.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/remove_ambiguous.R 3 | \name{ambiguous_synonyms} 4 | \alias{ambiguous_synonyms} 5 | \title{Get patterns for ambiguous taxa} 6 | \usage{ 7 | ambiguous_synonyms( 8 | unknown = TRUE, 9 | uncultured = TRUE, 10 | regex = TRUE, 11 | case_variations = FALSE 12 | ) 13 | } 14 | \arguments{ 15 | \item{unknown}{If \code{TRUE}, include names that suggest they are 16 | placeholders for unknown taxa (e.g. "unknown ...").} 17 | 18 | \item{uncultured}{If \code{TRUE}, include names that suggest they are 19 | assigned to uncultured organisms (e.g. "uncultured ...").} 20 | 21 | \item{regex}{If \code{TRUE}, includes regex syntax to make matching things like spaces more robust.} 22 | 23 | \item{case_variations}{If \code{TRUE}, include variations of letter case.} 24 | } 25 | \description{ 26 | This function stores the regex patterns for ambiguous taxa. 27 | } 28 | -------------------------------------------------------------------------------- /man/apply_color_scale.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/heat_tree--mapping.R 3 | \name{apply_color_scale} 4 | \alias{apply_color_scale} 5 | \title{Covert numbers to colors} 6 | \usage{ 7 | apply_color_scale( 8 | values, 9 | color_series, 10 | interval = NULL, 11 | no_color_in_palette = 1000 12 | ) 13 | } 14 | \arguments{ 15 | \item{values}{(\code{numeric}) The numbers to represent as colors} 16 | 17 | \item{color_series}{(\code{character}) Hex values or a character in \code{colors}} 18 | 19 | \item{interval}{(\code{numeric} of length 2) The range \code{values} could have taken.} 20 | 21 | \item{no_color_in_palette}{(\code{numeric} of length 1) The number of distinct colors to use.} 22 | } 23 | \value{ 24 | \code{character} Hex color codes. 25 | } 26 | \description{ 27 | Convert numbers to colors. 28 | If colors are already supplied, return the input 29 | } 30 | \keyword{internal} 31 | -------------------------------------------------------------------------------- /man/arrange_taxa.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--taxonomy--docs.R 3 | \name{arrange_taxa} 4 | \alias{arrange_taxa} 5 | \title{Sort the edge list of [taxmap()] objects} 6 | \arguments{ 7 | \item{obj}{[taxonomy()] or [taxmap()]} 8 | 9 | \item{...}{One or more expressions (e.g. column names) to sort on. Any 10 | variable name that appears in [all_names()] can be used as if it was a 11 | vector on its own.} 12 | } 13 | \value{ 14 | An object of type [taxonomy()] or [taxmap()] 15 | } 16 | \description{ 17 | Sort the edge list and taxon list in [taxonomy()] or [taxmap()] objects. See 18 | [dplyr::arrange()] for the inspiration for this function and more 19 | information. Calling the function using the `obj$arrange_taxa(...)` style 20 | edits "obj" in place, unlike most R functions. However, calling the function 21 | using the `arrange_taxa(obj, ...)` imitates R's traditional copy-on-modify 22 | semantics, so "obj" would not be changed; instead a changed version would be 23 | returned, like most R functions. 24 | \preformatted{ 25 | obj$arrange_taxa(...) 26 | arrange_taxa(obj, ...)} 27 | } 28 | \examples{ 29 | # Sort taxa in ascending order 30 | arrange_taxa(ex_taxmap, taxon_names) 31 | 32 | # Sort taxa in decending order 33 | arrange_taxa(ex_taxmap, desc(taxon_names)) 34 | 35 | # Sort using an expression. List genera first. 36 | arrange_taxa(ex_taxmap, taxon_ranks != "genus") 37 | 38 | } 39 | \seealso{ 40 | Other taxmap manipulation functions: 41 | \code{\link{arrange_obs}()}, 42 | \code{\link{filter_obs}()}, 43 | \code{\link{filter_taxa}()}, 44 | \code{\link{mutate_obs}()}, 45 | \code{\link{sample_frac_obs}()}, 46 | \code{\link{sample_frac_taxa}()}, 47 | \code{\link{sample_n_obs}()}, 48 | \code{\link{sample_n_taxa}()}, 49 | \code{\link{select_obs}()}, 50 | \code{\link{transmute_obs}()} 51 | } 52 | \concept{taxmap manipulation functions} 53 | -------------------------------------------------------------------------------- /man/as_id.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--taxmap--internal.R 3 | \name{as_id} 4 | \alias{as_id} 5 | \title{Convert a vector to database IDs} 6 | \usage{ 7 | as_id(ids, database, ...) 8 | } 9 | \arguments{ 10 | \item{ids}{The character or numeric vector of raw taxon IDs.} 11 | 12 | \item{database}{The database format to convert the IDs to. Either ncbi, 13 | itis, eol, col, tropicos, gbif, nbn, worms, natserv, bold, or wiki} 14 | 15 | \item{...}{Passed to \code{as.*id} function.} 16 | } 17 | \description{ 18 | This is a convenience function to convert to identifiers of various data 19 | sources. It wraps the \code{as.*id} functions in \code{\link[taxize]{taxize}} 20 | } 21 | \keyword{internal} 22 | -------------------------------------------------------------------------------- /man/can_be_num.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/internal.R 3 | \name{can_be_num} 4 | \alias{can_be_num} 5 | \title{Test if characters can be converted to numbers} 6 | \usage{ 7 | can_be_num(input) 8 | } 9 | \arguments{ 10 | \item{input}{A character vector} 11 | } 12 | \description{ 13 | Makes TRUE/FALSE vector 14 | } 15 | \keyword{internal} 16 | -------------------------------------------------------------------------------- /man/can_be_used_in_taxmap.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--taxmap--internal.R 3 | \name{can_be_used_in_taxmap} 4 | \alias{can_be_used_in_taxmap} 5 | \title{Check that a unknown object can be used with taxmap} 6 | \usage{ 7 | can_be_used_in_taxmap(obj) 8 | } 9 | \arguments{ 10 | \item{obj}{} 11 | } 12 | \value{ 13 | TRUE/FALSE 14 | } 15 | \description{ 16 | Check that a unknown object can be assigned taxon IDs and filtered. 17 | } 18 | \keyword{internal} 19 | -------------------------------------------------------------------------------- /man/capitalize.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/tools.R 3 | \name{capitalize} 4 | \alias{capitalize} 5 | \title{Capitalize} 6 | \usage{ 7 | capitalize(text) 8 | } 9 | \arguments{ 10 | \item{text}{Some text} 11 | } 12 | \description{ 13 | Make the first letter uppercase 14 | } 15 | \keyword{internal} 16 | -------------------------------------------------------------------------------- /man/check_class_col.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--taxmap--parsers.R 3 | \name{check_class_col} 4 | \alias{check_class_col} 5 | \title{Check for name/index in input data} 6 | \usage{ 7 | check_class_col(tax_data, column) 8 | } 9 | \arguments{ 10 | \item{tax_data}{A table, list, or vector that contain sequence IDs, taxon 11 | IDs, or taxon names. 12 | * tables: The `column` option must be used to specify which column 13 | contains the sequence IDs, taxon IDs, or taxon names. 14 | * lists: There must be only one item per list entry unless the `column` 15 | option is used to specify what item to use in each list entry. 16 | * vectors: simply a vector of sequence IDs, taxon IDs, or taxon names.} 17 | 18 | \item{column}{(`character` or `integer`) The name or index of the column that 19 | contains information used to lookup classifications. This only applies when 20 | a table or list is supplied to `tax_data`.} 21 | } 22 | \description{ 23 | Used by parse_tax_data and lookup_tax_data to check that columm/class_col is valid for the input data 24 | } 25 | \keyword{internal} 26 | -------------------------------------------------------------------------------- /man/check_element_length.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/heat_tree--internal.R 3 | \name{check_element_length} 4 | \alias{check_element_length} 5 | \title{Check length of graph attributes} 6 | \usage{ 7 | check_element_length(args) 8 | } 9 | \description{ 10 | Length should divind evenly into the number of taxon/parent IDs 11 | } 12 | \keyword{internal} 13 | -------------------------------------------------------------------------------- /man/check_for_pkg.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/internal.R, R/old_taxa--internal.R 3 | \name{check_for_pkg} 4 | \alias{check_for_pkg} 5 | \title{check for packages} 6 | \usage{ 7 | check_for_pkg(package) 8 | 9 | check_for_pkg(package) 10 | } 11 | \arguments{ 12 | \item{package}{The name of the package} 13 | } 14 | \value{ 15 | `TRUE` if package is present 16 | 17 | `TRUE` if package is present 18 | } 19 | \description{ 20 | check for packages, and stop if not installed. 21 | This function was written by Scott Chamerlain, from whom I shamelessly stole 22 | it. 23 | 24 | check for packages, and stop if not installed 25 | } 26 | \keyword{internal} 27 | -------------------------------------------------------------------------------- /man/check_option_groups.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/calculations--internal.R 3 | \name{check_option_groups} 4 | \alias{check_option_groups} 5 | \title{Check option: groups} 6 | \usage{ 7 | check_option_groups(groups, cols = NULL) 8 | } 9 | \arguments{ 10 | \item{groups}{The groups option to check} 11 | 12 | \item{cols}{The cols option, if applicable} 13 | } 14 | \description{ 15 | This option is used in a few of the calculation functions 16 | } 17 | \keyword{internal} 18 | -------------------------------------------------------------------------------- /man/check_taxmap_data.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--taxmap--internal.R 3 | \name{check_taxmap_data} 4 | \alias{check_taxmap_data} 5 | \title{Check dataset format} 6 | \usage{ 7 | check_taxmap_data(obj) 8 | } 9 | \arguments{ 10 | \item{obj}{A [taxmap()] object} 11 | } 12 | \description{ 13 | Check that the datasets in a [taxmap()] object are in the correct format. 14 | * Checks that column names are not the names of functions 15 | } 16 | \keyword{internal} 17 | -------------------------------------------------------------------------------- /man/complement.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/tools.R 3 | \name{complement} 4 | \alias{complement} 5 | \title{Find complement of sequences} 6 | \usage{ 7 | complement(seqs) 8 | } 9 | \arguments{ 10 | \item{seqs}{A character vector with one element per sequence.} 11 | } 12 | \description{ 13 | Find the complement of one or more sequences stored as a character 14 | vector. This is a wrapper for \code{\link[seqinr]{comp}} for character 15 | vectors instead of lists of character vectors with one value per letter. 16 | IUPAC ambiguity code are handled and the upper/lower case is preserved. 17 | } 18 | \examples{ 19 | 20 | complement(c("aagtgGGTGaa", "AAGTGGT")) 21 | 22 | } 23 | \seealso{ 24 | Other sequence transformations: 25 | \code{\link{rev_comp}()}, 26 | \code{\link{reverse}()} 27 | } 28 | \concept{sequence transformations} 29 | -------------------------------------------------------------------------------- /man/contains.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/imports.R, R/old_taxa--imports.R 3 | \name{contains} 4 | \alias{contains} 5 | \title{dplyr select_helpers} 6 | \description{ 7 | dplyr select_helpers 8 | 9 | dplyr select_helpers 10 | } 11 | \keyword{internal} 12 | -------------------------------------------------------------------------------- /man/convert_base.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/internal.R, R/old_taxa--internal.R 3 | \name{convert_base} 4 | \alias{convert_base} 5 | \title{Converts decimal numbers to other bases} 6 | \usage{ 7 | convert_base( 8 | numbers, 9 | symbols = letters, 10 | base = length(symbols), 11 | min_length = 0 12 | ) 13 | 14 | convert_base( 15 | numbers, 16 | symbols = letters, 17 | base = length(symbols), 18 | min_length = 0 19 | ) 20 | } 21 | \arguments{ 22 | \item{numbers}{One or more numbers to convert.} 23 | 24 | \item{symbols}{The set of symbols to use for the new base.} 25 | 26 | \item{base}{The base to convert to.} 27 | 28 | \item{min_length}{The minimum number of symbols in each result.} 29 | } 30 | \value{ 31 | character vector 32 | 33 | character vector 34 | } 35 | \description{ 36 | Converts from base 10 to other bases represented by a given set of symbols. 37 | 38 | Converts from base 10 to other bases represented by a given set of symbols. 39 | } 40 | \keyword{internal} 41 | -------------------------------------------------------------------------------- /man/correct_taxon_names.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--taxmap--parsers.R 3 | \name{correct_taxon_names} 4 | \alias{correct_taxon_names} 5 | \title{Look up official names from potentially misspelled names} 6 | \usage{ 7 | correct_taxon_names(names, database = "ncbi") 8 | } 9 | \arguments{ 10 | \item{names}{Potentially misspelled taxon names} 11 | 12 | \item{database}{The database the names are being looked up for. If `NULL`, do 13 | not consider database.} 14 | } 15 | \value{ 16 | vector of names 17 | } 18 | \description{ 19 | Look up official names from potentially misspelled names using Global Names 20 | Resolver (GNR). If a result from the chosen database is present, then it is 21 | used, otherwise the NCBI result is used and if that does not exist, then the 22 | first result is used. Names with no match will return NA. 23 | } 24 | \keyword{internal} 25 | -------------------------------------------------------------------------------- /man/count_capture_groups.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--taxmap--parsers.R 3 | \name{count_capture_groups} 4 | \alias{count_capture_groups} 5 | \title{Count capture groups} 6 | \source{ 7 | http://stackoverflow.com/questions/16046620/regex-to-count-the-number-of-capturing-groups-in-a-regex 8 | } 9 | \usage{ 10 | count_capture_groups(regex) 11 | } 12 | \arguments{ 13 | \item{regex}{(\code{character} of length 1)} 14 | } 15 | \value{ 16 | \code{numeric} of length 1 17 | } 18 | \description{ 19 | Count the number of capture groups in a regular expression. 20 | } 21 | \keyword{internal} 22 | -------------------------------------------------------------------------------- /man/data_used.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--taxonomy--docs.R 3 | \name{data_used} 4 | \alias{data_used} 5 | \title{Get values of data used in expressions} 6 | \arguments{ 7 | \item{obj}{a [taxonomy()] or [taxmap()] object} 8 | 9 | \item{...}{One or more expressions} 10 | } 11 | \value{ 12 | `list` 13 | } 14 | \description{ 15 | Get values available for 16 | [non-standard evaluation](http://adv-r.had.co.nz/Computing-on-the-language.html) 17 | in a [taxonomy()] or [taxmap()] object used in expressions. Expressions are 18 | not evaluated and do not need to make sense. 19 | \preformatted{ 20 | obj$data_used(...)} 21 | } 22 | \seealso{ 23 | Other NSE helpers: 24 | \code{\link{all_names}()}, 25 | \code{\link{get_data}()}, 26 | \code{\link{names_used}} 27 | } 28 | \concept{NSE helpers} 29 | \keyword{internal} 30 | -------------------------------------------------------------------------------- /man/database_list.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--taxon_database.R 3 | \docType{data} 4 | \name{database_list} 5 | \alias{database_list} 6 | \title{Database list} 7 | \format{ 8 | An object of class \code{list} of length 8. 9 | } 10 | \usage{ 11 | database_list 12 | } 13 | \description{ 14 | The list of known databases. Not currently used much, but will be when we add 15 | more check for taxon IDs and taxon ranks from particular databases. 16 | } 17 | \details{ 18 | List of databases with pre-filled details, where each has the 19 | format: 20 | \itemize{ 21 | \item url: A base URL for the database source. 22 | \item description: Description of the database source. 23 | \item id regex: identifier regex. 24 | } 25 | } 26 | \examples{ 27 | database_list 28 | database_list$ncbi 29 | database_list$ncbi$name 30 | database_list$ncbi$description 31 | database_list$ncbi$url 32 | } 33 | \seealso{ 34 | [taxon_database] 35 | } 36 | \keyword{datasets} 37 | -------------------------------------------------------------------------------- /man/desc_font.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--taxmap--printers.R 3 | \name{desc_font} 4 | \alias{desc_font} 5 | \title{Description formatting in print methods} 6 | \usage{ 7 | desc_font(text) 8 | } 9 | \arguments{ 10 | \item{text}{What to print} 11 | } 12 | \description{ 13 | A simple wrapper to make changing the formatting of text printed easier. 14 | This is used for non-data, formatting characters 15 | } 16 | \seealso{ 17 | Other printer fonts: 18 | \code{\link{error_font}()}, 19 | \code{\link{name_font}()}, 20 | \code{\link{punc_font}()}, 21 | \code{\link{tid_font}()} 22 | } 23 | \concept{printer fonts} 24 | \keyword{internal} 25 | -------------------------------------------------------------------------------- /man/diverging_palette.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/heat_tree--mapping.R 3 | \name{diverging_palette} 4 | \alias{diverging_palette} 5 | \title{The default diverging color palette} 6 | \usage{ 7 | diverging_palette() 8 | } 9 | \value{ 10 | \code{character} of hex color codes 11 | } 12 | \description{ 13 | Returns the default color palette for diverging data 14 | } 15 | \examples{ 16 | diverging_palette() 17 | 18 | } 19 | -------------------------------------------------------------------------------- /man/dot-onAttach.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/startup.R 3 | \name{.onAttach} 4 | \alias{.onAttach} 5 | \title{Run when package loads} 6 | \usage{ 7 | .onAttach(libname, pkgname) 8 | } 9 | \description{ 10 | Run when package loads 11 | } 12 | \keyword{internal} 13 | -------------------------------------------------------------------------------- /man/edge_list_depth.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/heat_tree--internal.R 3 | \name{edge_list_depth} 4 | \alias{edge_list_depth} 5 | \title{Get distance from root of edgelist observations} 6 | \usage{ 7 | edge_list_depth(taxa, parents) 8 | } 9 | \arguments{ 10 | \item{taxa}{(\code{character}) Unique taxon IDs for every possible taxon.} 11 | 12 | \item{parents}{(\code{character}) Unique taxon IDs for the supertaxa of every possible taxon. 13 | Root taxa should have \code{NA} in this column.} 14 | } 15 | \description{ 16 | Gets the number of ancestors/supergroups for observations of an edge/adjacency list 17 | } 18 | \keyword{internal} 19 | -------------------------------------------------------------------------------- /man/ends_with.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/imports.R, R/old_taxa--imports.R 3 | \name{ends_with} 4 | \alias{ends_with} 5 | \title{dplyr select_helpers} 6 | \description{ 7 | dplyr select_helpers 8 | 9 | dplyr select_helpers 10 | } 11 | \keyword{internal} 12 | -------------------------------------------------------------------------------- /man/error_font.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--taxmap--printers.R 3 | \name{error_font} 4 | \alias{error_font} 5 | \title{Font to indicate an error} 6 | \usage{ 7 | error_font(text) 8 | } 9 | \arguments{ 10 | \item{text}{What to print} 11 | } 12 | \description{ 13 | A simple wrapper to make changing the formatting of text printed easier. 14 | This is used for non-data, formatting characters 15 | } 16 | \seealso{ 17 | Other printer fonts: 18 | \code{\link{desc_font}()}, 19 | \code{\link{name_font}()}, 20 | \code{\link{punc_font}()}, 21 | \code{\link{tid_font}()} 22 | } 23 | \concept{printer fonts} 24 | \keyword{internal} 25 | -------------------------------------------------------------------------------- /man/everything.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/imports.R, R/old_taxa--imports.R 3 | \name{everything} 4 | \alias{everything} 5 | \title{dplyr select_helpers} 6 | \description{ 7 | dplyr select_helpers 8 | 9 | dplyr select_helpers 10 | } 11 | \keyword{internal} 12 | -------------------------------------------------------------------------------- /man/ex_hierarchies.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--dataset_documentation.R 3 | \name{ex_hierarchies} 4 | \alias{ex_hierarchies} 5 | \title{An example hierarchies object} 6 | \format{ 7 | A [hierarchies()] object. 8 | } 9 | \source{ 10 | Created from the example code in the [hierarchies()] 11 | documentation. 12 | } 13 | \description{ 14 | An example hierarchies object built from the ground up. 15 | } 16 | \seealso{ 17 | Other taxa-datasets: 18 | \code{\link{ex_hierarchy1}}, 19 | \code{\link{ex_hierarchy2}}, 20 | \code{\link{ex_hierarchy3}}, 21 | \code{\link{ex_taxmap}} 22 | } 23 | \concept{taxa-datasets} 24 | \keyword{data} 25 | -------------------------------------------------------------------------------- /man/ex_hierarchy1.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--dataset_documentation.R 3 | \name{ex_hierarchy1} 4 | \alias{ex_hierarchy1} 5 | \title{An example Hierarchy object} 6 | \format{ 7 | A [hierarchy()] object with 8 | \itemize{ 9 | \item name: Poaceae / rank: family / id: 4479 10 | \item name: Poa / rank: genus / id: 4544 11 | \item name: Poa annua / rank: species / id: 93036 12 | } 13 | Based on NCBI taxonomic classification 14 | } 15 | \source{ 16 | Created from the example code in the [hierarchy()] 17 | documentation. 18 | } 19 | \description{ 20 | An example Hierarchy object built from the ground up. 21 | } 22 | \seealso{ 23 | Other taxa-datasets: 24 | \code{\link{ex_hierarchies}}, 25 | \code{\link{ex_hierarchy2}}, 26 | \code{\link{ex_hierarchy3}}, 27 | \code{\link{ex_taxmap}} 28 | } 29 | \concept{taxa-datasets} 30 | \keyword{data} 31 | -------------------------------------------------------------------------------- /man/ex_hierarchy2.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--dataset_documentation.R 3 | \name{ex_hierarchy2} 4 | \alias{ex_hierarchy2} 5 | \title{An example Hierarchy object} 6 | \format{ 7 | A [hierarchy()] object with 8 | \itemize{ 9 | \item name: Felidae / rank: family / id: 9681 10 | \item name: Puma / rank: genus / id: 146712 11 | \item name: Puma concolor / rank: species / id: 9696 12 | } 13 | Based on NCBI taxonomic classification 14 | } 15 | \source{ 16 | Created from the example code in the [hierarchy()] 17 | documentation. 18 | } 19 | \description{ 20 | An example Hierarchy object built from the ground up. 21 | } 22 | \seealso{ 23 | Other taxa-datasets: 24 | \code{\link{ex_hierarchies}}, 25 | \code{\link{ex_hierarchy1}}, 26 | \code{\link{ex_hierarchy3}}, 27 | \code{\link{ex_taxmap}} 28 | } 29 | \concept{taxa-datasets} 30 | \keyword{data} 31 | -------------------------------------------------------------------------------- /man/ex_hierarchy3.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--dataset_documentation.R 3 | \name{ex_hierarchy3} 4 | \alias{ex_hierarchy3} 5 | \title{An example Hierarchy object} 6 | \format{ 7 | A [hierarchy()] object with 8 | \itemize{ 9 | \item name: Chordata / rank: phylum / id: 158852 10 | \item name: Vertebrata / rank: subphylum / id: 331030 11 | \item name: Teleostei / rank: class / id: 161105 12 | \item name: Salmonidae / rank: family / id: 161931 13 | \item name: Salmo / rank: genus / id: 161994 14 | \item name: Salmo salar / rank: species / id: 161996 15 | } 16 | Based on ITIS taxonomic classification 17 | } 18 | \source{ 19 | Created from the example code in the [hierarchy()] 20 | documentation. 21 | } 22 | \description{ 23 | An example Hierarchy object built from the ground up. 24 | } 25 | \seealso{ 26 | Other taxa-datasets: 27 | \code{\link{ex_hierarchies}}, 28 | \code{\link{ex_hierarchy1}}, 29 | \code{\link{ex_hierarchy2}}, 30 | \code{\link{ex_taxmap}} 31 | } 32 | \concept{taxa-datasets} 33 | \keyword{data} 34 | -------------------------------------------------------------------------------- /man/ex_taxmap.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--dataset_documentation.R 3 | \name{ex_taxmap} 4 | \alias{ex_taxmap} 5 | \title{An example taxmap object} 6 | \format{ 7 | A [taxmap()] object. 8 | } 9 | \source{ 10 | Created from the example code in the [taxmap()] 11 | documentation. 12 | } 13 | \description{ 14 | An example taxmap object built from the ground up. Typically, data stored in 15 | taxmap would be parsed from an input file, but this data set is just for 16 | demonstration purposes. 17 | } 18 | \seealso{ 19 | Other taxa-datasets: 20 | \code{\link{ex_hierarchies}}, 21 | \code{\link{ex_hierarchy1}}, 22 | \code{\link{ex_hierarchy2}}, 23 | \code{\link{ex_hierarchy3}} 24 | } 25 | \concept{taxa-datasets} 26 | \keyword{data} 27 | -------------------------------------------------------------------------------- /man/fasta_headers.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/read_fasta.R 3 | \name{fasta_headers} 4 | \alias{fasta_headers} 5 | \title{Get line numbers of FASTA headers} 6 | \usage{ 7 | fasta_headers(file_path, buffer_size = 1000, return_headers = TRUE) 8 | } 9 | \arguments{ 10 | \item{file_path}{(\code{character} of length 1) The path to a file to read.} 11 | 12 | \item{buffer_size}{(\code{numeric} of length 1) The number of lines in each chunk.} 13 | 14 | \item{return_headers}{(\code{logical} of length 1) If \code{TRUE}, name the result with the headers.} 15 | } 16 | \value{ 17 | \code{numeric} 18 | } 19 | \description{ 20 | Get line numbers of FASTA headers without reading whole fasta file into RAM. 21 | } 22 | \keyword{internal} 23 | -------------------------------------------------------------------------------- /man/figures/readme_figure.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grunwaldlab/metacoder/e881d1bc67fd323d916ff2bb955b7a8d48bc4664/man/figures/readme_figure.jpg -------------------------------------------------------------------------------- /man/get_class_from_el.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/heat_tree--internal.R 3 | \name{get_class_from_el} 4 | \alias{get_class_from_el} 5 | \title{Get classification for taxa in edge list} 6 | \usage{ 7 | get_class_from_el(taxa, parents) 8 | } 9 | \arguments{ 10 | \item{taxa}{(\code{character}) Unique taxon IDs for every possible taxon.} 11 | 12 | \item{parents}{(\code{character}) Unique taxon IDs for the supertaxa of every possible taxon. 13 | Root taxa should have \code{NA} in this column.} 14 | } 15 | \value{ 16 | A list of vectors of taxa IDs. Each list entry corresponds to the \code{taxa} supplied. 17 | } 18 | \description{ 19 | Extracts the classification of every taxon in a list of unique taxa and their supertaxa. 20 | } 21 | \keyword{internal} 22 | -------------------------------------------------------------------------------- /man/get_data.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--taxonomy--docs.R 3 | \name{get_data} 4 | \alias{get_data} 5 | \title{Get data in a taxmap object by name} 6 | \arguments{ 7 | \item{obj}{A [taxonomy()] or [taxmap()] object} 8 | 9 | \item{name}{(`character`) Names of data to return. If not supplied, return 10 | all data listed in [all_names()].} 11 | 12 | \item{...}{Passed to [all_names()]. Used to filter what kind of data is 13 | returned (e.g. columns in tables or function output?) if `name` is not 14 | supplied or what kinds are allowed if `name` is supplied.} 15 | } 16 | \value{ 17 | `list` of vectors or lists. Each vector or list will be named by 18 | associated taxon ids if possible. 19 | } 20 | \description{ 21 | Given a vector of names, return a list of data (usually lists/vectors) 22 | contained in a [taxonomy()] or [taxmap()] object. Each item will be named by 23 | taxon ids when possible. 24 | \preformatted{ 25 | obj$get_data(name = NULL, ...) 26 | get_data(obj, name = NULL, ...)} 27 | } 28 | \examples{ 29 | # Get specific values 30 | get_data(ex_taxmap, c("reaction", "n_legs", "taxon_ranks")) 31 | 32 | # Get all values 33 | get_data(ex_taxmap) 34 | 35 | } 36 | \seealso{ 37 | Other NSE helpers: 38 | \code{\link{all_names}()}, 39 | \code{\link{data_used}}, 40 | \code{\link{names_used}} 41 | } 42 | \concept{NSE helpers} 43 | -------------------------------------------------------------------------------- /man/get_data_frame.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--taxonomy--docs.R 3 | \name{get_data_frame} 4 | \alias{get_data_frame} 5 | \title{Get data in a taxonomy or taxmap object by name} 6 | \arguments{ 7 | \item{obj}{A [taxonomy()] or [taxmap()] object} 8 | 9 | \item{name}{(`character`) Names of data to return. If not supplied, return 10 | all data listed in [all_names()].} 11 | 12 | \item{...}{Passed to [all_names()]. Used to filter what kind of data is 13 | returned (e.g. columns in tables or function output?) if `name` is not 14 | supplied or what kinds are allowed if `name` is supplied.} 15 | } 16 | \value{ 17 | `data.frame` 18 | } 19 | \description{ 20 | Given a vector of names, return a table of the indicated data 21 | contained in a [taxonomy()] or [taxmap()] object. 22 | \preformatted{ 23 | obj$get_data_frame(name = NULL, ...) 24 | get_data_frame(obj, name = NULL, ...)} 25 | } 26 | \details{ 27 | Note: This function will not work with variables in datasets in [taxmap()] 28 | objects unless their rows correspond 1:1 with all taxa. 29 | } 30 | \examples{ 31 | # Get specific values 32 | get_data_frame(ex_taxmap, c("taxon_names", "taxon_indexes", "is_stem")) 33 | 34 | 35 | } 36 | \concept{accessors} 37 | -------------------------------------------------------------------------------- /man/get_database_name.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--internal.R 3 | \name{get_database_name} 4 | \alias{get_database_name} 5 | \title{Return name of database} 6 | \usage{ 7 | get_database_name(input) 8 | } 9 | \arguments{ 10 | \item{input}{Either a character vector or `TaxonDatabase` class} 11 | } 12 | \value{ 13 | The name of the database 14 | } 15 | \description{ 16 | This is meant to return the name of a database when it is not known if the 17 | input is a `TaxonDatabase` object or a simple character vector. 18 | } 19 | \keyword{internal} 20 | -------------------------------------------------------------------------------- /man/get_dataset.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--taxmap--docs.R 3 | \name{get_dataset} 4 | \alias{get_dataset} 5 | \title{Get a data set from a taxmap object} 6 | \arguments{ 7 | \item{obj}{A taxmap object} 8 | 9 | \item{data}{Dataset name, index, or a logical vector that indicates which dataset in 10 | `obj$data` to add columns to.} 11 | } 12 | \description{ 13 | Get a data set from a taxmap object and complain if it does not 14 | exist. 15 | } 16 | \examples{ 17 | # Get data set by name 18 | get_dataset(ex_taxmap, "info") 19 | 20 | # Get data set by indeex_taxmap 21 | get_dataset(ex_taxmap, 1) 22 | 23 | # Get data set by T/F vector 24 | get_dataset(ex_taxmap, startsWith(names(ex_taxmap$data), "i")) 25 | 26 | } 27 | -------------------------------------------------------------------------------- /man/get_dots_or_list.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--internal.R 3 | \name{get_dots_or_list} 4 | \alias{get_dots_or_list} 5 | \title{Get input from dots or list} 6 | \usage{ 7 | get_dots_or_list(..., .list = NULL) 8 | } 9 | \arguments{ 10 | \item{...}{Dots input} 11 | 12 | \item{.list}{List input} 13 | } 14 | \value{ 15 | A list of inputs 16 | } 17 | \description{ 18 | Get input from dots or list, but not both. 19 | Throws an error if both are supplied. 20 | } 21 | \keyword{internal} 22 | -------------------------------------------------------------------------------- /man/get_edge_children.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/internal.R 3 | \name{get_edge_children} 4 | \alias{get_edge_children} 5 | \title{get_edge_children} 6 | \usage{ 7 | get_edge_children(graph) 8 | } 9 | \description{ 10 | get_edge_children 11 | } 12 | \keyword{internal} 13 | -------------------------------------------------------------------------------- /man/get_edge_parents.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/internal.R 3 | \name{get_edge_parents} 4 | \alias{get_edge_parents} 5 | \title{get_edge_parents} 6 | \usage{ 7 | get_edge_parents(graph) 8 | } 9 | \description{ 10 | get_edge_parents 11 | } 12 | \keyword{internal} 13 | -------------------------------------------------------------------------------- /man/get_expected_data.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/as_phyloseq.R 3 | \name{get_expected_data} 4 | \alias{get_expected_data} 5 | \title{Get a data set in as_phyloseq} 6 | \usage{ 7 | get_expected_data(obj, input, default, expected_class) 8 | } 9 | \arguments{ 10 | \item{obj}{The taxmap object} 11 | 12 | \item{input}{The input to as_phyloseq options.} 13 | 14 | \item{default}{The default name of the data set.} 15 | 16 | \item{expected_class}{What the dataset is expected to be.} 17 | } 18 | \description{ 19 | Get a data set in as_phyloseq 20 | } 21 | \keyword{internal} 22 | -------------------------------------------------------------------------------- /man/get_node_children.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/internal.R 3 | \name{get_node_children} 4 | \alias{get_node_children} 5 | \title{get_node_children} 6 | \usage{ 7 | get_node_children(graph, node) 8 | } 9 | \description{ 10 | get_node_children 11 | } 12 | \keyword{internal} 13 | -------------------------------------------------------------------------------- /man/get_numeric_cols.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/calculations--internal.R 3 | \name{get_numeric_cols} 4 | \alias{get_numeric_cols} 5 | \title{Get numeric columns from taxmap table} 6 | \usage{ 7 | get_numeric_cols(obj, data, cols = NULL) 8 | } 9 | \arguments{ 10 | \item{obj}{A taxmap object} 11 | 12 | \item{data}{The name of a table in \code{obj}.} 13 | 14 | \item{cols}{The names/indexes of columns in \code{data} to use. By 15 | default, all numeric columns are used. Takes one of the following inputs: 16 | \describe{ 17 | \item{TRUE/FALSE:}{All/No columns will used.} 18 | \item{Character vector:}{The names of columns to use} 19 | \item{Numeric vector:}{The indexes of columns to use} 20 | \item{Vector of TRUE/FALSE of length equal to the number of columns:}{Use the columns 21 | corresponding to \code{TRUE} values.} 22 | }} 23 | } 24 | \description{ 25 | If columns are specified by the user, parse them and check that they are numeric. 26 | If not, return all numeric columns. 27 | } 28 | \keyword{internal} 29 | -------------------------------------------------------------------------------- /man/get_numerics.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/internal.R 3 | \name{get_numerics} 4 | \alias{get_numerics} 5 | \title{Return numeric values in a character} 6 | \usage{ 7 | get_numerics(input) 8 | } 9 | \arguments{ 10 | \item{input}{} 11 | } 12 | \description{ 13 | Returns just valid numeric values and ignores others. 14 | } 15 | \keyword{internal} 16 | -------------------------------------------------------------------------------- /man/get_optimal_range.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/heat_tree--vertex_size.R 3 | \name{get_optimal_range} 4 | \alias{get_optimal_range} 5 | \title{Find optimal range} 6 | \usage{ 7 | get_optimal_range( 8 | max_range, 9 | min_range, 10 | resolution, 11 | opt_crit, 12 | choose_best, 13 | minimize = TRUE 14 | ) 15 | } 16 | \arguments{ 17 | \item{max_range}{(\code{numeric} of length 2) The min and max boundaries to the search space for 18 | the optimal maximum value.} 19 | 20 | \item{min_range}{(\code{numeric} of length 2) The min and max boundaries to the search space for 21 | the optimal minimum value.} 22 | 23 | \item{resolution}{(\code{numeric} of length 2) The number of increments in each dimension.} 24 | 25 | \item{opt_crit}{(\code{function}) A function that takes two arguments, the max and min, and 26 | returns the optimality statistic.} 27 | 28 | \item{choose_best}{(\code{function}) A function that takes a list of \code{opt_crit} outputs 29 | and returns the index of the best one.} 30 | } 31 | \description{ 32 | Finds optimal max and min value using an optimality criterion. 33 | } 34 | \keyword{internal} 35 | -------------------------------------------------------------------------------- /man/get_sort_var.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--taxmap--parsers.R 3 | \name{get_sort_var} 4 | \alias{get_sort_var} 5 | \title{Get a vector from a vector/list/table to be used in mapping} 6 | \usage{ 7 | get_sort_var(data, var) 8 | } 9 | \arguments{ 10 | \item{data}{A vector/list/table} 11 | 12 | \item{var}{What to get. 13 | * For tables, the names of columns can be used. 14 | * `"\{\{index\}\}"` : This means to use the index of rows/items 15 | * `"\{\{name\}\}"` : This means to use row/item names. 16 | * `"\{\{value\}\}"` : This means to use the values in vectors or lists. Lists} 17 | } 18 | \description{ 19 | Get a vector from a vector/list/table to be used in mapping 20 | } 21 | \keyword{internal} 22 | -------------------------------------------------------------------------------- /man/get_taxmap_cols.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/option_parsers.R 3 | \name{get_taxmap_cols} 4 | \alias{get_taxmap_cols} 5 | \title{Get a column subset} 6 | \usage{ 7 | get_taxmap_cols(obj, data, cols = NULL) 8 | } 9 | \arguments{ 10 | \item{obj}{A taxmap object} 11 | 12 | \item{data}{The name of a table in \code{obj} that contains counts.} 13 | 14 | \item{cols}{The columns in the data set to use. Takes one of 15 | the following inputs: 16 | \describe{ 17 | \item{TRUE/FALSE:}{All non-target columns will be preserved or not.} 18 | \item{Vector of TRUE/FALSE of length equal to the number of columns:}{Preserve the columns 19 | corresponding to \code{TRUE} values.} 20 | \item{Character vector:}{The names of columns to preserve} 21 | \item{Numeric vector:}{The indexes of columns to preserve} 22 | }} 23 | } 24 | \description{ 25 | Convert logical, names, or indexes to column names and check that they exist. 26 | } 27 | \seealso{ 28 | Other option parsers: 29 | \code{\link{get_taxmap_data}()}, 30 | \code{\link{get_taxmap_other_cols}()}, 31 | \code{\link{get_taxmap_table}()}, 32 | \code{\link{verify_taxmap}()} 33 | } 34 | \concept{option parsers} 35 | \keyword{internal} 36 | -------------------------------------------------------------------------------- /man/get_taxmap_data.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/option_parsers.R 3 | \name{get_taxmap_data} 4 | \alias{get_taxmap_data} 5 | \title{Get a data set from a taxmap object} 6 | \usage{ 7 | get_taxmap_data(obj, data) 8 | } 9 | \arguments{ 10 | \item{obj}{A taxmap object} 11 | 12 | \item{data}{Which data set to use. Can be any of the following: 13 | \describe{ 14 | \item{Name}{The name of the data set to use.} 15 | \item{Index}{The index of the data set to use.} 16 | \item{TRUE/FALSE vector}{A TRUE/FALSE vector the same length as the 17 | number of datasets, with exactly one TRUE corresponding to the 18 | selected data set.} 19 | }} 20 | } 21 | \description{ 22 | NOTE: This will be replaced by the function `get_dataset` in the `taxa` 23 | package. Get a data set from a taxmap object and complain if it does not 24 | exist. This is intended to be used to parse options in other functions. 25 | } 26 | \seealso{ 27 | Other option parsers: 28 | \code{\link{get_taxmap_cols}()}, 29 | \code{\link{get_taxmap_other_cols}()}, 30 | \code{\link{get_taxmap_table}()}, 31 | \code{\link{verify_taxmap}()} 32 | } 33 | \concept{option parsers} 34 | \keyword{internal} 35 | -------------------------------------------------------------------------------- /man/get_taxmap_other_cols.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/option_parsers.R 3 | \name{get_taxmap_other_cols} 4 | \alias{get_taxmap_other_cols} 5 | \title{Parse the other_cols option} 6 | \usage{ 7 | get_taxmap_other_cols(obj, data, cols, other_cols = NULL) 8 | } 9 | \arguments{ 10 | \item{obj}{A taxmap object} 11 | 12 | \item{data}{The name of a table in \code{obj} that contains counts.} 13 | 14 | \item{cols}{The names/indexes of columns in \code{data} to use. Takes one 15 | of the following inputs: 16 | \describe{ 17 | \item{TRUE/FALSE:}{All columns will used.} 18 | \item{Vector of TRUE/FALSE of length equal to the number of columns:}{Use the columns 19 | corresponding to \code{TRUE} values.} 20 | \item{Character vector:}{The names of columns to use} 21 | \item{Numeric vector:}{The indexes of columns to use} 22 | }} 23 | 24 | \item{other_cols}{Preserve in the output non-target columns present in the 25 | input data. The "taxon_id" column will always be preserved. Takes one of 26 | the following inputs: 27 | \describe{ 28 | \item{TRUE/FALSE:}{All non-target columns will be preserved or not.} 29 | \item{Vector of TRUE/FALSE of length equal to the number of columns:}{Preserve the columns 30 | corresponding to \code{TRUE} values.} 31 | \item{Character vector:}{The names of columns to preserve} 32 | \item{Numeric vector:}{The indexes of columns to preserve} 33 | }} 34 | } 35 | \description{ 36 | Parse the other_cols option used in many calculation functions. 37 | } 38 | \seealso{ 39 | Other option parsers: 40 | \code{\link{get_taxmap_cols}()}, 41 | \code{\link{get_taxmap_data}()}, 42 | \code{\link{get_taxmap_table}()}, 43 | \code{\link{verify_taxmap}()} 44 | } 45 | \concept{option parsers} 46 | \keyword{internal} 47 | -------------------------------------------------------------------------------- /man/get_taxmap_table.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/option_parsers.R 3 | \name{get_taxmap_table} 4 | \alias{get_taxmap_table} 5 | \title{Get a table from a taxmap object} 6 | \usage{ 7 | get_taxmap_table(obj, data) 8 | } 9 | \arguments{ 10 | \item{obj}{A taxmap object} 11 | 12 | \item{data}{Which data set to use. Can be any of the following: 13 | \describe{ 14 | \item{Name}{The name of the data set to use.} 15 | \item{Index}{The index of the data set to use.} 16 | \item{TRUE/FALSE vector}{A TRUE/FALSE vector the same length as the 17 | number of datasets, with exactly one TRUE corresponding to the 18 | selected data set.} 19 | }} 20 | } 21 | \value{ 22 | A table 23 | } 24 | \description{ 25 | Get a table from a taxmap object and complain if it does not exist. 26 | This is intended to be used to parse options in other functions. 27 | } 28 | \seealso{ 29 | Other option parsers: 30 | \code{\link{get_taxmap_cols}()}, 31 | \code{\link{get_taxmap_data}()}, 32 | \code{\link{get_taxmap_other_cols}()}, 33 | \code{\link{verify_taxmap}()} 34 | } 35 | \concept{option parsers} 36 | \keyword{internal} 37 | -------------------------------------------------------------------------------- /man/get_taxonomy_levels.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/sequence_download.R 3 | \name{get_taxonomy_levels} 4 | \alias{get_taxonomy_levels} 5 | \title{Get taxonomy levels} 6 | \usage{ 7 | get_taxonomy_levels() 8 | } 9 | \description{ 10 | Return An ordered factor of taxonomy levels, such as "Subkingdom" and "Order", in order of the 11 | hierarchy. 12 | } 13 | \keyword{internal} 14 | -------------------------------------------------------------------------------- /man/grapes-greater-than-grapes.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/imports.R, R/old_taxa--imports.R 3 | \name{\%>\%} 4 | \alias{\%>\%} 5 | \title{magrittr forward-pipe operator} 6 | \description{ 7 | magrittr forward-pipe operator 8 | 9 | magrittr forward-pipe operator 10 | } 11 | \keyword{internal} 12 | -------------------------------------------------------------------------------- /man/hierarchies.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--hierarchies.R 3 | \name{hierarchies} 4 | \alias{hierarchies} 5 | \title{Make a set of many [hierarchy()] class objects} 6 | \usage{ 7 | hierarchies(..., .list = NULL) 8 | } 9 | \arguments{ 10 | \item{...}{Any number of object of class [hierarchy()]} 11 | 12 | \item{.list}{Any number of object of class [hierarchy()] in a list} 13 | } 14 | \value{ 15 | An `R6Class` object of class [hierarchy()] 16 | } 17 | \description{ 18 | NOTE: This will soon be depreciated. 19 | Make a set of many [hierarchy()] class objects. 20 | This is just a thin wrapper over a standard list. 21 | } 22 | \seealso{ 23 | Other classes: 24 | \code{\link{hierarchy}()}, 25 | \code{\link{taxa}()}, 26 | \code{\link{taxmap}()}, 27 | \code{\link{taxon}()}, 28 | \code{\link{taxon_database}()}, 29 | \code{\link{taxon_id}()}, 30 | \code{\link{taxon_name}()}, 31 | \code{\link{taxon_rank}()}, 32 | \code{\link{taxonomy}()} 33 | } 34 | \concept{classes} 35 | -------------------------------------------------------------------------------- /man/highlight_taxon_ids.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--taxmap--printers.R 3 | \name{highlight_taxon_ids} 4 | \alias{highlight_taxon_ids} 5 | \title{Highlight taxon ID column} 6 | \usage{ 7 | highlight_taxon_ids(table_text, header_index, row_indexes) 8 | } 9 | \arguments{ 10 | \item{table_text}{The print out of the table in a character vector, one element per line.} 11 | 12 | \item{header_index}{The row index that contains the table column names} 13 | 14 | \item{row_indexes}{The indexes of the rows to be formatted.} 15 | } 16 | \description{ 17 | Changes the font of a taxon ID column in a table print out. 18 | } 19 | -------------------------------------------------------------------------------- /man/hmp_otus.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/dataset_documentation.R 3 | \name{hmp_otus} 4 | \alias{hmp_otus} 5 | \title{A HMP subset} 6 | \format{ 7 | A 1,000 x 52 tibble. 8 | } 9 | \source{ 10 | Subset from data available at https://www.hmpdacc.org/hmp/HMQCP/ 11 | } 12 | \description{ 13 | A subset of the Human Microbiome Project abundance matrix produced by QIIME. 14 | It contains OTU ids, taxonomic lineages, and the read counts for 50 samples. 15 | See \code{\link{hmp_samples}} for the matching dataset of sample information. 16 | } 17 | \details{ 18 | The 50 samples were randomly selected such that there were 10 in each of 5 19 | treatments: "Saliva", "Throat", "Stool", "Right_Antecubital_fossa", 20 | "Anterior_nares". For each treatment, there were 5 samples from men and 5 21 | from women. 22 | } 23 | \seealso{ 24 | Other hmp_data: 25 | \code{\link{hmp_samples}} 26 | } 27 | \concept{hmp_data} 28 | \keyword{data} 29 | -------------------------------------------------------------------------------- /man/hmp_samples.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/dataset_documentation.R 3 | \name{hmp_samples} 4 | \alias{hmp_samples} 5 | \title{Sample information for HMP subset} 6 | \format{ 7 | A 50 x 3 tibble. 8 | } 9 | \source{ 10 | Subset from data available at https://www.hmpdacc.org/hmp/HMQCP/ 11 | } 12 | \description{ 13 | The sample information for a subset of the Human Microbiome Project data. It 14 | contains the sample ID, sex, and body site for each sample in the abundance 15 | matrix stored in \code{\link{hmp_otus}}. The "sample_id" column corresponds 16 | to the column names of \code{\link{hmp_otus}}. 17 | } 18 | \details{ 19 | The 50 samples were randomly selected such that there were 10 in each of 5 20 | treatments: "Saliva", "Throat", "Stool", "Right_Antecubital_fossa", 21 | "Anterior_nares". For each treatment, there were 5 samples from men and 5 22 | from women. "Right_Antecubital_fossa" was renamed to "Skin" and 23 | "Anterior_nares" to "Nose". 24 | } 25 | \seealso{ 26 | Other hmp_data: 27 | \code{\link{hmp_otus}} 28 | } 29 | \concept{hmp_data} 30 | \keyword{data} 31 | -------------------------------------------------------------------------------- /man/id_classifications.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--taxonomy--docs.R 3 | \name{id_classifications} 4 | \alias{id_classifications} 5 | \title{Get ID classifications of taxa} 6 | \arguments{ 7 | \item{obj}{([taxonomy()] or [taxmap()])} 8 | 9 | \item{sep}{(`character` of length 1) The character(s) to place between 10 | taxon IDs} 11 | } 12 | \value{ 13 | `character` 14 | } 15 | \description{ 16 | Get classification strings of taxa in an object of type [taxonomy()] or [taxmap()] 17 | composed of taxon IDs. Each classification is constructed by concatenating 18 | the taxon ids of the given taxon and its supertaxa. 19 | \preformatted{ 20 | obj$id_classifications(sep = ";") 21 | id_classifications(obj, sep = ";")} 22 | } 23 | \examples{ 24 | # Get classifications of IDs for each taxon 25 | id_classifications(ex_taxmap) 26 | 27 | # Use a different seperator 28 | id_classifications(ex_taxmap, sep = '|') 29 | 30 | } 31 | \seealso{ 32 | Other taxonomy data functions: 33 | \code{\link{classifications}()}, 34 | \code{\link{is_branch}()}, 35 | \code{\link{is_internode}()}, 36 | \code{\link{is_leaf}()}, 37 | \code{\link{is_root}()}, 38 | \code{\link{is_stem}()}, 39 | \code{\link{map_data}()}, 40 | \code{\link{map_data_}()}, 41 | \code{\link{n_leaves}()}, 42 | \code{\link{n_leaves_1}()}, 43 | \code{\link{n_subtaxa}()}, 44 | \code{\link{n_subtaxa_1}()}, 45 | \code{\link{n_supertaxa}()}, 46 | \code{\link{n_supertaxa_1}()}, 47 | \code{\link{taxon_ids}()}, 48 | \code{\link{taxon_indexes}()}, 49 | \code{\link{taxon_names}()}, 50 | \code{\link{taxon_ranks}()} 51 | } 52 | \concept{taxonomy data functions} 53 | -------------------------------------------------------------------------------- /man/init_taxmap_data.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--taxmap--internal.R 3 | \name{init_taxmap_data} 4 | \alias{init_taxmap_data} 5 | \title{Convert `data` input for Taxamp} 6 | \usage{ 7 | init_taxmap_data(self, data, input_ids, assume_equal = TRUE) 8 | } 9 | \arguments{ 10 | \item{self}{The newly created [taxmap()] object} 11 | 12 | \item{data}{The `data` variable passed to the `Taxmap` constructor} 13 | 14 | \item{input_ids}{The taxon IDs for the inputs that made the taxonomy} 15 | 16 | \item{assume_equal}{If `TRUE`, and a data set length is the same as the 17 | `input_ids` length, then assume that `input_ids` applies to the data set as 18 | well.} 19 | } 20 | \value{ 21 | A `data` variable with the right format 22 | } 23 | \description{ 24 | Make sure `data` is in the right format and complain if it is not. Then, add 25 | a `taxon_id` column to data with the same length as the input 26 | } 27 | \keyword{internal} 28 | -------------------------------------------------------------------------------- /man/inter_circle_gap.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/heat_tree--vertex_size.R 3 | \name{inter_circle_gap} 4 | \alias{inter_circle_gap} 5 | \title{Finds the gap/overlap of circle coordinates} 6 | \usage{ 7 | inter_circle_gap(x, y, r) 8 | } 9 | \arguments{ 10 | \item{x}{(\code{numeric} of length 1) x coordinate of center} 11 | 12 | \item{y}{(\code{numeric} of length 1) y coordinate of center} 13 | 14 | \item{r}{(\code{numeric} of length 1) The diameter of the circle.} 15 | } 16 | \description{ 17 | Given a set of x, y coordinates and corresponding radii return the gap between every possible 18 | combination. 19 | } 20 | \keyword{internal} 21 | -------------------------------------------------------------------------------- /man/inverse.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/heat_tree--legend.R 3 | \name{inverse} 4 | \alias{inverse} 5 | \title{Generate the inverse of a function} 6 | \usage{ 7 | inverse(f, interval) 8 | } 9 | \arguments{ 10 | \item{f}{(\code{function} with one argument) A function to derive and inverse from} 11 | 12 | \item{interval}{(\code{character} of length 2) The range of the value the inverse function can return.} 13 | } 14 | \value{ 15 | (\code{function}) Return the inverse of the function given 16 | } 17 | \description{ 18 | http://stackoverflow.com/questions/10081479/solving-for-the-inverse-of-a-function-in-r 19 | } 20 | \keyword{internal} 21 | -------------------------------------------------------------------------------- /man/is_ambiguous.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/remove_ambiguous.R 3 | \name{is_ambiguous} 4 | \alias{is_ambiguous} 5 | \title{Find ambiguous taxon names} 6 | \usage{ 7 | is_ambiguous( 8 | taxon_names, 9 | unknown = TRUE, 10 | uncultured = TRUE, 11 | name_regex = ".", 12 | ignore_case = TRUE 13 | ) 14 | } 15 | \arguments{ 16 | \item{taxon_names}{A \code{\link{taxmap}} object} 17 | 18 | \item{unknown}{If \code{TRUE}, Remove taxa with names the suggest they are 19 | placeholders for unknown taxa (e.g. "unknown ...").} 20 | 21 | \item{uncultured}{If \code{TRUE}, Remove taxa with names the suggest they are 22 | assigned to uncultured organisms (e.g. "uncultured ...").} 23 | 24 | \item{name_regex}{The regex code to match a valid character in a taxon name. 25 | For example, "[a-z]" would mean taxon names can only be lower case letters.} 26 | 27 | \item{ignore_case}{If \code{TRUE}, dont consider the case of the text when 28 | determining a match.} 29 | } 30 | \value{ 31 | TRUE/FALSE vector corresponding to \code{taxon_names} 32 | } 33 | \description{ 34 | Find taxa with ambiguous names, such as "unknown" or "uncultured". 35 | } 36 | \details{ 37 | If you encounter a taxon name that represents an ambiguous taxon that is not 38 | filtered out by this function, let us know and we will add it. 39 | } 40 | \examples{ 41 | is_ambiguous(c("unknown", "uncultured", "homo sapiens", "kfdsjfdljsdf")) 42 | 43 | } 44 | -------------------------------------------------------------------------------- /man/is_branch.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--taxonomy--docs.R 3 | \name{is_branch} 4 | \alias{is_branch} 5 | \title{Test if taxa are branches} 6 | \arguments{ 7 | \item{obj}{The [taxonomy()] or [taxmap()] object.} 8 | } 9 | \value{ 10 | A `logical` of length equal to the number of taxa. 11 | } 12 | \description{ 13 | Test if taxa are branches in a [taxonomy()] or [taxmap()] object. Branches 14 | are taxa in the interior of the tree that are not [roots()], [stems()], or 15 | [leaves()]. 16 | \preformatted{ 17 | obj$is_branch() 18 | is_branch(obj)} 19 | } 20 | \examples{ 21 | # Test which taxon IDs correspond to branches 22 | is_branch(ex_taxmap) 23 | 24 | # Filter out branches 25 | filter_taxa(ex_taxmap, ! is_branch) 26 | 27 | } 28 | \seealso{ 29 | Other taxonomy data functions: 30 | \code{\link{classifications}()}, 31 | \code{\link{id_classifications}()}, 32 | \code{\link{is_internode}()}, 33 | \code{\link{is_leaf}()}, 34 | \code{\link{is_root}()}, 35 | \code{\link{is_stem}()}, 36 | \code{\link{map_data}()}, 37 | \code{\link{map_data_}()}, 38 | \code{\link{n_leaves}()}, 39 | \code{\link{n_leaves_1}()}, 40 | \code{\link{n_subtaxa}()}, 41 | \code{\link{n_subtaxa_1}()}, 42 | \code{\link{n_supertaxa}()}, 43 | \code{\link{n_supertaxa_1}()}, 44 | \code{\link{taxon_ids}()}, 45 | \code{\link{taxon_indexes}()}, 46 | \code{\link{taxon_names}()}, 47 | \code{\link{taxon_ranks}()} 48 | } 49 | \concept{taxonomy data functions} 50 | -------------------------------------------------------------------------------- /man/is_internode.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--taxonomy--docs.R 3 | \name{is_internode} 4 | \alias{is_internode} 5 | \title{Test if taxa are "internodes"} 6 | \arguments{ 7 | \item{obj}{The [taxonomy()] or [taxmap()] object.} 8 | } 9 | \value{ 10 | A `logical` of length equal to the number of taxa. 11 | } 12 | \description{ 13 | Test if taxa are "internodes" in a [taxonomy()] or [taxmap()] object. An 14 | internode is any taxon with a single immediate supertaxon and a single immediate 15 | subtaxon. They can be removed from a tree without any loss of information on 16 | the relative relationship between remaining taxa. 17 | \preformatted{ 18 | obj$is_internode() 19 | is_internode(obj)} 20 | } 21 | \examples{ 22 | # Test for which taxon IDs correspond to internodes 23 | is_internode(ex_taxmap) 24 | 25 | # Filter out internodes 26 | filter_taxa(ex_taxmap, ! is_internode) 27 | 28 | } 29 | \seealso{ 30 | Other taxonomy data functions: 31 | \code{\link{classifications}()}, 32 | \code{\link{id_classifications}()}, 33 | \code{\link{is_branch}()}, 34 | \code{\link{is_leaf}()}, 35 | \code{\link{is_root}()}, 36 | \code{\link{is_stem}()}, 37 | \code{\link{map_data}()}, 38 | \code{\link{map_data_}()}, 39 | \code{\link{n_leaves}()}, 40 | \code{\link{n_leaves_1}()}, 41 | \code{\link{n_subtaxa}()}, 42 | \code{\link{n_subtaxa_1}()}, 43 | \code{\link{n_supertaxa}()}, 44 | \code{\link{n_supertaxa_1}()}, 45 | \code{\link{taxon_ids}()}, 46 | \code{\link{taxon_indexes}()}, 47 | \code{\link{taxon_names}()}, 48 | \code{\link{taxon_ranks}()} 49 | } 50 | \concept{taxonomy data functions} 51 | -------------------------------------------------------------------------------- /man/is_leaf.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--taxonomy--docs.R 3 | \name{is_leaf} 4 | \alias{is_leaf} 5 | \title{Test if taxa are leaves} 6 | \arguments{ 7 | \item{obj}{The [taxonomy()] or [taxmap()] object.} 8 | } 9 | \value{ 10 | A `logical` of length equal to the number of taxa. 11 | } 12 | \description{ 13 | Test if taxa are leaves in a [taxonomy()] or [taxmap()] object. Leaves are taxa 14 | without subtaxa, typically species. 15 | \preformatted{ 16 | obj$is_leaf() 17 | is_leaf(obj)} 18 | } 19 | \examples{ 20 | # Test which taxon IDs correspond to leaves 21 | is_leaf(ex_taxmap) 22 | 23 | # Filter out leaves 24 | filter_taxa(ex_taxmap, ! is_leaf) 25 | 26 | } 27 | \seealso{ 28 | Other taxonomy data functions: 29 | \code{\link{classifications}()}, 30 | \code{\link{id_classifications}()}, 31 | \code{\link{is_branch}()}, 32 | \code{\link{is_internode}()}, 33 | \code{\link{is_root}()}, 34 | \code{\link{is_stem}()}, 35 | \code{\link{map_data}()}, 36 | \code{\link{map_data_}()}, 37 | \code{\link{n_leaves}()}, 38 | \code{\link{n_leaves_1}()}, 39 | \code{\link{n_subtaxa}()}, 40 | \code{\link{n_subtaxa_1}()}, 41 | \code{\link{n_supertaxa}()}, 42 | \code{\link{n_supertaxa_1}()}, 43 | \code{\link{taxon_ids}()}, 44 | \code{\link{taxon_indexes}()}, 45 | \code{\link{taxon_names}()}, 46 | \code{\link{taxon_ranks}()} 47 | } 48 | \concept{taxonomy data functions} 49 | -------------------------------------------------------------------------------- /man/is_root.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--taxonomy--docs.R 3 | \name{is_root} 4 | \alias{is_root} 5 | \title{Test if taxa are roots} 6 | \arguments{ 7 | \item{obj}{The [taxonomy()] or [taxmap()] object.} 8 | } 9 | \value{ 10 | A `logical` of length equal to the number of taxa. 11 | } 12 | \description{ 13 | Test if taxa are roots in a [taxonomy()] or [taxmap()] object. Roots are taxa 14 | without supertaxa, typically things like "Bacteria", or "Life". 15 | \preformatted{ 16 | obj$is_root() 17 | is_root(obj)} 18 | } 19 | \examples{ 20 | # Test for which taxon IDs correspond to roots 21 | is_root(ex_taxmap) 22 | 23 | # Filter out roots 24 | filter_taxa(ex_taxmap, ! is_root) 25 | 26 | } 27 | \seealso{ 28 | Other taxonomy data functions: 29 | \code{\link{classifications}()}, 30 | \code{\link{id_classifications}()}, 31 | \code{\link{is_branch}()}, 32 | \code{\link{is_internode}()}, 33 | \code{\link{is_leaf}()}, 34 | \code{\link{is_stem}()}, 35 | \code{\link{map_data}()}, 36 | \code{\link{map_data_}()}, 37 | \code{\link{n_leaves}()}, 38 | \code{\link{n_leaves_1}()}, 39 | \code{\link{n_subtaxa}()}, 40 | \code{\link{n_subtaxa_1}()}, 41 | \code{\link{n_supertaxa}()}, 42 | \code{\link{n_supertaxa_1}()}, 43 | \code{\link{taxon_ids}()}, 44 | \code{\link{taxon_indexes}()}, 45 | \code{\link{taxon_names}()}, 46 | \code{\link{taxon_ranks}()} 47 | } 48 | \concept{taxonomy data functions} 49 | -------------------------------------------------------------------------------- /man/is_stem.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--taxonomy--docs.R 3 | \name{is_stem} 4 | \alias{is_stem} 5 | \title{Test if taxa are stems} 6 | \arguments{ 7 | \item{obj}{The [taxonomy()] or [taxmap()] object.} 8 | } 9 | \value{ 10 | A `logical` of length equal to the number of taxa. 11 | } 12 | \description{ 13 | Test if taxa are stems in a [taxonomy()] or [taxmap()] object. Stems are taxa 14 | from the [roots()] taxa to the first taxon with more than one subtaxon. These 15 | can usually be filtered out of the taxonomy without removing any information 16 | on how the remaining taxa are related. 17 | \preformatted{ 18 | obj$is_stem() 19 | is_stem(obj)} 20 | } 21 | \examples{ 22 | # Test which taxon IDs correspond to stems 23 | is_stem(ex_taxmap) 24 | 25 | # Filter out stems 26 | filter_taxa(ex_taxmap, ! is_stem) 27 | 28 | } 29 | \seealso{ 30 | Other taxonomy data functions: 31 | \code{\link{classifications}()}, 32 | \code{\link{id_classifications}()}, 33 | \code{\link{is_branch}()}, 34 | \code{\link{is_internode}()}, 35 | \code{\link{is_leaf}()}, 36 | \code{\link{is_root}()}, 37 | \code{\link{map_data}()}, 38 | \code{\link{map_data_}()}, 39 | \code{\link{n_leaves}()}, 40 | \code{\link{n_leaves_1}()}, 41 | \code{\link{n_subtaxa}()}, 42 | \code{\link{n_subtaxa_1}()}, 43 | \code{\link{n_supertaxa}()}, 44 | \code{\link{n_supertaxa_1}()}, 45 | \code{\link{taxon_ids}()}, 46 | \code{\link{taxon_indexes}()}, 47 | \code{\link{taxon_names}()}, 48 | \code{\link{taxon_ranks}()} 49 | } 50 | \concept{taxonomy data functions} 51 | -------------------------------------------------------------------------------- /man/label_bounds.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/heat_tree--internal.R 3 | \name{label_bounds} 4 | \alias{label_bounds} 5 | \title{Bounding box coords for labels} 6 | \usage{ 7 | label_bounds(label, x, y, height, rotation, just) 8 | } 9 | \arguments{ 10 | \item{x}{Horizontal position of center of text grob} 11 | 12 | \item{y}{Vertical position of center of text grob} 13 | 14 | \item{height}{Height of text grob} 15 | 16 | \item{rotation}{Rotation in radians} 17 | 18 | \item{just}{Justification. e.g. "left-top"} 19 | } 20 | \description{ 21 | Given a position, size, rotation, and justification of a label, calculate the bounding box coordinates 22 | } 23 | \keyword{internal} 24 | -------------------------------------------------------------------------------- /man/layout_functions.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/heat_tree--layouts.R 3 | \name{layout_functions} 4 | \alias{layout_functions} 5 | \title{Layout functions} 6 | \usage{ 7 | layout_functions( 8 | name = NULL, 9 | graph = NULL, 10 | intitial_coords = NULL, 11 | effort = 1, 12 | ... 13 | ) 14 | } 15 | \arguments{ 16 | \item{name}{(\code{character} of length 1 OR NULL) name of algorithm. Leave \code{NULL} to 17 | see all options.} 18 | 19 | \item{graph}{(\code{igraph}) The graph to generate the layout for.} 20 | 21 | \item{intitial_coords}{(\code{matrix}) Initial node layout to base new layout off of.} 22 | 23 | \item{effort}{(\code{numeric} of length 1) The amount of effort to put into layouts. Typically 24 | determines the the number of iterations.} 25 | 26 | \item{...}{(other arguments) Passed to igraph layout function used.} 27 | } 28 | \value{ 29 | The name available functions, a layout functions, 30 | or a two-column matrix depending on how arguments are provided. 31 | } 32 | \description{ 33 | Functions used to determine graph layout. 34 | Calling the function with no parameters returns available function names. 35 | Calling the function with only the name of a function returns that function. 36 | Supplying a name and a \code{\link[igraph]{graph}} object to run the layout function on the graph. 37 | } 38 | \examples{ 39 | # List available function names: 40 | layout_functions() 41 | 42 | # Execute layout function on graph: 43 | layout_functions("davidson-harel", igraph::make_ring(5)) 44 | 45 | } 46 | -------------------------------------------------------------------------------- /man/length_of_thing.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--internal.R 3 | \name{length_of_thing} 4 | \alias{length_of_thing} 5 | \title{Check length of thing} 6 | \usage{ 7 | length_of_thing(obj) 8 | } 9 | \arguments{ 10 | \item{obj}{} 11 | } 12 | \value{ 13 | \code{numeric} of length 1. 14 | } 15 | \description{ 16 | Check the length of an object, be it list, vector, or table. 17 | } 18 | \keyword{internal} 19 | -------------------------------------------------------------------------------- /man/limited_print.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/internal.R, R/old_taxa--internal.R 3 | \name{limited_print} 4 | \alias{limited_print} 5 | \title{Print a subset of a character vector} 6 | \usage{ 7 | limited_print( 8 | chars, 9 | prefix = "", 10 | sep = ", ", 11 | mid = " ... ", 12 | trunc_char = "[truncated]", 13 | max_chars = getOption("width") - nchar(prefix) - 5, 14 | type = "message" 15 | ) 16 | 17 | limited_print( 18 | chars, 19 | prefix = "", 20 | sep = ", ", 21 | mid = " ... ", 22 | trunc_char = "[truncated]", 23 | max_chars = getOption("width") - nchar(prefix) - 5, 24 | type = "message" 25 | ) 26 | } 27 | \arguments{ 28 | \item{chars}{(`character`) What to print.} 29 | 30 | \item{prefix}{(`character` of length 1) What to print before 31 | `chars`, on the same line.} 32 | 33 | \item{sep}{What to put between consecutive values} 34 | 35 | \item{mid}{What is used to indicate omitted values} 36 | 37 | \item{trunc_char}{What is appended onto truncated values} 38 | 39 | \item{max_chars}{(`numeric` of length 1) The maximum number of 40 | characters to print.} 41 | 42 | \item{type}{(`"error"`, `"warning"`, `"message"`, `"cat"`, `"print"`, `"silent"`, `"plain"`)} 43 | } 44 | \value{ 45 | `NULL` 46 | 47 | `NULL` 48 | } 49 | \description{ 50 | Prints the start and end values for a character vector. The number of values 51 | printed depend on the width of the screen by default. 52 | 53 | Prints the start and end values for a character vector. The number of values 54 | printed depend on the width of the screen by default. 55 | } 56 | \keyword{internal} 57 | -------------------------------------------------------------------------------- /man/line_coords.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/heat_tree--shape_generators.R 3 | \name{line_coords} 4 | \alias{line_coords} 5 | \title{Makes coordinates for a line} 6 | \usage{ 7 | line_coords(x1, y1, x2, y2, width) 8 | } 9 | \arguments{ 10 | \item{x1}{(\code{numeric} of length 1) x coordinate of the center of one end} 11 | 12 | \item{y1}{(\code{numeric} of length 1) y coordinate of the center of one end} 13 | 14 | \item{x2}{(\code{numeric} of length 1) x coordinate of the center of the other end} 15 | 16 | \item{y2}{(\code{numeric} of length 1) y coordinate of the center of the other end} 17 | 18 | \item{width}{(\code{numeric} of length 1) The width of the line.} 19 | } 20 | \description{ 21 | Generates an n x 2 matrix containing x and y coordinates between 1 and 0 for the points of a 22 | line with a specified width in cartesian coordinates. 23 | } 24 | \keyword{internal} 25 | -------------------------------------------------------------------------------- /man/look_for_na.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/heat_tree--internal.R 3 | \name{look_for_na} 4 | \alias{look_for_na} 5 | \title{Look for NAs in parameters} 6 | \usage{ 7 | look_for_na(taxon_ids, args) 8 | } 9 | \arguments{ 10 | \item{args}{(\code{character}) The names of arguments to verify.} 11 | } 12 | \description{ 13 | Look for NAs in parameters 14 | } 15 | \keyword{internal} 16 | -------------------------------------------------------------------------------- /man/make_dada2_asv_table.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/writers.R 3 | \name{make_dada2_asv_table} 4 | \alias{make_dada2_asv_table} 5 | \title{Make a imitation of the dada2 ASV abundance matrix} 6 | \usage{ 7 | make_dada2_asv_table(obj, asv_table = "asv_table", asv_id = "asv_id") 8 | } 9 | \arguments{ 10 | \item{obj}{A taxmap object} 11 | 12 | \item{asv_table}{The name of the abundance matrix in the taxmap object to use.} 13 | 14 | \item{asv_id}{The name of the column in \code{asv_table} with unique ASV ids or sequences.} 15 | } 16 | \value{ 17 | A numeric \code{matrix} with rows as samples and columns as ASVs 18 | } 19 | \description{ 20 | Attempts to save the abundance matrix stored as a table in a taxmap object in the 21 | dada2 ASV abundance matrix format. If the taxmap object was created using 22 | \code{\link{parse_dada2}}, then it should be able to replicate the format 23 | exactly with the default settings. 24 | } 25 | \seealso{ 26 | Other writers: 27 | \code{\link{make_dada2_tax_table}()}, 28 | \code{\link{write_greengenes}()}, 29 | \code{\link{write_mothur_taxonomy}()}, 30 | \code{\link{write_rdp}()}, 31 | \code{\link{write_silva_fasta}()}, 32 | \code{\link{write_unite_general}()} 33 | } 34 | \concept{writers} 35 | -------------------------------------------------------------------------------- /man/make_dada2_tax_table.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/writers.R 3 | \name{make_dada2_tax_table} 4 | \alias{make_dada2_tax_table} 5 | \title{Make a imitation of the dada2 taxonomy matrix} 6 | \usage{ 7 | make_dada2_tax_table(obj, asv_table = "asv_table", asv_id = "asv_id") 8 | } 9 | \arguments{ 10 | \item{obj}{A taxmap object} 11 | 12 | \item{asv_table}{The name of the abundance matrix in the taxmap object to use.} 13 | 14 | \item{asv_id}{The name of the column in \code{asv_table} with unique ASV ids or sequences.} 15 | } 16 | \value{ 17 | A character \code{matrix} with rows as ASVs and columns as taxonomic ranks. 18 | } 19 | \description{ 20 | Attempts to save the taxonomy information assocaited with an abundance matrix in a taxmap object 21 | in the dada2 taxonomy matrix format. If the taxmap object was created using 22 | \code{\link{parse_dada2}}, then it should be able to replicate the format exactly with the 23 | default settings. 24 | } 25 | \seealso{ 26 | Other writers: 27 | \code{\link{make_dada2_asv_table}()}, 28 | \code{\link{write_greengenes}()}, 29 | \code{\link{write_mothur_taxonomy}()}, 30 | \code{\link{write_rdp}()}, 31 | \code{\link{write_silva_fasta}()}, 32 | \code{\link{write_unite_general}()} 33 | } 34 | \concept{writers} 35 | -------------------------------------------------------------------------------- /man/make_fasta_with_u_replaced.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/internal.R 3 | \name{make_fasta_with_u_replaced} 4 | \alias{make_fasta_with_u_replaced} 5 | \title{Make a temporary file U's replaced with T} 6 | \usage{ 7 | make_fasta_with_u_replaced(file_path) 8 | } 9 | \arguments{ 10 | \item{file_path}{} 11 | } 12 | \value{ 13 | A path to a temporary file. 14 | } 15 | \description{ 16 | Make a temporary fasta file U's replaced with T without reading in whole file. 17 | } 18 | \keyword{internal} 19 | -------------------------------------------------------------------------------- /man/map_data_.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--taxonomy--docs.R 3 | \name{map_data_} 4 | \alias{map_data_} 5 | \title{Create a mapping without NSE} 6 | \arguments{ 7 | \item{obj}{The [taxonomy()] or [taxmap()] object.} 8 | 9 | \item{from}{The value used to name the output. There will be one output value 10 | for each value in `from`.} 11 | 12 | \item{to}{The value returned in the output.} 13 | } 14 | \value{ 15 | A vector of `to` values named by values in `from`. 16 | } 17 | \description{ 18 | Creates a named vector that maps the values of two variables associated with 19 | taxa in a [taxonomy()] or [taxmap()] object without using Non-Standard 20 | Evaluation (NSE). Both values must be named by taxon ids. This is the same as 21 | [map_data()] without NSE and can be useful in some odd cases where NSE fails 22 | to work as expected. 23 | \preformatted{ 24 | obj$map_data(from, to) 25 | map_data(obj, from, to)} 26 | } 27 | \examples{ 28 | x = c("d" = "looks like a cat", "h" = "big scary cats", 29 | "i" = "smaller cats", "m" = "might eat you", "n" = "Meow! (Feed me!)") 30 | map_data_(ex_taxmap, from = ex_taxmap$taxon_names(), to = x) 31 | 32 | } 33 | \seealso{ 34 | Other taxonomy data functions: 35 | \code{\link{classifications}()}, 36 | \code{\link{id_classifications}()}, 37 | \code{\link{is_branch}()}, 38 | \code{\link{is_internode}()}, 39 | \code{\link{is_leaf}()}, 40 | \code{\link{is_root}()}, 41 | \code{\link{is_stem}()}, 42 | \code{\link{map_data}()}, 43 | \code{\link{n_leaves}()}, 44 | \code{\link{n_leaves_1}()}, 45 | \code{\link{n_subtaxa}()}, 46 | \code{\link{n_subtaxa_1}()}, 47 | \code{\link{n_supertaxa}()}, 48 | \code{\link{n_supertaxa_1}()}, 49 | \code{\link{taxon_ids}()}, 50 | \code{\link{taxon_indexes}()}, 51 | \code{\link{taxon_names}()}, 52 | \code{\link{taxon_ranks}()} 53 | } 54 | \concept{taxonomy data functions} 55 | -------------------------------------------------------------------------------- /man/map_unique.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/internal.R, R/old_taxa--internal.R 3 | \name{map_unique} 4 | \alias{map_unique} 5 | \title{Run a function on unique values of a iterable} 6 | \usage{ 7 | map_unique(input, func, ...) 8 | 9 | map_unique(input, func, ...) 10 | } 11 | \arguments{ 12 | \item{input}{What to pass to \code{func}} 13 | 14 | \item{func}{(\code{function})} 15 | 16 | \item{...}{passed to \code{func}} 17 | } 18 | \description{ 19 | Runs a function on unique values of a list/vector and then reformats the 20 | output so there is a one-to-one relationship with the input. 21 | } 22 | \keyword{internal} 23 | -------------------------------------------------------------------------------- /man/matches.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/imports.R, R/old_taxa--imports.R 3 | \name{matches} 4 | \alias{matches} 5 | \title{dplyr select_helpers} 6 | \description{ 7 | dplyr select_helpers 8 | 9 | dplyr select_helpers 10 | } 11 | \keyword{internal} 12 | -------------------------------------------------------------------------------- /man/molten_dist.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/heat_tree--vertex_size.R 3 | \name{molten_dist} 4 | \alias{molten_dist} 5 | \title{Get all distances between points} 6 | \usage{ 7 | molten_dist(x, y) 8 | } 9 | \arguments{ 10 | \item{x}{(\code{numeric} of length 1) x coordinate} 11 | 12 | \item{y}{(\code{numeric} of length 1) y coordinate} 13 | } 14 | \value{ 15 | A \code{data.frame} 16 | } 17 | \description{ 18 | Returns the distances between every possible combination of two points. 19 | } 20 | \keyword{internal} 21 | -------------------------------------------------------------------------------- /man/multi_sep_split.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--internal.R 3 | \name{multi_sep_split} 4 | \alias{multi_sep_split} 5 | \title{Like `strsplit`, but with multiple separators} 6 | \usage{ 7 | multi_sep_split(input, split, ...) 8 | } 9 | \arguments{ 10 | \item{input}{A character vector} 11 | 12 | \item{split}{One or more separators to use to split `input`} 13 | 14 | \item{...}{Passed to [base::strsplit()]} 15 | } 16 | \description{ 17 | Splits items in a vector by multiple separators. 18 | } 19 | \keyword{internal} 20 | -------------------------------------------------------------------------------- /man/my_print.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/internal.R 3 | \name{my_print} 4 | \alias{my_print} 5 | \title{Print something} 6 | \usage{ 7 | my_print(..., verbose = TRUE) 8 | } 9 | \arguments{ 10 | \item{...}{Something to print} 11 | 12 | \item{verbose}{If \code{FALSE}, do not print anything.} 13 | } 14 | \description{ 15 | The standard print function for this package. This is a wrapper to make 16 | package-wide changes easier. 17 | } 18 | \keyword{internal} 19 | -------------------------------------------------------------------------------- /man/n_leaves.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--taxonomy--docs.R 3 | \name{n_leaves} 4 | \alias{n_leaves} 5 | \title{Get number of leaves} 6 | \arguments{ 7 | \item{obj}{([taxonomy()] or [taxmap()])} 8 | } 9 | \value{ 10 | \code{numeric} 11 | } 12 | \description{ 13 | Get number of leaves for each taxon in an object of type 14 | [taxonomy()] or [taxmap()] 15 | \preformatted{ 16 | obj$n_leaves() 17 | n_leaves(obj)} 18 | } 19 | \examples{ 20 | # Get number of leaves for each taxon 21 | n_leaves(ex_taxmap) 22 | 23 | # Filter taxa based on number of leaves 24 | filter_taxa(ex_taxmap, n_leaves > 0) 25 | 26 | } 27 | \seealso{ 28 | Other taxonomy data functions: 29 | \code{\link{classifications}()}, 30 | \code{\link{id_classifications}()}, 31 | \code{\link{is_branch}()}, 32 | \code{\link{is_internode}()}, 33 | \code{\link{is_leaf}()}, 34 | \code{\link{is_root}()}, 35 | \code{\link{is_stem}()}, 36 | \code{\link{map_data}()}, 37 | \code{\link{map_data_}()}, 38 | \code{\link{n_leaves_1}()}, 39 | \code{\link{n_subtaxa}()}, 40 | \code{\link{n_subtaxa_1}()}, 41 | \code{\link{n_supertaxa}()}, 42 | \code{\link{n_supertaxa_1}()}, 43 | \code{\link{taxon_ids}()}, 44 | \code{\link{taxon_indexes}()}, 45 | \code{\link{taxon_names}()}, 46 | \code{\link{taxon_ranks}()} 47 | } 48 | \concept{taxonomy data functions} 49 | -------------------------------------------------------------------------------- /man/n_leaves_1.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--taxonomy--docs.R 3 | \name{n_leaves_1} 4 | \alias{n_leaves_1} 5 | \title{Get number of leaves} 6 | \arguments{ 7 | \item{obj}{([taxonomy()] or [taxmap()])} 8 | } 9 | \value{ 10 | \code{numeric} 11 | } 12 | \description{ 13 | Get number of leaves for each taxon in an object of type 14 | [taxonomy()] or [taxmap()], not including leaves of subtaxa etc. 15 | \preformatted{ 16 | obj$n_leaves_1() 17 | n_leaves_1(obj)} 18 | } 19 | \examples{ 20 | # Get number of leaves for each taxon 21 | n_leaves_1(ex_taxmap) 22 | 23 | # Filter taxa based on number of leaves 24 | filter_taxa(ex_taxmap, n_leaves_1 > 0) 25 | 26 | } 27 | \seealso{ 28 | Other taxonomy data functions: 29 | \code{\link{classifications}()}, 30 | \code{\link{id_classifications}()}, 31 | \code{\link{is_branch}()}, 32 | \code{\link{is_internode}()}, 33 | \code{\link{is_leaf}()}, 34 | \code{\link{is_root}()}, 35 | \code{\link{is_stem}()}, 36 | \code{\link{map_data}()}, 37 | \code{\link{map_data_}()}, 38 | \code{\link{n_leaves}()}, 39 | \code{\link{n_subtaxa}()}, 40 | \code{\link{n_subtaxa_1}()}, 41 | \code{\link{n_supertaxa}()}, 42 | \code{\link{n_supertaxa_1}()}, 43 | \code{\link{taxon_ids}()}, 44 | \code{\link{taxon_indexes}()}, 45 | \code{\link{taxon_names}()}, 46 | \code{\link{taxon_ranks}()} 47 | } 48 | \concept{taxonomy data functions} 49 | -------------------------------------------------------------------------------- /man/n_obs.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--taxmap--docs.R 3 | \name{n_obs} 4 | \alias{n_obs} 5 | \title{Count observations in [taxmap()]} 6 | \arguments{ 7 | \item{obj}{([taxmap()])} 8 | 9 | \item{data}{Dataset name, index, or a logical vector that indicates which dataset in 10 | `obj$data` to add columns to.} 11 | 12 | \item{target}{DEPRECIATED. use "data" instead.} 13 | } 14 | \value{ 15 | `numeric` 16 | } 17 | \description{ 18 | Count observations for each taxon in a data set in a [taxmap()] object. This 19 | includes observations for the specific taxon and the observations of its 20 | subtaxa. "Observations" in this sense are the items (for list/vectors) or 21 | rows (for tables) in a dataset. By default, observations in the first data 22 | set in the [taxmap()] object is used. For example, if the data set is a 23 | table, then a value of 3 for a taxon means that their are 3 rows in that 24 | table assigned to that taxon or one of its subtaxa. 25 | \preformatted{ 26 | obj$n_obs(data) 27 | n_obs(obj, data)} 28 | } 29 | \examples{ 30 | # Get number of observations for each taxon in first dataset 31 | n_obs(ex_taxmap) 32 | 33 | # Get number of observations in a specified data set 34 | n_obs(ex_taxmap, "info") 35 | n_obs(ex_taxmap, "abund") 36 | 37 | # Filter taxa using number of observations in the first table 38 | filter_taxa(ex_taxmap, n_obs > 1) 39 | 40 | } 41 | \seealso{ 42 | Other taxmap data functions: 43 | \code{\link{n_obs_1}()} 44 | } 45 | \concept{taxmap data functions} 46 | -------------------------------------------------------------------------------- /man/n_obs_1.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--taxmap--docs.R 3 | \name{n_obs_1} 4 | \alias{n_obs_1} 5 | \title{Count observation assigned in [taxmap()]} 6 | \arguments{ 7 | \item{obj}{([taxmap()])} 8 | 9 | \item{data}{Dataset name, index, or a logical vector that indicates which dataset in 10 | `obj$data` to add columns to.} 11 | 12 | \item{target}{DEPRECIATED. use "data" instead.} 13 | } 14 | \value{ 15 | `numeric` 16 | } 17 | \description{ 18 | Count observations for each taxon in a data set in a [taxmap()] object. This 19 | includes observations for the specific taxon but NOT the observations of its 20 | subtaxa. "Observations" in this sense are the items (for list/vectors) or 21 | rows (for tables) in a dataset. By default, observations in the first data 22 | set in the [taxmap()] object is used. For example, if the data set is a 23 | table, then a value of 3 for a taxon means that their are 3 rows in that 24 | table assigned to that taxon. 25 | \preformatted{ 26 | obj$n_obs_1(data) 27 | n_obs_1(obj, data)} 28 | } 29 | \examples{ 30 | # Get number of observations for each taxon in first dataset 31 | n_obs_1(ex_taxmap) 32 | 33 | # Get number of observations in a specified data set 34 | n_obs_1(ex_taxmap, "info") 35 | n_obs_1(ex_taxmap, "abund") 36 | 37 | # Filter taxa using number of observations in the first table 38 | filter_taxa(ex_taxmap, n_obs_1 > 0) 39 | 40 | } 41 | \seealso{ 42 | Other taxmap data functions: 43 | \code{\link{n_obs}()} 44 | } 45 | \concept{taxmap data functions} 46 | -------------------------------------------------------------------------------- /man/n_subtaxa.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--taxonomy--docs.R 3 | \name{n_subtaxa} 4 | \alias{n_subtaxa} 5 | \title{Get number of subtaxa} 6 | \arguments{ 7 | \item{obj}{([taxonomy()] or [taxmap()])} 8 | } 9 | \value{ 10 | \code{numeric} 11 | } 12 | \description{ 13 | Get number of subtaxa for each taxon in an object of type 14 | [taxonomy()] or [taxmap()] 15 | \preformatted{ 16 | obj$n_subtaxa() 17 | n_subtaxa(obj)} 18 | } 19 | \examples{ 20 | # Count number of subtaxa within each taxon 21 | n_subtaxa(ex_taxmap) 22 | 23 | # Filter taxa based on number of subtaxa 24 | # (this command removed all leaves or "tips" of the tree) 25 | filter_taxa(ex_taxmap, n_subtaxa > 0) 26 | 27 | } 28 | \seealso{ 29 | Other taxonomy data functions: 30 | \code{\link{classifications}()}, 31 | \code{\link{id_classifications}()}, 32 | \code{\link{is_branch}()}, 33 | \code{\link{is_internode}()}, 34 | \code{\link{is_leaf}()}, 35 | \code{\link{is_root}()}, 36 | \code{\link{is_stem}()}, 37 | \code{\link{map_data}()}, 38 | \code{\link{map_data_}()}, 39 | \code{\link{n_leaves}()}, 40 | \code{\link{n_leaves_1}()}, 41 | \code{\link{n_subtaxa_1}()}, 42 | \code{\link{n_supertaxa}()}, 43 | \code{\link{n_supertaxa_1}()}, 44 | \code{\link{taxon_ids}()}, 45 | \code{\link{taxon_indexes}()}, 46 | \code{\link{taxon_names}()}, 47 | \code{\link{taxon_ranks}()} 48 | } 49 | \concept{taxonomy data functions} 50 | -------------------------------------------------------------------------------- /man/n_subtaxa_1.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--taxonomy--docs.R 3 | \name{n_subtaxa_1} 4 | \alias{n_subtaxa_1} 5 | \title{Get number of subtaxa} 6 | \arguments{ 7 | \item{obj}{([taxonomy()] or [taxmap()])} 8 | } 9 | \value{ 10 | \code{numeric} 11 | } 12 | \description{ 13 | Get number of subtaxa for each taxon in an object of type 14 | [taxonomy()] or [taxmap()], not including subtaxa of subtaxa etc. This does not 15 | include subtaxa assigned to subtaxa. 16 | \preformatted{ 17 | obj$n_subtaxa_1() 18 | n_subtaxa_1(obj)} 19 | } 20 | \examples{ 21 | # Count number of immediate subtaxa in each taxon 22 | n_subtaxa_1(ex_taxmap) 23 | 24 | # Filter taxa based on number of subtaxa 25 | # (this command removed all leaves or "tips" of the tree) 26 | filter_taxa(ex_taxmap, n_subtaxa_1 > 0) 27 | 28 | } 29 | \seealso{ 30 | Other taxonomy data functions: 31 | \code{\link{classifications}()}, 32 | \code{\link{id_classifications}()}, 33 | \code{\link{is_branch}()}, 34 | \code{\link{is_internode}()}, 35 | \code{\link{is_leaf}()}, 36 | \code{\link{is_root}()}, 37 | \code{\link{is_stem}()}, 38 | \code{\link{map_data}()}, 39 | \code{\link{map_data_}()}, 40 | \code{\link{n_leaves}()}, 41 | \code{\link{n_leaves_1}()}, 42 | \code{\link{n_subtaxa}()}, 43 | \code{\link{n_supertaxa}()}, 44 | \code{\link{n_supertaxa_1}()}, 45 | \code{\link{taxon_ids}()}, 46 | \code{\link{taxon_indexes}()}, 47 | \code{\link{taxon_names}()}, 48 | \code{\link{taxon_ranks}()} 49 | } 50 | \concept{taxonomy data functions} 51 | -------------------------------------------------------------------------------- /man/n_supertaxa.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--taxonomy--docs.R 3 | \name{n_supertaxa} 4 | \alias{n_supertaxa} 5 | \title{Get number of supertaxa} 6 | \arguments{ 7 | \item{obj}{([taxonomy()] or [taxmap()])} 8 | } 9 | \value{ 10 | \code{numeric} 11 | } 12 | \description{ 13 | Get number of supertaxa for each taxon in an object of type 14 | [taxonomy()] or [taxmap()]. 15 | \preformatted{ 16 | obj$n_supertaxa() 17 | n_supertaxa(obj)} 18 | } 19 | \examples{ 20 | # Count number of supertaxa that contain each taxon 21 | n_supertaxa(ex_taxmap) 22 | 23 | # Filter taxa based on the number of supertaxa 24 | # (this command removes all root taxa) 25 | filter_taxa(ex_taxmap, n_supertaxa > 0) 26 | 27 | } 28 | \seealso{ 29 | Other taxonomy data functions: 30 | \code{\link{classifications}()}, 31 | \code{\link{id_classifications}()}, 32 | \code{\link{is_branch}()}, 33 | \code{\link{is_internode}()}, 34 | \code{\link{is_leaf}()}, 35 | \code{\link{is_root}()}, 36 | \code{\link{is_stem}()}, 37 | \code{\link{map_data}()}, 38 | \code{\link{map_data_}()}, 39 | \code{\link{n_leaves}()}, 40 | \code{\link{n_leaves_1}()}, 41 | \code{\link{n_subtaxa}()}, 42 | \code{\link{n_subtaxa_1}()}, 43 | \code{\link{n_supertaxa_1}()}, 44 | \code{\link{taxon_ids}()}, 45 | \code{\link{taxon_indexes}()}, 46 | \code{\link{taxon_names}()}, 47 | \code{\link{taxon_ranks}()} 48 | } 49 | \concept{taxonomy data functions} 50 | -------------------------------------------------------------------------------- /man/n_supertaxa_1.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--taxonomy--docs.R 3 | \name{n_supertaxa_1} 4 | \alias{n_supertaxa_1} 5 | \title{Get number of supertaxa} 6 | \arguments{ 7 | \item{obj}{([taxonomy()] or [taxmap()])} 8 | } 9 | \value{ 10 | \code{numeric} 11 | } 12 | \description{ 13 | Get number of immediate supertaxa (i.e. not supertaxa of supertaxa, etc) for 14 | each taxon in an object of type [taxonomy()] or [taxmap()]. This should 15 | always be either 1 or 0. 16 | \preformatted{ 17 | obj$n_supertaxa_1() 18 | n_supertaxa_1(obj)} 19 | } 20 | \examples{ 21 | # Test for the presence of supertaxa containing each taxon 22 | n_supertaxa_1(ex_taxmap) 23 | 24 | # Filter taxa based on the presence of supertaxa 25 | # (this command removes all root taxa) 26 | filter_taxa(ex_taxmap, n_supertaxa_1 > 0) 27 | 28 | } 29 | \seealso{ 30 | Other taxonomy data functions: 31 | \code{\link{classifications}()}, 32 | \code{\link{id_classifications}()}, 33 | \code{\link{is_branch}()}, 34 | \code{\link{is_internode}()}, 35 | \code{\link{is_leaf}()}, 36 | \code{\link{is_root}()}, 37 | \code{\link{is_stem}()}, 38 | \code{\link{map_data}()}, 39 | \code{\link{map_data_}()}, 40 | \code{\link{n_leaves}()}, 41 | \code{\link{n_leaves_1}()}, 42 | \code{\link{n_subtaxa}()}, 43 | \code{\link{n_subtaxa_1}()}, 44 | \code{\link{n_supertaxa}()}, 45 | \code{\link{taxon_ids}()}, 46 | \code{\link{taxon_indexes}()}, 47 | \code{\link{taxon_names}()}, 48 | \code{\link{taxon_ranks}()} 49 | } 50 | \concept{taxonomy data functions} 51 | -------------------------------------------------------------------------------- /man/name_font.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--taxmap--printers.R 3 | \name{name_font} 4 | \alias{name_font} 5 | \title{Variable name formatting in print methods} 6 | \usage{ 7 | name_font(text) 8 | } 9 | \arguments{ 10 | \item{text}{What to print} 11 | } 12 | \description{ 13 | A simple wrapper to make changing the formatting of text printed easier. 14 | This is used for non-data, formatting characters 15 | } 16 | \seealso{ 17 | Other printer fonts: 18 | \code{\link{desc_font}()}, 19 | \code{\link{error_font}()}, 20 | \code{\link{punc_font}()}, 21 | \code{\link{tid_font}()} 22 | } 23 | \concept{printer fonts} 24 | \keyword{internal} 25 | -------------------------------------------------------------------------------- /man/names_used.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--taxonomy--docs.R 3 | \name{names_used} 4 | \alias{names_used} 5 | \title{Get names of data used in expressions} 6 | \arguments{ 7 | \item{obj}{a [taxonomy()] or [taxmap()] object} 8 | 9 | \item{...}{One or more expressions} 10 | } 11 | \value{ 12 | Named `character` 13 | } 14 | \description{ 15 | Get names of available data used in expressions. This is used to find data 16 | for use with [non-standard evaluation](http://adv-r.had.co.nz/Computing-on-the-language.html) (NSE) in 17 | functions like [filter_taxa()]. Expressions are not evaluated and do not need 18 | to make sense. 19 | \preformatted{ 20 | obj$names_used(...)} 21 | } 22 | \seealso{ 23 | Other NSE helpers: 24 | \code{\link{all_names}()}, 25 | \code{\link{data_used}}, 26 | \code{\link{get_data}()} 27 | } 28 | \concept{NSE helpers} 29 | \keyword{internal} 30 | -------------------------------------------------------------------------------- /man/ncbi_sequence.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/sequence_download.R 3 | \name{ncbi_sequence} 4 | \alias{ncbi_sequence} 5 | \title{Downloads sequences from ids} 6 | \usage{ 7 | ncbi_sequence(ids, batch_size = 100) 8 | } 9 | \arguments{ 10 | \item{ids}{(\code{character}) One or more accession numbers to get sequences for} 11 | 12 | \item{batch_size}{(\code{numeric} of length 1) The number of sequences to request in each query. 13 | To large of values might case failures and too small will increase time to completion.} 14 | } 15 | \value{ 16 | (\code{list} of \code{character}) 17 | } 18 | \description{ 19 | Downloads the sequences associated with GenBank accession ids. 20 | } 21 | \keyword{internal} 22 | -------------------------------------------------------------------------------- /man/num_range.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/imports.R, R/old_taxa--imports.R 3 | \name{num_range} 4 | \alias{num_range} 5 | \title{dplyr select_helpers} 6 | \description{ 7 | dplyr select_helpers 8 | 9 | dplyr select_helpers 10 | } 11 | \keyword{internal} 12 | -------------------------------------------------------------------------------- /man/one_of.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/imports.R, R/old_taxa--imports.R 3 | \name{one_of} 4 | \alias{one_of} 5 | \title{dplyr select_helpers} 6 | \description{ 7 | dplyr select_helpers 8 | 9 | dplyr select_helpers 10 | } 11 | \keyword{internal} 12 | -------------------------------------------------------------------------------- /man/parse_dataset.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--taxmap--option_parsers.R 3 | \name{parse_dataset} 4 | \alias{parse_dataset} 5 | \title{Parse options specifying datasets} 6 | \usage{ 7 | parse_dataset(obj, data, must_be_valid = TRUE, needed = TRUE, rm_na = TRUE) 8 | } 9 | \arguments{ 10 | \item{obj}{The taxmap object.} 11 | 12 | \item{data}{The name/index of datasets in a taxmap object to use. Can also be a logical vector 13 | of length equal to the number of datasets.} 14 | 15 | \item{must_be_valid}{If TRUE, all datasets specified must be valid or an error occurs.} 16 | 17 | \item{needed}{If TRUE, at least one dataset must be specified or an error occurs.} 18 | 19 | \item{rm_na}{If TRUE, then invalid datasets do result in NAs in the output.} 20 | } 21 | \value{ 22 | The indexes for the datasets selected 23 | } 24 | \description{ 25 | Parse options specifying datasets in taxmap objects 26 | } 27 | \keyword{internal} 28 | -------------------------------------------------------------------------------- /man/parse_greengenes.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/parsers.R 3 | \name{parse_greengenes} 4 | \alias{parse_greengenes} 5 | \title{Parse Greengenes release} 6 | \usage{ 7 | parse_greengenes(tax_file, seq_file = NULL) 8 | } 9 | \arguments{ 10 | \item{tax_file}{(\code{character} of length 1) The file path to the 11 | greengenes taxonomy file.} 12 | 13 | \item{seq_file}{(\code{character} of length 1) The file path to the 14 | greengenes sequence fasta file. This is optional.} 15 | } 16 | \value{ 17 | \code{\link{taxmap}} 18 | } 19 | \description{ 20 | Parses the greengenes database. 21 | } 22 | \details{ 23 | The taxonomy input file has a format like: 24 | 25 | \preformatted{ 26 | 228054 k__Bacteria; p__Cyanobacteria; c__Synechococcophycideae; o__Synech... 27 | 844608 k__Bacteria; p__Cyanobacteria; c__Synechococcophycideae; o__Synech... 28 | ... 29 | } 30 | 31 | The optional sequence file has a format like: 32 | 33 | \preformatted{ 34 | >1111886 35 | AACGAACGCTGGCGGCATGCCTAACACATGCAAGTCGAACGAGACCTTCGGGTCTAGTGGCGCACGGGTGCGTA... 36 | >1111885 37 | AGAGTTTGATCCTGGCTCAGAATGAACGCTGGCGGCGTGCCTAACACATGCAAGTCGTACGAGAAATCCCGAGC... 38 | ... 39 | } 40 | } 41 | \seealso{ 42 | Other parsers: 43 | \code{\link{extract_tax_data}()}, 44 | \code{\link{lookup_tax_data}()}, 45 | \code{\link{parse_dada2}()}, 46 | \code{\link{parse_edge_list}()}, 47 | \code{\link{parse_mothur_tax_summary}()}, 48 | \code{\link{parse_mothur_taxonomy}()}, 49 | \code{\link{parse_newick}()}, 50 | \code{\link{parse_phylo}()}, 51 | \code{\link{parse_phyloseq}()}, 52 | \code{\link{parse_qiime_biom}()}, 53 | \code{\link{parse_rdp}()}, 54 | \code{\link{parse_silva_fasta}()}, 55 | \code{\link{parse_tax_data}()}, 56 | \code{\link{parse_ubiome}()}, 57 | \code{\link{parse_unite_general}()} 58 | } 59 | \concept{parsers} 60 | -------------------------------------------------------------------------------- /man/parse_heirarchies_to_taxonomy.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--taxonomy--internal.R 3 | \name{parse_heirarchies_to_taxonomy} 4 | \alias{parse_heirarchies_to_taxonomy} 5 | \title{Infer edge list from hierarchies} 6 | \usage{ 7 | parse_heirarchies_to_taxonomy(heirarchies) 8 | } 9 | \value{ 10 | A list of [hierarchy()] objects. 11 | } 12 | \description{ 13 | Infer edge list and unique taxa from hierarchies. 14 | } 15 | \keyword{internal} 16 | -------------------------------------------------------------------------------- /man/parse_newick.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/parsers.R 3 | \name{parse_newick} 4 | \alias{parse_newick} 5 | \title{Parse a Newick file} 6 | \usage{ 7 | parse_newick(file = NULL, text = NULL) 8 | } 9 | \arguments{ 10 | \item{file}{(\code{character} of length 1) The file path to the input file. Either \code{file} or \code{text} must be supplied but not both.} 11 | 12 | \item{text}{(\code{character} of length 1) The raw text to parse. Either \code{file} or \code{text} must be supplied but not both.} 13 | } 14 | \value{ 15 | \code{\link{taxmap}} 16 | } 17 | \description{ 18 | Parse a Newick file into a taxmap object. 19 | } 20 | \details{ 21 | The input file has a format like: 22 | 23 | \preformatted{ 24 | (ant:17, (bat:31, cow:22):7, dog:22, (elk:33, fox:12):40); 25 | (dog:20, (elephant:30, horse:60):20):50; 26 | } 27 | } 28 | \seealso{ 29 | Other parsers: 30 | \code{\link{extract_tax_data}()}, 31 | \code{\link{lookup_tax_data}()}, 32 | \code{\link{parse_dada2}()}, 33 | \code{\link{parse_edge_list}()}, 34 | \code{\link{parse_greengenes}()}, 35 | \code{\link{parse_mothur_tax_summary}()}, 36 | \code{\link{parse_mothur_taxonomy}()}, 37 | \code{\link{parse_phylo}()}, 38 | \code{\link{parse_phyloseq}()}, 39 | \code{\link{parse_qiime_biom}()}, 40 | \code{\link{parse_rdp}()}, 41 | \code{\link{parse_silva_fasta}()}, 42 | \code{\link{parse_tax_data}()}, 43 | \code{\link{parse_ubiome}()}, 44 | \code{\link{parse_unite_general}()} 45 | } 46 | \concept{parsers} 47 | -------------------------------------------------------------------------------- /man/parse_phylo.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/parsers.R 3 | \name{parse_phylo} 4 | \alias{parse_phylo} 5 | \title{Parse a phylo object} 6 | \usage{ 7 | parse_phylo(obj) 8 | } 9 | \arguments{ 10 | \item{obj}{A phylo object from the ape package.} 11 | } 12 | \value{ 13 | \code{\link{taxmap}} 14 | } 15 | \description{ 16 | Parses a phylo object from the ape package. 17 | } 18 | \seealso{ 19 | Other parsers: 20 | \code{\link{extract_tax_data}()}, 21 | \code{\link{lookup_tax_data}()}, 22 | \code{\link{parse_dada2}()}, 23 | \code{\link{parse_edge_list}()}, 24 | \code{\link{parse_greengenes}()}, 25 | \code{\link{parse_mothur_tax_summary}()}, 26 | \code{\link{parse_mothur_taxonomy}()}, 27 | \code{\link{parse_newick}()}, 28 | \code{\link{parse_phyloseq}()}, 29 | \code{\link{parse_qiime_biom}()}, 30 | \code{\link{parse_rdp}()}, 31 | \code{\link{parse_silva_fasta}()}, 32 | \code{\link{parse_tax_data}()}, 33 | \code{\link{parse_ubiome}()}, 34 | \code{\link{parse_unite_general}()} 35 | } 36 | \concept{parsers} 37 | -------------------------------------------------------------------------------- /man/parse_possibly_named_logical.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--taxmap--internal.R 3 | \name{parse_possibly_named_logical} 4 | \alias{parse_possibly_named_logical} 5 | \title{used to parse inputs to `drop_obs` and `reassign_obs`} 6 | \usage{ 7 | parse_possibly_named_logical(input, data, default) 8 | } 9 | \description{ 10 | used to parse inputs to `drop_obs` and `reassign_obs` 11 | } 12 | \keyword{internal} 13 | -------------------------------------------------------------------------------- /man/parse_primersearch.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/primersearch.R 3 | \name{parse_primersearch} 4 | \alias{parse_primersearch} 5 | \title{Parse EMBOSS primersearch output} 6 | \usage{ 7 | parse_primersearch(file_path) 8 | } 9 | \arguments{ 10 | \item{file_path}{The path to a primersearch output file.} 11 | } 12 | \value{ 13 | A data frame with each row corresponding to amplicon data 14 | } 15 | \description{ 16 | Parses the output file from EMBOSS primersearch into a data.frame with rows corresponding to 17 | predicted amplicons and their associated information. 18 | } 19 | \seealso{ 20 | \code{\link{run_primersearch}} 21 | } 22 | -------------------------------------------------------------------------------- /man/parse_raw_heirarchies_to_taxonomy.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--taxonomy--internal.R 3 | \name{parse_raw_heirarchies_to_taxonomy} 4 | \alias{parse_raw_heirarchies_to_taxonomy} 5 | \title{Infer edge list from hierarchies composed of character vectors} 6 | \usage{ 7 | parse_raw_heirarchies_to_taxonomy(heirarchies, named_by_rank = FALSE) 8 | } 9 | \arguments{ 10 | \item{named_by_rank}{(`TRUE`/`FALSE`) If `TRUE` and the input is a list of 11 | vectors with each vector named by ranks, include that rank info in the 12 | output object, so it can be accessed by `out$taxon_ranks()`. If `TRUE`, 13 | taxa with different ranks, but the same name and location in the taxonomy, 14 | will be considered different taxa.} 15 | } 16 | \value{ 17 | A list of character vectors. 18 | } 19 | \description{ 20 | Infer edge list and unique taxa from hierarchies. 21 | } 22 | \keyword{internal} 23 | -------------------------------------------------------------------------------- /man/parse_seq_input.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/option_parsers.R 3 | \name{parse_seq_input} 4 | \alias{parse_seq_input} 5 | \title{Read sequences in an unknown format} 6 | \usage{ 7 | parse_seq_input( 8 | input = NULL, 9 | file = NULL, 10 | output_format = "character", 11 | u_to_t = FALSE 12 | ) 13 | } 14 | \arguments{ 15 | \item{input}{(\code{character}) One of the following: 16 | \describe{ 17 | \item{A character vector of sequences}{See the example below for what this 18 | looks like. The parser \code{\link{read_fasta}} produces output like this.} 19 | \item{A list of character vectors}{Each vector should have one base per element.} 20 | \item{A "DNAbin" object}{This is the result of parsers like 21 | \code{\link[ape]{read.FASTA}}.} 22 | \item{A list of "SeqFastadna" objects}{This is the result of parsers like 23 | \code{\link[seqinr]{read.fasta}}.} 24 | Either "input" or "file" must be supplied but not both. 25 | }} 26 | 27 | \item{file}{The path to a FASTA file containing sequences to use. Either 28 | "input" or "file" must be supplied but not both.} 29 | 30 | \item{output_format}{The format of the sequences returned. Either "character" or "DNAbin".} 31 | 32 | \item{u_to_t}{If `TRUE`, then "U" in the sequence will be converted to "T".} 33 | } 34 | \value{ 35 | A named character vector of sequences 36 | } 37 | \description{ 38 | Read sequences in an unknown format. This is meant to parse the sequence 39 | input arguments of functions like \code{\link{primersearch}}. 40 | } 41 | \keyword{internal} 42 | -------------------------------------------------------------------------------- /man/parse_summary_seqs.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/mothur.R 3 | \name{parse_summary_seqs} 4 | \alias{parse_summary_seqs} 5 | \title{Parse summary.seqs output} 6 | \usage{ 7 | parse_summary_seqs(text = NULL, file = NULL) 8 | } 9 | \arguments{ 10 | \item{text}{The text output of \code{summary.seqs}} 11 | 12 | \item{file}{The path to saved output of \code{summary.seqs}} 13 | } 14 | \value{ 15 | A \code{data.frame} of statistics 16 | } 17 | \description{ 18 | Extract statistics from the command line output of mothur command \code{summary.seqs} and 19 | return the results in a \code{data.frame} 20 | } 21 | \keyword{internal} 22 | -------------------------------------------------------------------------------- /man/parse_ubiome.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/parsers.R 3 | \name{parse_ubiome} 4 | \alias{parse_ubiome} 5 | \title{Converts the uBiome file format to taxmap} 6 | \usage{ 7 | parse_ubiome(file = NULL, table = NULL) 8 | } 9 | \arguments{ 10 | \item{file}{(\code{character} of length 1) The file path to the input file. 11 | Either "file", or "table" must be used, but only one.} 12 | 13 | \item{table}{(\code{character} of length 1) An already parsed data.frame or 14 | tibble. Either "file", or "table" must be used, but only one.} 15 | } 16 | \value{ 17 | \code{\link{taxmap}} 18 | } 19 | \description{ 20 | Converts the uBiome file format to taxmap. NOTE: This is experimental and might not work if 21 | uBiome changes their format. Contact the maintainers if you encounter problems/ 22 | } 23 | \details{ 24 | The input file has a format like: 25 | 26 | \preformatted{ 27 | tax_name,tax_rank,count,count_norm,taxon,parent 28 | root,root,29393,1011911,1, 29 | Bacteria,superkingdom,29047,1000000,2,131567 30 | Campylobacter,genus,23,791,194,72294 31 | Flavobacterium,genus,264,9088,237,49546 32 | } 33 | } 34 | \seealso{ 35 | Other parsers: 36 | \code{\link{extract_tax_data}()}, 37 | \code{\link{lookup_tax_data}()}, 38 | \code{\link{parse_dada2}()}, 39 | \code{\link{parse_edge_list}()}, 40 | \code{\link{parse_greengenes}()}, 41 | \code{\link{parse_mothur_tax_summary}()}, 42 | \code{\link{parse_mothur_taxonomy}()}, 43 | \code{\link{parse_newick}()}, 44 | \code{\link{parse_phylo}()}, 45 | \code{\link{parse_phyloseq}()}, 46 | \code{\link{parse_qiime_biom}()}, 47 | \code{\link{parse_rdp}()}, 48 | \code{\link{parse_silva_fasta}()}, 49 | \code{\link{parse_tax_data}()}, 50 | \code{\link{parse_unite_general}()} 51 | } 52 | \concept{parsers} 53 | -------------------------------------------------------------------------------- /man/polygon_coords.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/heat_tree--shape_generators.R 3 | \name{polygon_coords} 4 | \alias{polygon_coords} 5 | \title{Makes coordinates for a regular polygon} 6 | \usage{ 7 | polygon_coords(n = 5, x = 0, y = 0, radius = 1, angle = 0) 8 | } 9 | \arguments{ 10 | \item{n}{(\code{numeric} of length 1) The number of nodes in the polygon.} 11 | 12 | \item{x}{(\code{numeric} of length 1) x coordinate of center} 13 | 14 | \item{y}{(\code{numeric} of length 1) y coordinate of center} 15 | 16 | \item{radius}{(\code{numeric} of length 1) The diameter of the circle.} 17 | 18 | \item{angle}{(\code{numeric} of length 1) Angle to rotate points around the center of the circle.} 19 | } 20 | \description{ 21 | Generates an n x 2 matrix containing x and y coordinates between 1 and 0 for the points of a 22 | regular polygon. 23 | } 24 | \details{ 25 | Inspired by (i.e. stolen from) https://gist.github.com/baptiste/2224724, which was 26 | itself inspired from a post by William Dunlap on r-help (10/09/09) 27 | } 28 | \keyword{internal} 29 | -------------------------------------------------------------------------------- /man/prefixed_print.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--taxmap--printers.R 3 | \name{prefixed_print} 4 | \alias{prefixed_print} 5 | \title{Print a object with a prefix} 6 | \usage{ 7 | prefixed_print(x, prefix, ...) 8 | } 9 | \arguments{ 10 | \item{x}{What to print.} 11 | } 12 | \description{ 13 | Print a object with a prefix. Uses the standard print method of the object. 14 | } 15 | \keyword{internal} 16 | -------------------------------------------------------------------------------- /man/primersearch_is_installed.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/primersearch.R 3 | \name{primersearch_is_installed} 4 | \alias{primersearch_is_installed} 5 | \title{Test if primersearch is installed} 6 | \usage{ 7 | primersearch_is_installed(must_be_installed = TRUE) 8 | } 9 | \arguments{ 10 | \item{must_be_installed}{(\code{logical} of length 1) 11 | If \code{TRUE}, throw an error if primersearch is not installed.} 12 | } 13 | \value{ 14 | \code{logical} of length 1 15 | } 16 | \description{ 17 | Test if primersearch is installed 18 | } 19 | \keyword{internal} 20 | -------------------------------------------------------------------------------- /man/print__character.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--taxmap--printers.R 3 | \name{print__character} 4 | \alias{print__character} 5 | \title{Print a character} 6 | \usage{ 7 | print__character(obj, data, name, prefix, max_width, max_rows) 8 | } 9 | \arguments{ 10 | \item{obj}{The taxmap object containing the thing to print} 11 | 12 | \item{data}{Something to print} 13 | 14 | \item{name}{The name of the thing to print} 15 | 16 | \item{prefix}{What to put before the thing printed. Typically a space.} 17 | 18 | \item{max_width}{Maximum width in number of characters to print} 19 | 20 | \item{max_rows}{Maximum number of rows to print} 21 | } 22 | \description{ 23 | Print a character for the print method of taxmap objects. 24 | } 25 | \details{ 26 | Which print method is called is determined by its name, so changing the name 27 | of this function will change when it is called. 28 | } 29 | \seealso{ 30 | Other taxmap print methods: 31 | \code{\link{print__data.frame}()}, 32 | \code{\link{print__default_}()}, 33 | \code{\link{print__factor}()}, 34 | \code{\link{print__integer}()}, 35 | \code{\link{print__list}()}, 36 | \code{\link{print__logical}()}, 37 | \code{\link{print__matrix}()}, 38 | \code{\link{print__numeric}()}, 39 | \code{\link{print__ordered}()}, 40 | \code{\link{print__tbl_df}()}, 41 | \code{\link{print__vector}()} 42 | } 43 | \concept{taxmap print methods} 44 | \keyword{internal} 45 | -------------------------------------------------------------------------------- /man/print__data.frame.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--taxmap--printers.R 3 | \name{print__data.frame} 4 | \alias{print__data.frame} 5 | \title{Print a data.frame} 6 | \usage{ 7 | print__data.frame(obj, data, name, prefix, max_width, max_rows) 8 | } 9 | \arguments{ 10 | \item{obj}{The taxmap object containing the thing to print} 11 | 12 | \item{data}{Something to print} 13 | 14 | \item{name}{The name of the thing to print} 15 | 16 | \item{prefix}{What to put before the thing printed. Typically a space.} 17 | 18 | \item{max_width}{Maximum width in number of characters to print} 19 | 20 | \item{max_rows}{Maximum number of rows to print} 21 | } 22 | \description{ 23 | Print a data.frame for the print method of taxmap objects. 24 | } 25 | \details{ 26 | Which print method is called is determined by its name, so changing the name 27 | of this function will change when it is called. 28 | } 29 | \seealso{ 30 | Other taxmap print methods: 31 | \code{\link{print__character}()}, 32 | \code{\link{print__default_}()}, 33 | \code{\link{print__factor}()}, 34 | \code{\link{print__integer}()}, 35 | \code{\link{print__list}()}, 36 | \code{\link{print__logical}()}, 37 | \code{\link{print__matrix}()}, 38 | \code{\link{print__numeric}()}, 39 | \code{\link{print__ordered}()}, 40 | \code{\link{print__tbl_df}()}, 41 | \code{\link{print__vector}()} 42 | } 43 | \concept{taxmap print methods} 44 | \keyword{internal} 45 | -------------------------------------------------------------------------------- /man/print__default_.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--taxmap--printers.R 3 | \name{print__default_} 4 | \alias{print__default_} 5 | \title{Print method for unsupported} 6 | \usage{ 7 | print__default_(obj, data, name, prefix, max_width, max_rows) 8 | } 9 | \arguments{ 10 | \item{obj}{The taxmap object containing the thing to print} 11 | 12 | \item{data}{Something to print} 13 | 14 | \item{name}{The name of the thing to print} 15 | 16 | \item{prefix}{What to put before the thing printed. Typically a space.} 17 | 18 | \item{max_width}{Maximum width in number of characters to print} 19 | 20 | \item{max_rows}{Maximum number of rows to print} 21 | } 22 | \description{ 23 | Print method for unsupported classes for taxmap objects 24 | } 25 | \details{ 26 | Which print method is called is determined by its name, so changing the name 27 | of this function will change when it is called. 28 | } 29 | \seealso{ 30 | Other taxmap print methods: 31 | \code{\link{print__character}()}, 32 | \code{\link{print__data.frame}()}, 33 | \code{\link{print__factor}()}, 34 | \code{\link{print__integer}()}, 35 | \code{\link{print__list}()}, 36 | \code{\link{print__logical}()}, 37 | \code{\link{print__matrix}()}, 38 | \code{\link{print__numeric}()}, 39 | \code{\link{print__ordered}()}, 40 | \code{\link{print__tbl_df}()}, 41 | \code{\link{print__vector}()} 42 | } 43 | \concept{taxmap print methods} 44 | \keyword{internal} 45 | -------------------------------------------------------------------------------- /man/print__factor.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--taxmap--printers.R 3 | \name{print__factor} 4 | \alias{print__factor} 5 | \title{Print a factor} 6 | \usage{ 7 | print__factor(obj, data, name, prefix, max_width, max_rows) 8 | } 9 | \arguments{ 10 | \item{obj}{The taxmap object containing the thing to print} 11 | 12 | \item{data}{Something to print} 13 | 14 | \item{name}{The name of the thing to print} 15 | 16 | \item{prefix}{What to put before the thing printed. Typically a space.} 17 | 18 | \item{max_width}{Maximum width in number of characters to print} 19 | 20 | \item{max_rows}{Maximum number of rows to print} 21 | } 22 | \description{ 23 | Print a factor for the print method of taxmap objects. 24 | } 25 | \details{ 26 | Which print method is called is determined by its name, so changing the name 27 | of this function will change when it is called. 28 | } 29 | \seealso{ 30 | Other taxmap print methods: 31 | \code{\link{print__character}()}, 32 | \code{\link{print__data.frame}()}, 33 | \code{\link{print__default_}()}, 34 | \code{\link{print__integer}()}, 35 | \code{\link{print__list}()}, 36 | \code{\link{print__logical}()}, 37 | \code{\link{print__matrix}()}, 38 | \code{\link{print__numeric}()}, 39 | \code{\link{print__ordered}()}, 40 | \code{\link{print__tbl_df}()}, 41 | \code{\link{print__vector}()} 42 | } 43 | \concept{taxmap print methods} 44 | \keyword{internal} 45 | -------------------------------------------------------------------------------- /man/print__integer.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--taxmap--printers.R 3 | \name{print__integer} 4 | \alias{print__integer} 5 | \title{Print an integer} 6 | \usage{ 7 | print__integer(obj, data, name, prefix, max_width, max_rows) 8 | } 9 | \arguments{ 10 | \item{obj}{The taxmap object containing the thing to print} 11 | 12 | \item{data}{Something to print} 13 | 14 | \item{name}{The name of the thing to print} 15 | 16 | \item{prefix}{What to put before the thing printed. Typically a space.} 17 | 18 | \item{max_width}{Maximum width in number of characters to print} 19 | 20 | \item{max_rows}{Maximum number of rows to print} 21 | } 22 | \description{ 23 | Print an integer for the print method of taxmap objects. 24 | } 25 | \details{ 26 | Which print method is called is determined by its name, so changing the name 27 | of this function will change when it is called. 28 | } 29 | \seealso{ 30 | Other taxmap print methods: 31 | \code{\link{print__character}()}, 32 | \code{\link{print__data.frame}()}, 33 | \code{\link{print__default_}()}, 34 | \code{\link{print__factor}()}, 35 | \code{\link{print__list}()}, 36 | \code{\link{print__logical}()}, 37 | \code{\link{print__matrix}()}, 38 | \code{\link{print__numeric}()}, 39 | \code{\link{print__ordered}()}, 40 | \code{\link{print__tbl_df}()}, 41 | \code{\link{print__vector}()} 42 | } 43 | \concept{taxmap print methods} 44 | \keyword{internal} 45 | -------------------------------------------------------------------------------- /man/print__list.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--taxmap--printers.R 3 | \name{print__list} 4 | \alias{print__list} 5 | \title{Print a list} 6 | \usage{ 7 | print__list(obj, data, name, prefix, max_width, max_rows) 8 | } 9 | \arguments{ 10 | \item{obj}{The taxmap object containing the thing to print} 11 | 12 | \item{data}{Something to print} 13 | 14 | \item{name}{The name of the thing to print} 15 | 16 | \item{prefix}{What to put before the thing printed. Typically a space.} 17 | 18 | \item{max_width}{Maximum width in number of characters to print} 19 | 20 | \item{max_rows}{Maximum number of rows to print} 21 | } 22 | \description{ 23 | Print a list for the print method of taxmap objects. 24 | } 25 | \details{ 26 | Which print method is called is determined by its name, so changing the name 27 | of this function will change when it is called. 28 | } 29 | \seealso{ 30 | Other taxmap print methods: 31 | \code{\link{print__character}()}, 32 | \code{\link{print__data.frame}()}, 33 | \code{\link{print__default_}()}, 34 | \code{\link{print__factor}()}, 35 | \code{\link{print__integer}()}, 36 | \code{\link{print__logical}()}, 37 | \code{\link{print__matrix}()}, 38 | \code{\link{print__numeric}()}, 39 | \code{\link{print__ordered}()}, 40 | \code{\link{print__tbl_df}()}, 41 | \code{\link{print__vector}()} 42 | } 43 | \concept{taxmap print methods} 44 | \keyword{internal} 45 | -------------------------------------------------------------------------------- /man/print__logical.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--taxmap--printers.R 3 | \name{print__logical} 4 | \alias{print__logical} 5 | \title{Print a logical} 6 | \usage{ 7 | print__logical(obj, data, name, prefix, max_width, max_rows) 8 | } 9 | \arguments{ 10 | \item{obj}{The taxmap object containing the thing to print} 11 | 12 | \item{data}{Something to print} 13 | 14 | \item{name}{The name of the thing to print} 15 | 16 | \item{prefix}{What to put before the thing printed. Typically a space.} 17 | 18 | \item{max_width}{Maximum width in number of characters to print} 19 | 20 | \item{max_rows}{Maximum number of rows to print} 21 | } 22 | \description{ 23 | Print a logical for the print method of taxmap objects. 24 | } 25 | \details{ 26 | Which print method is called is determined by its name, so changing the name 27 | of this function will change when it is called. 28 | } 29 | \seealso{ 30 | Other taxmap print methods: 31 | \code{\link{print__character}()}, 32 | \code{\link{print__data.frame}()}, 33 | \code{\link{print__default_}()}, 34 | \code{\link{print__factor}()}, 35 | \code{\link{print__integer}()}, 36 | \code{\link{print__list}()}, 37 | \code{\link{print__matrix}()}, 38 | \code{\link{print__numeric}()}, 39 | \code{\link{print__ordered}()}, 40 | \code{\link{print__tbl_df}()}, 41 | \code{\link{print__vector}()} 42 | } 43 | \concept{taxmap print methods} 44 | \keyword{internal} 45 | -------------------------------------------------------------------------------- /man/print__matrix.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--taxmap--printers.R 3 | \name{print__matrix} 4 | \alias{print__matrix} 5 | \title{Print a matrix} 6 | \usage{ 7 | print__matrix(obj, data, name, prefix, max_width, max_rows) 8 | } 9 | \arguments{ 10 | \item{obj}{The taxmap object containing the thing to print} 11 | 12 | \item{data}{Something to print} 13 | 14 | \item{name}{The name of the thing to print} 15 | 16 | \item{prefix}{What to put before the thing printed. Typically a space.} 17 | 18 | \item{max_width}{Maximum width in number of characters to print} 19 | 20 | \item{max_rows}{Maximum number of rows to print} 21 | } 22 | \description{ 23 | Print a matrix for the print method of taxmap objects. 24 | } 25 | \details{ 26 | Which print method is called is determined by its name, so changing the name 27 | of this function will change when it is called. 28 | } 29 | \seealso{ 30 | Other taxmap print methods: 31 | \code{\link{print__character}()}, 32 | \code{\link{print__data.frame}()}, 33 | \code{\link{print__default_}()}, 34 | \code{\link{print__factor}()}, 35 | \code{\link{print__integer}()}, 36 | \code{\link{print__list}()}, 37 | \code{\link{print__logical}()}, 38 | \code{\link{print__numeric}()}, 39 | \code{\link{print__ordered}()}, 40 | \code{\link{print__tbl_df}()}, 41 | \code{\link{print__vector}()} 42 | } 43 | \concept{taxmap print methods} 44 | \keyword{internal} 45 | -------------------------------------------------------------------------------- /man/print__numeric.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--taxmap--printers.R 3 | \name{print__numeric} 4 | \alias{print__numeric} 5 | \title{Print a numeric} 6 | \usage{ 7 | print__numeric(obj, data, name, prefix, max_width, max_rows) 8 | } 9 | \arguments{ 10 | \item{obj}{The taxmap object containing the thing to print} 11 | 12 | \item{data}{Something to print} 13 | 14 | \item{name}{The name of the thing to print} 15 | 16 | \item{prefix}{What to put before the thing printed. Typically a space.} 17 | 18 | \item{max_width}{Maximum width in number of characters to print} 19 | 20 | \item{max_rows}{Maximum number of rows to print} 21 | } 22 | \description{ 23 | Print a numeric vector for the print method of taxmap objects. 24 | } 25 | \details{ 26 | Which print method is called is determined by its name, so changing the name 27 | of this function will change when it is called. 28 | } 29 | \seealso{ 30 | Other taxmap print methods: 31 | \code{\link{print__character}()}, 32 | \code{\link{print__data.frame}()}, 33 | \code{\link{print__default_}()}, 34 | \code{\link{print__factor}()}, 35 | \code{\link{print__integer}()}, 36 | \code{\link{print__list}()}, 37 | \code{\link{print__logical}()}, 38 | \code{\link{print__matrix}()}, 39 | \code{\link{print__ordered}()}, 40 | \code{\link{print__tbl_df}()}, 41 | \code{\link{print__vector}()} 42 | } 43 | \concept{taxmap print methods} 44 | \keyword{internal} 45 | -------------------------------------------------------------------------------- /man/print__ordered.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--taxmap--printers.R 3 | \name{print__ordered} 4 | \alias{print__ordered} 5 | \title{Print a ordered factor} 6 | \usage{ 7 | print__ordered(obj, data, name, prefix, max_width, max_rows) 8 | } 9 | \arguments{ 10 | \item{obj}{The taxmap object containing the thing to print} 11 | 12 | \item{data}{Something to print} 13 | 14 | \item{name}{The name of the thing to print} 15 | 16 | \item{prefix}{What to put before the thing printed. Typically a space.} 17 | 18 | \item{max_width}{Maximum width in number of characters to print} 19 | 20 | \item{max_rows}{Maximum number of rows to print} 21 | } 22 | \description{ 23 | Print a ordered factor for the print method of taxmap objects. 24 | } 25 | \details{ 26 | Which print method is called is determined by its name, so changing the name 27 | of this function will change when it is called. 28 | } 29 | \seealso{ 30 | Other taxmap print methods: 31 | \code{\link{print__character}()}, 32 | \code{\link{print__data.frame}()}, 33 | \code{\link{print__default_}()}, 34 | \code{\link{print__factor}()}, 35 | \code{\link{print__integer}()}, 36 | \code{\link{print__list}()}, 37 | \code{\link{print__logical}()}, 38 | \code{\link{print__matrix}()}, 39 | \code{\link{print__numeric}()}, 40 | \code{\link{print__tbl_df}()}, 41 | \code{\link{print__vector}()} 42 | } 43 | \concept{taxmap print methods} 44 | \keyword{internal} 45 | -------------------------------------------------------------------------------- /man/print__tbl_df.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--taxmap--printers.R 3 | \name{print__tbl_df} 4 | \alias{print__tbl_df} 5 | \title{Print a tibble} 6 | \usage{ 7 | print__tbl_df(obj, data, name, prefix, max_width, max_rows) 8 | } 9 | \arguments{ 10 | \item{obj}{The taxmap object containing the thing to print} 11 | 12 | \item{data}{Something to print} 13 | 14 | \item{name}{The name of the thing to print} 15 | 16 | \item{prefix}{What to put before the thing printed. Typically a space.} 17 | 18 | \item{max_width}{Maximum width in number of characters to print} 19 | 20 | \item{max_rows}{Maximum number of rows to print} 21 | } 22 | \description{ 23 | Print a table for the print method of taxmap objects. 24 | } 25 | \details{ 26 | Which print method is called is determined by its name, so changing the name 27 | of this function will change when it is called. 28 | } 29 | \seealso{ 30 | Other taxmap print methods: 31 | \code{\link{print__character}()}, 32 | \code{\link{print__data.frame}()}, 33 | \code{\link{print__default_}()}, 34 | \code{\link{print__factor}()}, 35 | \code{\link{print__integer}()}, 36 | \code{\link{print__list}()}, 37 | \code{\link{print__logical}()}, 38 | \code{\link{print__matrix}()}, 39 | \code{\link{print__numeric}()}, 40 | \code{\link{print__ordered}()}, 41 | \code{\link{print__vector}()} 42 | } 43 | \concept{taxmap print methods} 44 | \keyword{internal} 45 | -------------------------------------------------------------------------------- /man/print__vector.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--taxmap--printers.R 3 | \name{print__vector} 4 | \alias{print__vector} 5 | \title{Generic vector printer} 6 | \usage{ 7 | print__vector( 8 | obj, 9 | data, 10 | name, 11 | prefix, 12 | max_width, 13 | max_rows, 14 | type = class(data)[1] 15 | ) 16 | } 17 | \arguments{ 18 | \item{obj}{The taxmap object containing the thing to print} 19 | 20 | \item{data}{Something to print} 21 | 22 | \item{name}{The name of the thing to print} 23 | 24 | \item{prefix}{What to put before the thing printed. Typically a space.} 25 | 26 | \item{max_width}{Maximum width in number of characters to print} 27 | 28 | \item{max_rows}{Maximum number of rows to print} 29 | 30 | \item{type}{The name of the type of vector to print (e.g. numeric).} 31 | } 32 | \description{ 33 | Print a vector for the print method of taxmap objects. 34 | } 35 | \details{ 36 | Which print method is called is determined by its name, so changing the name 37 | of this function will change when it is called. 38 | } 39 | \seealso{ 40 | Other taxmap print methods: 41 | \code{\link{print__character}()}, 42 | \code{\link{print__data.frame}()}, 43 | \code{\link{print__default_}()}, 44 | \code{\link{print__factor}()}, 45 | \code{\link{print__integer}()}, 46 | \code{\link{print__list}()}, 47 | \code{\link{print__logical}()}, 48 | \code{\link{print__matrix}()}, 49 | \code{\link{print__numeric}()}, 50 | \code{\link{print__ordered}()}, 51 | \code{\link{print__tbl_df}()} 52 | } 53 | \concept{taxmap print methods} 54 | \keyword{internal} 55 | -------------------------------------------------------------------------------- /man/print_item.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--taxmap--printers.R 3 | \name{print_item} 4 | \alias{print_item} 5 | \title{Print a item} 6 | \usage{ 7 | print_item( 8 | obj, 9 | data, 10 | name = NULL, 11 | max_rows = 3, 12 | max_items = 3, 13 | max_width = getOption("width") - 10, 14 | prefix = "" 15 | ) 16 | } 17 | \arguments{ 18 | \item{obj}{The taxmap object containing the thing to print} 19 | 20 | \item{data}{The item to be printed} 21 | 22 | \item{max_rows}{(`numeric` of length 1) The maximum number of rows in 23 | tables to print.} 24 | 25 | \item{max_items}{(`numeric` of length 1) The maximum number of list 26 | items to print.} 27 | 28 | \item{max_width}{(`numeric` of length 1) The maximum number of 29 | characters to print.} 30 | 31 | \item{prefix}{(`numeric` of length 1) What to print in front of each 32 | line.} 33 | } 34 | \description{ 35 | Used to print each item in the `taxmap` print method. 36 | } 37 | \keyword{internal} 38 | -------------------------------------------------------------------------------- /man/print_tree.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--taxonomy--docs.R 3 | \name{print_tree} 4 | \alias{print_tree} 5 | \title{Print a text tree} 6 | \arguments{ 7 | \item{obj}{A \code{taxonomy} or \code{taxmap} object} 8 | 9 | \item{value}{What data to return. Default is taxon names. Any result of 10 | [all_names()] can be used, but it usually only makes sense to use data with 11 | one value per taxon, like taxon names.} 12 | } 13 | \description{ 14 | Print a text-based tree of a [taxonomy()] or [taxmap()] object. 15 | } 16 | \examples{ 17 | print_tree(ex_taxmap) 18 | 19 | } 20 | -------------------------------------------------------------------------------- /man/progress_lapply.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--taxmap--internal.R 3 | \name{progress_lapply} 4 | \alias{progress_lapply} 5 | \title{lappy with progress bars} 6 | \usage{ 7 | progress_lapply(X, FUN, progress = interactive(), ...) 8 | } 9 | \arguments{ 10 | \item{X}{The thing to iterate over} 11 | 12 | \item{FUN}{The function to apply to each element} 13 | 14 | \item{progress}{(logical of length 1) Whether or not to print a progress bar. Default is to only print a progress bar during interactive use.} 15 | 16 | \item{...}{Passed to function} 17 | } 18 | \value{ 19 | list 20 | } 21 | \description{ 22 | Immitates lapply with optional progress bars 23 | } 24 | \keyword{internal} 25 | -------------------------------------------------------------------------------- /man/punc_font.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--taxmap--printers.R 3 | \name{punc_font} 4 | \alias{punc_font} 5 | \title{Punctuation formatting in print methods} 6 | \usage{ 7 | punc_font(text) 8 | } 9 | \arguments{ 10 | \item{text}{What to print} 11 | } 12 | \description{ 13 | A simple wrapper to make changing the formatting of text printed easier. 14 | This is used for non-data, formatting characters 15 | } 16 | \seealso{ 17 | Other printer fonts: 18 | \code{\link{desc_font}()}, 19 | \code{\link{error_font}()}, 20 | \code{\link{name_font}()}, 21 | \code{\link{tid_font}()} 22 | } 23 | \concept{printer fonts} 24 | \keyword{internal} 25 | -------------------------------------------------------------------------------- /man/qualitative_palette.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/heat_tree--mapping.R 3 | \name{qualitative_palette} 4 | \alias{qualitative_palette} 5 | \title{The default qualitative color palette} 6 | \usage{ 7 | qualitative_palette() 8 | } 9 | \value{ 10 | \code{character} of hex color codes 11 | } 12 | \description{ 13 | Returns the default color palette for qualitative data 14 | } 15 | \examples{ 16 | qualitative_palette() 17 | 18 | } 19 | -------------------------------------------------------------------------------- /man/quantative_palette.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/heat_tree--mapping.R 3 | \name{quantative_palette} 4 | \alias{quantative_palette} 5 | \title{The default quantative color palette} 6 | \usage{ 7 | quantative_palette() 8 | } 9 | \value{ 10 | \code{character} of hex color codes 11 | } 12 | \description{ 13 | Returns the default color palette for quantative data. 14 | } 15 | \examples{ 16 | quantative_palette() 17 | 18 | } 19 | -------------------------------------------------------------------------------- /man/ranks_ref.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--dataset_documentation.R 3 | \docType{data} 4 | \name{ranks_ref} 5 | \alias{ranks_ref} 6 | \title{Lookup-table for IDs of taxonomic ranks} 7 | \description{ 8 | Composed of two columns: 9 | \itemize{ 10 | \item rankid - the ordered identifier value. lower values mean higher rank 11 | \item ranks - all the rank names that belong to the same level, with 12 | different variants that mean essentially the same thing 13 | } 14 | } 15 | \keyword{data} 16 | -------------------------------------------------------------------------------- /man/read_fasta.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/read_fasta.R 3 | \name{read_fasta} 4 | \alias{read_fasta} 5 | \title{Read a FASTA file} 6 | \usage{ 7 | read_fasta(file_path) 8 | } 9 | \arguments{ 10 | \item{file_path}{(\code{character} of length 1) The path to a file to read.} 11 | } 12 | \value{ 13 | named \code{character} vector 14 | } 15 | \description{ 16 | Reads a FASTA file. This is the FASTA parser for metacoder. It simply tries 17 | to read a FASTA file into a named character vector with minimal fuss. It does 18 | not do any checks for valid characters etc. Other FASTA parsers you might 19 | want to consider include \code{\link[ape]{read.FASTA}} or 20 | \code{\link[seqinr]{read.fasta}}. 21 | } 22 | \examples{ 23 | 24 | # Get example FASTA file 25 | fasta_path <- system.file(file.path("extdata", "silva_subset.fa"), 26 | package = "metacoder") 27 | 28 | # Read fasta file 29 | my_seqs <- read_fasta(fasta_path) 30 | 31 | } 32 | -------------------------------------------------------------------------------- /man/read_lines_apply.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/read_fasta.R 3 | \name{read_lines_apply} 4 | \alias{read_lines_apply} 5 | \title{Apply a function to chunks of a file} 6 | \usage{ 7 | read_lines_apply( 8 | file_path, 9 | func, 10 | buffer_size = 1000, 11 | simplify = FALSE, 12 | skip = 0 13 | ) 14 | } 15 | \arguments{ 16 | \item{file_path}{(\code{character} of length 1) The path to a file to read.} 17 | 18 | \item{func}{(\code{function}) The function to run on each chunk of the file.} 19 | 20 | \item{buffer_size}{(\code{numeric} of length 1) The number of lines in each chunk} 21 | 22 | \item{simplify}{(\code{logical} of length 1) If \code{TRUE}, then the result is simplified to a vector.} 23 | 24 | \item{skip}{(\code{numeric} of length 1) Where to start reading the file.} 25 | } 26 | \value{ 27 | \code{list} of results of \code{func} 28 | } 29 | \description{ 30 | Reads a file in chunks, applies a function to each of them, and returns to results of the function calls. 31 | } 32 | \keyword{internal} 33 | -------------------------------------------------------------------------------- /man/remove_redundant_names.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--taxonomy--docs.R 3 | \name{remove_redundant_names} 4 | \alias{remove_redundant_names} 5 | \title{Remove redundant parts of taxon names} 6 | \arguments{ 7 | \item{obj}{A \code{taxonomy} or \code{taxmap} object} 8 | } 9 | \value{ 10 | A \code{taxonomy} or \code{taxmap} object 11 | } 12 | \description{ 13 | Remove the names of parent taxa in the beginning of their children's names in a \code{taxonomy} or \code{taxmap} object. 14 | This is useful for removing genus names in species binomials. 15 | \preformatted{ 16 | obj$remove_redundant_names() 17 | remove_redundant_names(obj)} 18 | } 19 | \examples{ 20 | # Remove genus named from species taxa 21 | species_data <- c("Carnivora;Felidae;Panthera;Panthera leo", 22 | "Carnivora;Felidae;Panthera;Panthera tigris", 23 | "Carnivora;Ursidae;Ursus;Ursus americanus") 24 | obj <- parse_tax_data(species_data, class_sep = ";") 25 | remove_redundant_names(obj) 26 | } 27 | -------------------------------------------------------------------------------- /man/replace_taxon_ids.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--taxonomy--docs.R 3 | \name{replace_taxon_ids} 4 | \alias{replace_taxon_ids} 5 | \title{Replace taxon ids} 6 | \arguments{ 7 | \item{obj}{The [taxonomy()] or [taxmap()] object.} 8 | 9 | \item{new_ids}{A vector of new ids, one per taxon. They must be unique and in 10 | the same order as the corresponding ids in `obj$taxon_ids()`.} 11 | } 12 | \value{ 13 | A [taxonomy()] or [taxmap()] object with new taxon ids 14 | } 15 | \description{ 16 | Replace taxon ids in a [taxmap()] or [taxonomy()] object. 17 | \preformatted{ 18 | obj$replace_taxon_ids(new_ids) 19 | replace_taxon_ids(obj, new_ids)} 20 | } 21 | \examples{ 22 | # Replace taxon IDs with numbers 23 | replace_taxon_ids(ex_taxmap, seq_len(length(ex_taxmap$taxa))) 24 | 25 | # Make taxon IDs capital letters 26 | replace_taxon_ids(ex_taxmap, toupper(taxon_ids(ex_taxmap))) 27 | 28 | } 29 | -------------------------------------------------------------------------------- /man/repo_url.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/internal.R 3 | \name{repo_url} 4 | \alias{repo_url} 5 | \title{Return github url} 6 | \usage{ 7 | repo_url() 8 | } 9 | \description{ 10 | Return github url 11 | } 12 | \keyword{internal} 13 | -------------------------------------------------------------------------------- /man/rescale.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/heat_tree--mapping.R 3 | \name{rescale} 4 | \alias{rescale} 5 | \title{Rescale numeric vector to have specified minimum and maximum.} 6 | \usage{ 7 | rescale( 8 | x, 9 | to = c(0, 1), 10 | from = range(x, na.rm = TRUE, finite = TRUE), 11 | hard_bounds = TRUE 12 | ) 13 | } 14 | \arguments{ 15 | \item{x}{values to rescale} 16 | 17 | \item{to}{range to scale to} 18 | 19 | \item{from}{range of values the x could have been} 20 | 21 | \item{hard_bounds}{If \code{TRUE}, all values will be forced into the range of \code{to}.} 22 | } 23 | \description{ 24 | Rescale numeric vector to have specified minimum and maximum, but allow for hard boundaries. 25 | It is a slightly modified version of scales::rescale, incorporating scales::zero_range, both by Hadley Wickham used under the conditions of the MIT license. 26 | } 27 | \keyword{internal} 28 | -------------------------------------------------------------------------------- /man/rev_comp.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/tools.R 3 | \name{rev_comp} 4 | \alias{rev_comp} 5 | \title{Revere complement sequences} 6 | \usage{ 7 | rev_comp(seqs) 8 | } 9 | \arguments{ 10 | \item{seqs}{A character vector with one element per sequence.} 11 | } 12 | \description{ 13 | Make the reverse complement of one or more sequences stored as a character 14 | vector. This is a wrapper for \code{\link[seqinr]{comp}} for character 15 | vectors instead of lists of character vectors with one value per letter. 16 | IUPAC ambiguity codes are handled and the upper/lower case is preserved. 17 | } 18 | \examples{ 19 | 20 | rev_comp(c("aagtgGGTGaa", "AAGTGGT")) 21 | 22 | } 23 | \seealso{ 24 | Other sequence transformations: 25 | \code{\link{complement}()}, 26 | \code{\link{reverse}()} 27 | } 28 | \concept{sequence transformations} 29 | -------------------------------------------------------------------------------- /man/reverse.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/tools.R 3 | \name{reverse} 4 | \alias{reverse} 5 | \title{Reverse sequences} 6 | \usage{ 7 | reverse(seqs) 8 | } 9 | \arguments{ 10 | \item{seqs}{A character vector with one element per sequence.} 11 | } 12 | \description{ 13 | Find the reverse of one or more sequences stored as a character 14 | vector. This is a wrapper for \code{\link{rev}} for character 15 | vectors instead of lists of character vectors with one value per letter. 16 | } 17 | \examples{ 18 | 19 | reverse(c("aagtgGGTGaa", "AAGTGGT")) 20 | 21 | } 22 | \seealso{ 23 | Other sequence transformations: 24 | \code{\link{complement}()}, 25 | \code{\link{rev_comp}()} 26 | } 27 | \concept{sequence transformations} 28 | -------------------------------------------------------------------------------- /man/roots.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--taxonomy--docs.R 3 | \name{roots} 4 | \alias{roots} 5 | \title{Get root taxa} 6 | \arguments{ 7 | \item{obj}{The [taxonomy()] or [taxmap()] object containing taxon 8 | information to be queried.} 9 | 10 | \item{subset}{Taxon IDs, TRUE/FALSE vector, or taxon indexes to find roots for. 11 | Default: All taxa in `obj` will be used. Any variable name that appears in 12 | [all_names()] can be used as if it was a vector on its own.} 13 | 14 | \item{value}{What data to return. This is usually the name of column in a 15 | table in `obj$data`. Any result of `all_names(obj)` can be used, but it 16 | usually only makes sense to data that corresponds to taxa 1:1, such as 17 | [taxon_ranks()]. By default, taxon indexes are returned.} 18 | } 19 | \value{ 20 | `character` 21 | } 22 | \description{ 23 | Return the root taxa for a [taxonomy()] or [taxmap()] object. Can also be used to 24 | get the roots of a subset of taxa. 25 | \preformatted{ 26 | obj$roots(subset = NULL, value = "taxon_indexes") 27 | roots(obj, subset = NULL, value = "taxon_indexes")} 28 | } 29 | \examples{ 30 | # Return indexes of root taxa 31 | roots(ex_taxmap) 32 | 33 | # Return indexes for a subset of taxa 34 | roots(ex_taxmap, subset = 2:17) 35 | 36 | # Return something besides taxon indexes 37 | roots(ex_taxmap, value = "taxon_names") 38 | 39 | } 40 | \seealso{ 41 | Other taxonomy indexing functions: 42 | \code{\link{branches}()}, 43 | \code{\link{internodes}()}, 44 | \code{\link{leaves}()}, 45 | \code{\link{stems}()}, 46 | \code{\link{subtaxa}()}, 47 | \code{\link{supertaxa}()} 48 | } 49 | \concept{taxonomy indexing functions} 50 | -------------------------------------------------------------------------------- /man/run_primersearch.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/primersearch.R 3 | \name{run_primersearch} 4 | \alias{run_primersearch} 5 | \title{Execute EMBOSS Primersearch} 6 | \usage{ 7 | run_primersearch( 8 | seq_path, 9 | primer_path, 10 | mismatch = 5, 11 | output_path = tempfile(), 12 | program_path = "primersearch", 13 | ... 14 | ) 15 | } 16 | \arguments{ 17 | \item{seq_path}{A character vector of length 1. The path to the fasta file containing reference 18 | sequences to search for primer matches in.} 19 | 20 | \item{primer_path}{A character vector of length 1. The path to the file containing primer pairs 21 | to match. The file should be whitespace-delimited with 3 columns: primer name, first primer 22 | sequence, and second primer sequence.} 23 | 24 | \item{mismatch}{An integer vector of length 1. The percentage of mismatches allowed.} 25 | 26 | \item{output_path}{A character vector of length 1. Where the output of primersearch is saved.} 27 | 28 | \item{program_path}{A character vector of length 1. The location of the primersearch binary. 29 | Ideally, it should be in your system's search path.} 30 | 31 | \item{...}{Additional arguments are passed to \code{primersearch}.} 32 | } 33 | \value{ 34 | The command generated as a character vector of length 1. 35 | } 36 | \description{ 37 | Execute EMBOSS Primersearch 38 | } 39 | \seealso{ 40 | \code{\link{parse_primersearch}} 41 | } 42 | \keyword{internal} 43 | -------------------------------------------------------------------------------- /man/scale_bar_coords.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/heat_tree--legend.R 3 | \name{scale_bar_coords} 4 | \alias{scale_bar_coords} 5 | \title{Make scale bar division} 6 | \usage{ 7 | scale_bar_coords(x1, x2, y1, y2, color, group) 8 | } 9 | \arguments{ 10 | \item{x1}{(\code{numeric} of length 1) x of top right} 11 | 12 | \item{x2}{(\code{numeric} of length 1) x of bottom right} 13 | 14 | \item{y1}{(\code{numeric} of length 1) y of top right} 15 | 16 | \item{y2}{(\code{numeric} of length 1) y of bottom right} 17 | 18 | \item{color}{} 19 | 20 | \item{group}{} 21 | } 22 | \value{ 23 | \code{data.frame} 24 | } 25 | \description{ 26 | Make scale bar division 27 | } 28 | \keyword{internal} 29 | -------------------------------------------------------------------------------- /man/select_labels.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/heat_tree--internal.R 3 | \name{select_labels} 4 | \alias{select_labels} 5 | \title{Pick labels to show} 6 | \usage{ 7 | select_labels(my_data, label_max, sort_by_column, label_column) 8 | } 9 | \arguments{ 10 | \item{my_data}{\code{data.frame}} 11 | 12 | \item{label_max}{\code{numeric} of length 1} 13 | 14 | \item{sort_by_column}{\code{character} of length 1; the name of a column in \code{my_data}} 15 | 16 | \item{label_column}{\code{character} of length 1; the name of a column in \code{my_data} 17 | containing labels} 18 | } 19 | \value{ 20 | \code{character} IDs of rows with labels to show 21 | } 22 | \description{ 23 | Pick labels to show based off a column name to sort by and a maximum number 24 | } 25 | \keyword{internal} 26 | -------------------------------------------------------------------------------- /man/simplify.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--taxonomy--internal.R 3 | \name{simplify} 4 | \alias{simplify} 5 | \title{List to vector of unique elements} 6 | \usage{ 7 | simplify(input) 8 | } 9 | \arguments{ 10 | \item{input}{A list of vectors} 11 | } 12 | \description{ 13 | Implements the `simplify` option in many functions like [supertaxa()]. 14 | Returns unique name-value pairs if all vectors are named. 15 | } 16 | \keyword{internal} 17 | -------------------------------------------------------------------------------- /man/split_by_level.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/heat_tree--internal.R 3 | \name{split_by_level} 4 | \alias{split_by_level} 5 | \title{Splits a taxonomy at a specific level or rank} 6 | \usage{ 7 | split_by_level(taxa, parents, level, rank = NULL) 8 | } 9 | \arguments{ 10 | \item{taxa}{(\code{character}) Unique taxon IDs for every possible taxon.} 11 | 12 | \item{parents}{(\code{character}) Unique taxon IDs for the supertaxa of every possible taxon.} 13 | 14 | \item{level}{(\code{character} or \code{numeric} of length 1)} 15 | 16 | \item{rank}{(\code{character}) The rank designation (e.g. "genus") corresponding to each observation in} 17 | } 18 | \value{ 19 | a \code{list} of taxon id \code{character} vectors. 20 | \code{taxa}. 21 | } 22 | \description{ 23 | Breaks one taxonomy into multiple, each with a root of a specified distance from the root. 24 | } 25 | \keyword{internal} 26 | -------------------------------------------------------------------------------- /man/starts_with.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/imports.R, R/old_taxa--imports.R 3 | \name{starts_with} 4 | \alias{starts_with} 5 | \title{dplyr select_helpers} 6 | \description{ 7 | dplyr select_helpers 8 | 9 | dplyr select_helpers 10 | } 11 | \keyword{internal} 12 | -------------------------------------------------------------------------------- /man/startup_msg.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/startup.R 3 | \name{startup_msg} 4 | \alias{startup_msg} 5 | \title{Return startup message} 6 | \usage{ 7 | startup_msg() 8 | } 9 | \description{ 10 | Return startup message 11 | } 12 | \keyword{internal} 13 | -------------------------------------------------------------------------------- /man/taxa.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--taxa.R 3 | \name{taxa} 4 | \alias{taxa} 5 | \title{A class for multiple taxon objects} 6 | \usage{ 7 | taxa(..., .list = NULL) 8 | } 9 | \arguments{ 10 | \item{...}{Any number of object of class [taxon()]} 11 | 12 | \item{.list}{An alternate to the `...` input. Any number of object of class 13 | [taxon()]. Cannot be used with `...`.} 14 | } 15 | \value{ 16 | An `R6Class` object of class `Taxon` 17 | } 18 | \description{ 19 | Stores one or more [taxon()] objects. This is just a thin wrapper for a list 20 | of [taxon()] objects. 21 | } 22 | \details{ 23 | This is the documentation for the class called `taxa`. If you are looking for 24 | the documentation for the package as a whole: [taxa-package]. 25 | } 26 | \examples{ 27 | (a <- taxon( 28 | name = taxon_name("Poa annua"), 29 | rank = taxon_rank("species"), 30 | id = taxon_id(93036) 31 | )) 32 | taxa(a, a, a) 33 | 34 | # a null set 35 | x <- taxon(NULL) 36 | taxa(x, x, x) 37 | 38 | # combo non-null and null 39 | taxa(a, x, a) 40 | } 41 | \seealso{ 42 | Other classes: 43 | \code{\link{hierarchies}()}, 44 | \code{\link{hierarchy}()}, 45 | \code{\link{taxmap}()}, 46 | \code{\link{taxon}()}, 47 | \code{\link{taxon_database}()}, 48 | \code{\link{taxon_id}()}, 49 | \code{\link{taxon_name}()}, 50 | \code{\link{taxon_rank}()}, 51 | \code{\link{taxonomy}()} 52 | } 53 | \concept{classes} 54 | -------------------------------------------------------------------------------- /man/taxon_database.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--taxon_database.R 3 | \name{taxon_database} 4 | \alias{taxon_database} 5 | \title{Taxonomy database class} 6 | \usage{ 7 | taxon_database(name = NULL, url = NULL, description = NULL, id_regex = NULL) 8 | } 9 | \arguments{ 10 | \item{name}{(character) name of the database} 11 | 12 | \item{url}{(character) url for the database} 13 | 14 | \item{description}{(character) description of the database} 15 | 16 | \item{id_regex}{(character) id regex} 17 | } 18 | \value{ 19 | An `R6Class` object of class `TaxonDatabase` 20 | } 21 | \description{ 22 | Used to store information about taxonomy databases. This is typically used to 23 | store where taxon information came from in [taxon()] objects. 24 | } 25 | \examples{ 26 | # create a database entry 27 | (x <- taxon_database( 28 | "ncbi", 29 | "http://www.ncbi.nlm.nih.gov/taxonomy", 30 | "NCBI Taxonomy Database", 31 | "*" 32 | )) 33 | x$name 34 | x$url 35 | 36 | # use pre-created database objects 37 | database_list 38 | database_list$ncbi 39 | } 40 | \seealso{ 41 | [database_list] 42 | 43 | Other classes: 44 | \code{\link{hierarchies}()}, 45 | \code{\link{hierarchy}()}, 46 | \code{\link{taxa}()}, 47 | \code{\link{taxmap}()}, 48 | \code{\link{taxon}()}, 49 | \code{\link{taxon_id}()}, 50 | \code{\link{taxon_name}()}, 51 | \code{\link{taxon_rank}()}, 52 | \code{\link{taxonomy}()} 53 | } 54 | \concept{classes} 55 | -------------------------------------------------------------------------------- /man/taxon_id.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--taxon_id.R 3 | \name{taxon_id} 4 | \alias{taxon_id} 5 | \title{Taxon ID class} 6 | \usage{ 7 | taxon_id(id, database = NULL) 8 | } 9 | \arguments{ 10 | \item{id}{(character/integer/numeric) a taxonomic id, required} 11 | 12 | \item{database}{(database) database class object, optional} 13 | } 14 | \value{ 15 | An `R6Class` object of class `TaxonId` 16 | } 17 | \description{ 18 | Used to store taxon IDs, either arbitrary or from a taxonomy database. This 19 | is typically used to store taxon IDs in [taxon()] objects. 20 | } 21 | \examples{ 22 | (x <- taxon_id(12345)) 23 | x$id 24 | x$database 25 | 26 | (x <- taxon_id( 27 | 12345, 28 | database_list$ncbi 29 | )) 30 | x$id 31 | x$database 32 | 33 | # a null taxon_name object 34 | taxon_name(NULL) 35 | } 36 | \seealso{ 37 | Other classes: 38 | \code{\link{hierarchies}()}, 39 | \code{\link{hierarchy}()}, 40 | \code{\link{taxa}()}, 41 | \code{\link{taxmap}()}, 42 | \code{\link{taxon}()}, 43 | \code{\link{taxon_database}()}, 44 | \code{\link{taxon_name}()}, 45 | \code{\link{taxon_rank}()}, 46 | \code{\link{taxonomy}()} 47 | } 48 | \concept{classes} 49 | -------------------------------------------------------------------------------- /man/taxon_ids.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--taxonomy--docs.R 3 | \name{taxon_ids} 4 | \alias{taxon_ids} 5 | \title{Get taxon IDs} 6 | \arguments{ 7 | \item{obj}{The [taxonomy()] or [taxmap()] object.} 8 | } 9 | \description{ 10 | Return the taxon IDs in a [taxonomy()] or [taxmap()] object. 11 | They are in the order they appear in the edge list. 12 | \preformatted{ 13 | obj$taxon_ids() 14 | taxon_ids(obj)} 15 | } 16 | \examples{ 17 | # Return the taxon IDs for each taxon 18 | taxon_ids(ex_taxmap) 19 | 20 | # Filter using taxon IDs 21 | filter_taxa(ex_taxmap, ! taxon_ids \%in\% c("c", "d")) 22 | 23 | } 24 | \seealso{ 25 | Other taxonomy data functions: 26 | \code{\link{classifications}()}, 27 | \code{\link{id_classifications}()}, 28 | \code{\link{is_branch}()}, 29 | \code{\link{is_internode}()}, 30 | \code{\link{is_leaf}()}, 31 | \code{\link{is_root}()}, 32 | \code{\link{is_stem}()}, 33 | \code{\link{map_data}()}, 34 | \code{\link{map_data_}()}, 35 | \code{\link{n_leaves}()}, 36 | \code{\link{n_leaves_1}()}, 37 | \code{\link{n_subtaxa}()}, 38 | \code{\link{n_subtaxa_1}()}, 39 | \code{\link{n_supertaxa}()}, 40 | \code{\link{n_supertaxa_1}()}, 41 | \code{\link{taxon_indexes}()}, 42 | \code{\link{taxon_names}()}, 43 | \code{\link{taxon_ranks}()} 44 | } 45 | \concept{taxonomy data functions} 46 | -------------------------------------------------------------------------------- /man/taxon_indexes.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--taxonomy--docs.R 3 | \name{taxon_indexes} 4 | \alias{taxon_indexes} 5 | \title{Get taxon indexes} 6 | \arguments{ 7 | \item{obj}{The [taxonomy()] or [taxmap()] object.} 8 | } 9 | \description{ 10 | Return the taxon indexes in a [taxonomy()] or [taxmap()] object. 11 | They are the indexes of the edge list rows. 12 | \preformatted{ 13 | obj$taxon_indexes() 14 | taxon_indexes(obj)} 15 | } 16 | \examples{ 17 | # Return the indexes for each taxon 18 | taxon_indexes(ex_taxmap) 19 | 20 | # Use in another function (stupid example; 1:5 would work too) 21 | filter_taxa(ex_taxmap, taxon_indexes < 5) 22 | 23 | } 24 | \seealso{ 25 | Other taxonomy data functions: 26 | \code{\link{classifications}()}, 27 | \code{\link{id_classifications}()}, 28 | \code{\link{is_branch}()}, 29 | \code{\link{is_internode}()}, 30 | \code{\link{is_leaf}()}, 31 | \code{\link{is_root}()}, 32 | \code{\link{is_stem}()}, 33 | \code{\link{map_data}()}, 34 | \code{\link{map_data_}()}, 35 | \code{\link{n_leaves}()}, 36 | \code{\link{n_leaves_1}()}, 37 | \code{\link{n_subtaxa}()}, 38 | \code{\link{n_subtaxa_1}()}, 39 | \code{\link{n_supertaxa}()}, 40 | \code{\link{n_supertaxa_1}()}, 41 | \code{\link{taxon_ids}()}, 42 | \code{\link{taxon_names}()}, 43 | \code{\link{taxon_ranks}()} 44 | } 45 | \concept{taxonomy data functions} 46 | -------------------------------------------------------------------------------- /man/taxon_name.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--taxon_name.R 3 | \name{taxon_name} 4 | \alias{taxon_name} 5 | \title{Taxon name class} 6 | \usage{ 7 | taxon_name(name, database = NULL) 8 | } 9 | \arguments{ 10 | \item{name}{(character) a taxonomic name. required} 11 | 12 | \item{database}{(character) database class object, optional} 13 | } 14 | \value{ 15 | An `R6Class` object of class `TaxonName` 16 | } 17 | \description{ 18 | Used to store the name of taxa. This is typically used to 19 | store where taxon names in [taxon()] objects. 20 | } 21 | \examples{ 22 | (poa <- taxon_name("Poa")) 23 | (undef <- taxon_name("undefined")) 24 | (sp1 <- taxon_name("species 1")) 25 | (poa_annua <- taxon_name("Poa annua")) 26 | (x <- taxon_name("Poa annua L.")) 27 | 28 | x$name 29 | x$database 30 | 31 | (x <- taxon_name( 32 | "Poa annua", 33 | database_list$ncbi 34 | )) 35 | x$rank 36 | x$database 37 | 38 | # a null taxon_name object 39 | taxon_name(NULL) 40 | } 41 | \seealso{ 42 | Other classes: 43 | \code{\link{hierarchies}()}, 44 | \code{\link{hierarchy}()}, 45 | \code{\link{taxa}()}, 46 | \code{\link{taxmap}()}, 47 | \code{\link{taxon}()}, 48 | \code{\link{taxon_database}()}, 49 | \code{\link{taxon_id}()}, 50 | \code{\link{taxon_rank}()}, 51 | \code{\link{taxonomy}()} 52 | } 53 | \concept{classes} 54 | -------------------------------------------------------------------------------- /man/taxon_names.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--taxonomy--docs.R 3 | \name{taxon_names} 4 | \alias{taxon_names} 5 | \title{Get taxon names} 6 | \arguments{ 7 | \item{obj}{The [taxonomy()] or [taxmap()] object.} 8 | } 9 | \description{ 10 | Return the taxon names in a [taxonomy()] or [taxmap()] object. 11 | They are in the order they appear in the edge list. 12 | \preformatted{ 13 | obj$taxon_names() 14 | taxon_names(obj)} 15 | } 16 | \examples{ 17 | # Return the names for each taxon 18 | taxon_names(ex_taxmap) 19 | 20 | # Filter by taxon name 21 | filter_taxa(ex_taxmap, taxon_names == "Felidae", subtaxa = TRUE) 22 | 23 | } 24 | \seealso{ 25 | Other taxonomy data functions: 26 | \code{\link{classifications}()}, 27 | \code{\link{id_classifications}()}, 28 | \code{\link{is_branch}()}, 29 | \code{\link{is_internode}()}, 30 | \code{\link{is_leaf}()}, 31 | \code{\link{is_root}()}, 32 | \code{\link{is_stem}()}, 33 | \code{\link{map_data}()}, 34 | \code{\link{map_data_}()}, 35 | \code{\link{n_leaves}()}, 36 | \code{\link{n_leaves_1}()}, 37 | \code{\link{n_subtaxa}()}, 38 | \code{\link{n_subtaxa_1}()}, 39 | \code{\link{n_supertaxa}()}, 40 | \code{\link{n_supertaxa_1}()}, 41 | \code{\link{taxon_ids}()}, 42 | \code{\link{taxon_indexes}()}, 43 | \code{\link{taxon_ranks}()} 44 | } 45 | \concept{taxonomy data functions} 46 | -------------------------------------------------------------------------------- /man/taxon_rank.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--taxon_rank.R 3 | \name{taxon_rank} 4 | \alias{taxon_rank} 5 | \title{Taxon rank class} 6 | \usage{ 7 | taxon_rank(name, database = NULL) 8 | } 9 | \arguments{ 10 | \item{name}{(character) rank name. required} 11 | 12 | \item{database}{(character) database class object, optional} 13 | } 14 | \value{ 15 | An `R6Class` object of class `TaxonRank` 16 | } 17 | \description{ 18 | Stores the rank of a taxon. This is typically used to store where taxon 19 | information came from in [taxon()] objects. 20 | } 21 | \examples{ 22 | taxon_rank("species") 23 | taxon_rank("genus") 24 | taxon_rank("kingdom") 25 | 26 | (x <- taxon_rank( 27 | "species", 28 | database_list$ncbi 29 | )) 30 | x$rank 31 | x$database 32 | 33 | # a null taxon_name object 34 | taxon_name(NULL) 35 | } 36 | \seealso{ 37 | Other classes: 38 | \code{\link{hierarchies}()}, 39 | \code{\link{hierarchy}()}, 40 | \code{\link{taxa}()}, 41 | \code{\link{taxmap}()}, 42 | \code{\link{taxon}()}, 43 | \code{\link{taxon_database}()}, 44 | \code{\link{taxon_id}()}, 45 | \code{\link{taxon_name}()}, 46 | \code{\link{taxonomy}()} 47 | } 48 | \concept{classes} 49 | -------------------------------------------------------------------------------- /man/taxon_ranks.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--taxonomy--docs.R 3 | \name{taxon_ranks} 4 | \alias{taxon_ranks} 5 | \title{Get taxon ranks} 6 | \arguments{ 7 | \item{obj}{The [taxonomy()] or [taxmap()] object.} 8 | } 9 | \description{ 10 | Return the taxon ranks in a [taxonomy()] or [taxmap()] object. 11 | They are in the order taxa appear in the edge list. 12 | \preformatted{ 13 | obj$taxon_ranks() 14 | taxon_ranks(obj)} 15 | } 16 | \examples{ 17 | # Get ranks for each taxon 18 | taxon_ranks(ex_taxmap) 19 | 20 | # Filter by rank 21 | filter_taxa(ex_taxmap, taxon_ranks == "family", supertaxa = TRUE) 22 | 23 | } 24 | \seealso{ 25 | Other taxonomy data functions: 26 | \code{\link{classifications}()}, 27 | \code{\link{id_classifications}()}, 28 | \code{\link{is_branch}()}, 29 | \code{\link{is_internode}()}, 30 | \code{\link{is_leaf}()}, 31 | \code{\link{is_root}()}, 32 | \code{\link{is_stem}()}, 33 | \code{\link{map_data}()}, 34 | \code{\link{map_data_}()}, 35 | \code{\link{n_leaves}()}, 36 | \code{\link{n_leaves_1}()}, 37 | \code{\link{n_subtaxa}()}, 38 | \code{\link{n_subtaxa_1}()}, 39 | \code{\link{n_supertaxa}()}, 40 | \code{\link{n_supertaxa_1}()}, 41 | \code{\link{taxon_ids}()}, 42 | \code{\link{taxon_indexes}()}, 43 | \code{\link{taxon_names}()} 44 | } 45 | \concept{taxonomy data functions} 46 | -------------------------------------------------------------------------------- /man/text_grob_length.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/heat_tree--resizing_text.R 3 | \name{text_grob_length} 4 | \alias{text_grob_length} 5 | \title{Estimate text grob length} 6 | \usage{ 7 | text_grob_length(text, rot = 0) 8 | } 9 | \arguments{ 10 | \item{text}{\code{character} The text to be printed} 11 | 12 | \item{rot}{The rotation in radians} 13 | } 14 | \value{ 15 | The estimated length of the printed text as a multiple of its text size (height) 16 | } 17 | \description{ 18 | Estimate the printed length of `resizingTextGrob` text 19 | } 20 | \keyword{internal} 21 | -------------------------------------------------------------------------------- /man/tid_font.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--taxmap--printers.R 3 | \name{tid_font} 4 | \alias{tid_font} 5 | \title{Taxon id formatting in print methods} 6 | \usage{ 7 | tid_font(text) 8 | } 9 | \arguments{ 10 | \item{text}{What to print} 11 | } 12 | \description{ 13 | A simple wrapper to make changing the formatting of text printed easier. 14 | } 15 | \seealso{ 16 | Other printer fonts: 17 | \code{\link{desc_font}()}, 18 | \code{\link{error_font}()}, 19 | \code{\link{name_font}()}, 20 | \code{\link{punc_font}()} 21 | } 22 | \concept{printer fonts} 23 | \keyword{internal} 24 | -------------------------------------------------------------------------------- /man/to_percent.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--internal.R 3 | \name{to_percent} 4 | \alias{to_percent} 5 | \title{Format a proportion as a printed percent} 6 | \usage{ 7 | to_percent(prop, digits = 3, ...) 8 | } 9 | \arguments{ 10 | \item{prop}{The proportion} 11 | 12 | \item{digits}{a positive integer indicating how many significant digits 13 | are to be used for 14 | numeric and complex \code{x}. The default, \code{NULL}, uses 15 | \code{\link[base]{getOption}("digits")}. This is a suggestion: enough decimal 16 | places will be used so that the smallest (in magnitude) number has 17 | this many significant digits, and also to satisfy \code{nsmall}. 18 | (For more, notably the interpretation for complex numbers see 19 | \code{\link[base]{signif}}.)} 20 | 21 | \item{...}{passed to `format`} 22 | } 23 | \value{ 24 | character 25 | } 26 | \description{ 27 | Format a proportion as a printed percent 28 | } 29 | \keyword{internal} 30 | -------------------------------------------------------------------------------- /man/transform_data.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/heat_tree--internal.R 3 | \name{transform_data} 4 | \alias{transform_data} 5 | \title{Transformation functions} 6 | \usage{ 7 | transform_data(func = NULL, data = NULL, inverse = FALSE) 8 | } 9 | \arguments{ 10 | \item{func}{(\code{character}) Name of transformation to apply.} 11 | 12 | \item{data}{(\code{numeric}) Data to transform} 13 | 14 | \item{inverse}{(\code{logical} of length 1) If \code{TRUE}, return the inverse of the selected function.} 15 | } 16 | \description{ 17 | Functions used by plotting functions to transform data. 18 | Calling the function with no parameters returns available function names. 19 | Calling with just the function name returns the transformation function 20 | } 21 | \keyword{internal} 22 | -------------------------------------------------------------------------------- /man/transmute_obs.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--taxmap--docs.R 3 | \name{transmute_obs} 4 | \alias{transmute_obs} 5 | \title{Replace columns in [taxmap()] objects} 6 | \arguments{ 7 | \item{obj}{An object of type [taxmap()]} 8 | 9 | \item{data}{Dataset name, index, or a logical vector that indicates which dataset in 10 | `obj$data` to use.} 11 | 12 | \item{...}{One or more named columns to add. Newly created columns can be 13 | referenced in the same function call. Any variable name that appears in 14 | [all_names()] can be used as if it was a vector on its own.} 15 | 16 | \item{target}{DEPRECIATED. use "data" instead.} 17 | } 18 | \value{ 19 | An object of type [taxmap()] 20 | } 21 | \description{ 22 | Replace columns of tables in `obj$data` in [taxmap()] objects. See 23 | [dplyr::transmute()] for the inspiration for this function and more 24 | information. Calling the function using the `obj$transmute_obs(...)` style 25 | edits "obj" in place, unlike most R functions. However, calling the function 26 | using the `transmute_obs(obj, ...)` imitates R's traditional copy-on-modify 27 | semantics, so "obj" would not be changed; instead a changed version would be 28 | returned, like most R functions. 29 | \preformatted{ 30 | obj$transmute_obs(data, ...) 31 | transmute_obs(obj, data, ...)} 32 | } 33 | \examples{ 34 | # Replace columns in a table with new columns 35 | transmute_obs(ex_taxmap, "info", new_col = paste0(name, "!!!")) 36 | 37 | } 38 | \seealso{ 39 | Other taxmap manipulation functions: 40 | \code{\link{arrange_obs}()}, 41 | \code{\link{arrange_taxa}()}, 42 | \code{\link{filter_obs}()}, 43 | \code{\link{filter_taxa}()}, 44 | \code{\link{mutate_obs}()}, 45 | \code{\link{sample_frac_obs}()}, 46 | \code{\link{sample_frac_taxa}()}, 47 | \code{\link{sample_n_obs}()}, 48 | \code{\link{sample_n_taxa}()}, 49 | \code{\link{select_obs}()} 50 | } 51 | \concept{taxmap manipulation functions} 52 | -------------------------------------------------------------------------------- /man/unique_mapping.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/internal.R, R/old_taxa--internal.R 3 | \name{unique_mapping} 4 | \alias{unique_mapping} 5 | \title{get indexes of a unique set of the input} 6 | \usage{ 7 | unique_mapping(input) 8 | 9 | unique_mapping(input) 10 | } 11 | \description{ 12 | get indexes of a unique set of the input 13 | 14 | Get indexes of a unique set of the input 15 | } 16 | \keyword{internal} 17 | -------------------------------------------------------------------------------- /man/validate_regex_key_pair.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--taxmap--parsers.R 3 | \name{validate_regex_key_pair} 4 | \alias{validate_regex_key_pair} 5 | \title{Check a regex-key pair} 6 | \usage{ 7 | validate_regex_key_pair(regex, key, multiple_allowed) 8 | } 9 | \arguments{ 10 | \item{regex}{(\code{character}) 11 | A regex with capture groups} 12 | 13 | \item{key}{(\code{character}) 14 | A key corresponding to \code{regex}} 15 | 16 | \item{multiple_allowed}{(\code{character}) 17 | Values of \code{key_options} that can appear more than once.} 18 | } 19 | \value{ 20 | Returns the result of \code{\link{match.arg}} on the key. 21 | } 22 | \description{ 23 | Checks that the number of capture groups in the regex matches the length of the key. 24 | Checks that only certain values of \code{key} can appear more that once. 25 | Adds names to keys that will be used for column names in the output of \code{extract_taxonomy}. 26 | Uses non-standard evaluation to get the name of input variables. 27 | } 28 | \keyword{internal} 29 | -------------------------------------------------------------------------------- /man/validate_regex_match.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--taxmap--parsers.R 3 | \name{validate_regex_match} 4 | \alias{validate_regex_match} 5 | \title{Check that all match input} 6 | \usage{ 7 | validate_regex_match(input, regex) 8 | } 9 | \arguments{ 10 | \item{input}{(\code{character})} 11 | 12 | \item{regex}{(\code{character} of length 1)} 13 | } 14 | \value{ 15 | \code{character} Parts of \code{input} matching \code{regex} 16 | } 17 | \description{ 18 | Ensure that all of a character vector matches a regex. 19 | Inputs that do not match are excluded. 20 | } 21 | \keyword{internal} 22 | -------------------------------------------------------------------------------- /man/validate_taxmap_funcs.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/old_taxa--taxmap--internal.R 3 | \name{validate_taxmap_funcs} 4 | \alias{validate_taxmap_funcs} 5 | \title{Validate `funcs` input for Taxamp} 6 | \usage{ 7 | validate_taxmap_funcs(funcs) 8 | } 9 | \arguments{ 10 | \item{funcs}{The `funcs` variable passed to the `Taxmap` constructor} 11 | } 12 | \value{ 13 | A `funcs` variable with the right format 14 | } 15 | \description{ 16 | Make sure `funcs` is in the right format and complain if it is not. 17 | NOTE: This currently does nothing. 18 | } 19 | \keyword{internal} 20 | -------------------------------------------------------------------------------- /man/verify_color_range.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/heat_tree--internal.R 3 | \name{verify_color_range} 4 | \alias{verify_color_range} 5 | \title{Verify color range parameters} 6 | \usage{ 7 | verify_color_range(args) 8 | } 9 | \arguments{ 10 | \item{args}{(\code{character}) The names of arguments to verify.} 11 | } 12 | \description{ 13 | Verify color range parameters 14 | } 15 | \keyword{internal} 16 | -------------------------------------------------------------------------------- /man/verify_label_count.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/heat_tree--internal.R 3 | \name{verify_label_count} 4 | \alias{verify_label_count} 5 | \title{Verify label count} 6 | \usage{ 7 | verify_label_count(args) 8 | } 9 | \arguments{ 10 | \item{args}{(\code{character}) The names of arguments to verify.} 11 | } 12 | \description{ 13 | Verify label count 14 | } 15 | \keyword{internal} 16 | -------------------------------------------------------------------------------- /man/verify_size.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/heat_tree--internal.R 3 | \name{verify_size} 4 | \alias{verify_size} 5 | \title{Verify size parameters} 6 | \usage{ 7 | verify_size(args) 8 | } 9 | \arguments{ 10 | \item{args}{(\code{character}) The names of arguments to verify.} 11 | } 12 | \description{ 13 | Verify size parameters 14 | } 15 | \keyword{internal} 16 | -------------------------------------------------------------------------------- /man/verify_size_range.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/heat_tree--internal.R 3 | \name{verify_size_range} 4 | \alias{verify_size_range} 5 | \title{Verify size range parameters} 6 | \usage{ 7 | verify_size_range(args) 8 | } 9 | \arguments{ 10 | \item{args}{(\code{character}) The names of arguments to verify.} 11 | } 12 | \description{ 13 | Verify size range parameters 14 | } 15 | \keyword{internal} 16 | -------------------------------------------------------------------------------- /man/verify_taxmap.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/option_parsers.R 3 | \name{verify_taxmap} 4 | \alias{verify_taxmap} 5 | \title{Check that an object is a taxmap} 6 | \usage{ 7 | verify_taxmap(obj) 8 | } 9 | \arguments{ 10 | \item{obj}{A taxmap object} 11 | } 12 | \description{ 13 | Check that an object is a taxmap 14 | This is intended to be used to parse options in other functions. 15 | } 16 | \seealso{ 17 | Other option parsers: 18 | \code{\link{get_taxmap_cols}()}, 19 | \code{\link{get_taxmap_data}()}, 20 | \code{\link{get_taxmap_other_cols}()}, 21 | \code{\link{get_taxmap_table}()} 22 | } 23 | \concept{option parsers} 24 | \keyword{internal} 25 | -------------------------------------------------------------------------------- /man/verify_trans.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/heat_tree--internal.R 3 | \name{verify_trans} 4 | \alias{verify_trans} 5 | \title{Verify transformation function parameters} 6 | \usage{ 7 | verify_trans(args) 8 | } 9 | \arguments{ 10 | \item{args}{(\code{character}) The names of arguments to verify.} 11 | } 12 | \description{ 13 | Verify transformation function parameters 14 | } 15 | \keyword{internal} 16 | -------------------------------------------------------------------------------- /metacoder.Rproj: -------------------------------------------------------------------------------- 1 | Version: 1.0 2 | 3 | RestoreWorkspace: No 4 | SaveWorkspace: No 5 | AlwaysSaveHistory: Default 6 | 7 | EnableCodeIndexing: Yes 8 | UseSpacesForTab: Yes 9 | NumSpacesForTab: 2 10 | Encoding: UTF-8 11 | 12 | RnwWeave: knitr 13 | LaTeX: pdfLaTeX 14 | 15 | BuildType: Package 16 | PackageUseDevtools: Yes 17 | PackageInstallArgs: --no-multiarch --with-keep.source 18 | PackageCheckArgs: --as-cran 19 | PackageRoxygenize: rd,collate,namespace 20 | -------------------------------------------------------------------------------- /scratch/.gitignore: -------------------------------------------------------------------------------- 1 | SILVA_132_SSURef_Nr99_tax_silva.fasta -------------------------------------------------------------------------------- /scratch/arrange_taxa_gc_weirdness.Rmd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ```{r} 5 | install.packages("metacoder") 6 | library(metacoder) 7 | gctorture2(999) 8 | #> [1] 0 9 | arrange_taxa(unite_ex_data_3, desc(name)) 10 | #> Error in data[, colnames(data) %in% col_subset, drop = FALSE]: incorrect number of dimensions 11 | ``` 12 | 13 | ```{r} 14 | gctorture2(999) 15 | data <- dplyr::tibble(x = 1:10) 16 | dplyr::slice(data, 1:10) 17 | ``` 18 | 19 | ```{r} 20 | devtools::install_github("tidyverse/dplyr") 21 | gctorture2(999) 22 | (x <- dplyr::tibble(y = 1:10)) 23 | dplyr::slice(x, 1:10) 24 | dplyr::slice(x, 1:10) 25 | dplyr::slice(x, 1:10) 26 | dplyr::slice(x, 1:10) 27 | sessionInfo() 28 | ``` 29 | 30 | ## old metacoder, new dplyr 31 | 32 | ```{r} 33 | install.packages("metacoder") 34 | devtools::install_github("tidyverse/dplyr@v0.6.0-rc") 35 | library(metacoder) 36 | arrange_taxa(unite_ex_data_3, desc(name)) 37 | ``` 38 | 39 | 40 | ## new metacoder, old dplyr 41 | 42 | ```{r} 43 | devtools::install_github("grunwaldlab/metacoder") 44 | devtools::install_github("tidyverse/dplyr@v0.5.0") 45 | library(metacoder) 46 | arrange_taxa(unite_ex_data_3, desc(name)) 47 | ``` -------------------------------------------------------------------------------- /scratch/default_plotting.Rmd: -------------------------------------------------------------------------------- 1 | This is a diverse set of plots for optimizing the default appearance of plots. 2 | It is time-consuming to run, so it will not be run on CRAN servers 3 | 4 | ## Highly branched 5 | 6 | ```{r} 7 | library(ape) 8 | library(metacoder) 9 | 10 | plot_one <- function(n) { 11 | set.seed(1) 12 | parse_phylo(ape::rcoal(n)) %>% 13 | heat_tree(node_label = taxon_names, 14 | node_size = n_obs, 15 | node_color = n_obs, 16 | title = paste(n, "tips")) 17 | } 18 | 19 | tip_counts <- c(2, 3, 5, 10, 30, 100, 500) 20 | 21 | for (n in tip_counts) { 22 | print(plot_one(n)) 23 | } 24 | ``` 25 | 26 | -------------------------------------------------------------------------------- /scratch/example.phyloseq: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grunwaldlab/metacoder/e881d1bc67fd323d916ff2bb955b7a8d48bc4664/scratch/example.phyloseq -------------------------------------------------------------------------------- /scratch/issue_123--warning_for_invalid_class_regex.Rmd: -------------------------------------------------------------------------------- 1 | 2 | ## Reproduce error 3 | 4 | ```{r, eval = FALSE} 5 | devtools::install_github("grunwaldlab/metacoder@59c6555") 6 | ``` 7 | 8 | 9 | ```{r} 10 | library(metacoder) 11 | file_path <- system.file("extdata", "unite_general_release.fasta", package = "metacoder") 12 | sequences <- ape::read.FASTA(file_path) 13 | unite_ex_data_3 <- extract_taxonomy(sequences, 14 | regex = "^(.*)\\|(.*)\\|(.*)\\|.*\\|(.*)$", 15 | key = c(seq_name = "obs_info", seq_id = "obs_info", 16 | other_id = "obs_info", "class"), 17 | class_regex = "^(.*)_not_here_(.*)$", 18 | class_key = c(unite_rank = "taxon_info", "name"), 19 | class_sep = ";") 20 | ``` 21 | 22 | 23 | ## Verify fix 24 | 25 | 26 | -------------------------------------------------------------------------------- /scratch/issue_127--heat_tree_inf_usage.Rmd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ```{r} 5 | data <- unite_ex_data_3 6 | data$taxon_data$x <- n_obs(data) 7 | data$taxon_data$x[1] <- Inf 8 | data$taxon_data$x[2] <- -Inf 9 | ``` 10 | 11 | ```{r} 12 | heat_tree(data, node_label = name, node_size = x, node_color = x) 13 | ``` 14 | 15 | -------------------------------------------------------------------------------- /scratch/issue_140.Rmd: -------------------------------------------------------------------------------- 1 | ```{r} 2 | library(metacoder) 3 | heat_tree(unite_ex_data_3, node_size = n_obs, node_label = name, node_color = ifelse(n_supertaxa == 2, "red", "grey")) 4 | heat_tree(unite_ex_data_3, node_size = n_obs, node_label = name, node_color = ifelse(n_supertaxa %in% 2:5, n_obs, "grey")) 5 | ``` 6 | 7 | -------------------------------------------------------------------------------- /scratch/issue_328.R: -------------------------------------------------------------------------------- 1 | library(metacoder) 2 | 3 | x <- parse_tax_data(hmp_otus, class_cols = "lineage", class_sep = ";", 4 | class_key = c(tax_rank = "taxon_rank", tax_name = "taxon_name"), 5 | class_regex = "^(.+)__(.+)$") 6 | 7 | meta <- hmp_samples[hmp_samples$body_site %in% c('Nose', 'Throat'), ] 8 | # meta <- hmp_samples 9 | 10 | # Convert counts to proportions 11 | x$data$otu_table <- calc_obs_props(x, data = "tax_data", cols = meta$sample_id) 12 | 13 | # Get per-taxon counts 14 | x$data$tax_table <- calc_taxon_abund(x, data = "otu_table", cols = meta$sample_id) 15 | 16 | # Calculate difference between treatments 17 | x$data$diff_table <- compare_groups(x, data = "tax_table", 18 | cols = meta$sample_id, 19 | groups = meta$body_site) 20 | 21 | # Plot results (might take a few minutes) 22 | heat_tree_matrix(x, 23 | data = "diff_table", 24 | node_size = n_obs, 25 | node_label = taxon_names, 26 | node_color = log2_median_ratio, 27 | node_color_range = diverging_palette(), 28 | node_color_trans = "linear", 29 | node_color_interval = c(-3, 3), 30 | edge_color_interval = c(-3, 3), 31 | node_size_axis_label = "Number of OTUs", 32 | node_color_axis_label = "Log2 ratio median proportions") 33 | -------------------------------------------------------------------------------- /scratch/test.RData: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grunwaldlab/metacoder/e881d1bc67fd323d916ff2bb955b7a8d48bc4664/scratch/test.RData -------------------------------------------------------------------------------- /scratch/vocabulary.Rmd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ```{r} 5 | obj <- taxmap(taxon_ids = LETTERS[1:18], 6 | supertaxon_ids = c(NA, "A", "A", "A", "B", "B", "C", "C", "D", "F", "F", "K", 7 | "J", "J", "H", "H", "I", "G")) 8 | 9 | plot_one <- function(obj, subset, highlight, title = deparse(match.call()[[3]])) { 10 | 11 | ids <- obj$taxon_data$taxon_ids 12 | vc <- rep("#EEEEEE", length(ids)) 13 | vc[ids == highlight] <- "#999999" 14 | vc[ids %in% subset[[1]]] <- "lightblue" 15 | obj$taxon_data$my_vc <- vc 16 | 17 | heat_tree(obj, node_label = taxon_ids, 18 | node_color = my_vc, 19 | make_legend = FALSE, 20 | edge_color = "#EEEEEE", 21 | node_size = 1 / n_supertaxa, 22 | node_size_range = c(0.06, NA), 23 | title = title, 24 | title_size = 0.05, 25 | node_color_range = c("#555555", "#EEEEEE")) 26 | } 27 | 28 | 29 | gridExtra::grid.arrange(ncol = 4, nrow = 1, 30 | plot_one(obj, supertaxa(obj, "F", recursive = FALSE), 31 | highlight = "F", "Parent"), 32 | plot_one(obj, supertaxa(obj, "F"), 33 | highlight = "F", "Supertaxa"), 34 | plot_one(obj, subtaxa(obj, "F", recursive = FALSE), 35 | highlight = "F", "Children"), 36 | plot_one(obj, subtaxa(obj, "F"), 37 | highlight = "F", "Subtaxa")) 38 | 39 | 40 | ``` 41 | 42 | -------------------------------------------------------------------------------- /tests/testthat.R: -------------------------------------------------------------------------------- 1 | library(testthat) 2 | 3 | suppressPackageStartupMessages(library(metacoder)) 4 | 5 | test_check("metacoder") 6 | -------------------------------------------------------------------------------- /tests/testthat/example_data/dada2.RData: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grunwaldlab/metacoder/e881d1bc67fd323d916ff2bb955b7a8d48bc4664/tests/testthat/example_data/dada2.RData -------------------------------------------------------------------------------- /tests/testthat/example_data/mothur_summary.txt: -------------------------------------------------------------------------------- 1 | taxlevel rankID taxon daughterlevels total A B C 2 | 0 0 Root 2 242 84 84 74 3 | 1 0.1 Bacteria 50 242 84 84 74 4 | 2 0.1.2 Actinobacteria 38 13 0 13 0 5 | 3 0.1.2.3 Actinomycetaceae-Bifidobacteriaceae 10 13 0 13 0 6 | 4 0.1.2.3.7 Bifidobacteriaceae 6 13 0 13 0 7 | 5 0.1.2.3.7.2 Bifidobacterium_choerinum_et_rel. 8 13 0 13 0 8 | 6 0.1.2.3.7.2.1 Bifidobacterium_angulatum_et_rel. 1 11 0 11 0 9 | 7 0.1.2.3.7.2.1.1 unclassified 1 11 0 11 0 10 | 8 0.1.2.3.7.2.1.1.1 unclassified 1 11 0 11 0 11 | 9 0.1.2.3.7.2.1.1.1.1 unclassified 1 11 0 11 0 12 | 10 0.1.2.3.7.2.1.1.1.1.1 unclassified 1 11 0 11 0 13 | 11 0.1.2.3.7.2.1.1.1.1.1.1 unclassified 1 11 0 11 0 14 | 12 0.1.2.3.7.2.1.1.1.1.1.1.1 unclassified 1 11 0 11 0 15 | 6 0.1.2.3.7.2.5 Bifidobacterium_longum_et_rel. 1 2 0 2 0 16 | 7 0.1.2.3.7.2.5.1 unclassified 1 2 0 2 0 17 | 8 0.1.2.3.7.2.5.1.1 unclassified 1 2 0 2 0 18 | 9 0.1.2.3.7.2.5.1.1.1 unclassified 1 2 0 2 0 19 | -------------------------------------------------------------------------------- /tests/testthat/example_data/newick_example_1.txt: -------------------------------------------------------------------------------- 1 | (Bovine:0.69395,(Gibbon:0.36079,(Orang:0.33636,(Gorilla:0.17147,(Chimp:0.19268, Human:0.11927):0.08386):0.06124):0.15057):0.54939,Mouse:1.21460); 2 | (ant:17, (bat:31, cow:22):7, dog:22, (elk:33, fox:12):40); 3 | -------------------------------------------------------------------------------- /tests/testthat/example_data/nexus_example_1.nex: -------------------------------------------------------------------------------- 1 | #NEXUS 2 | BEGIN TAXA; 3 | Dimensions NTax=4; 4 | TaxLabels fish frog snake mouse; 5 | END; 6 | 7 | BEGIN CHARACTERS; 8 | Dimensions NChar=20; 9 | Format DataType=DNA; 10 | Matrix 11 | fish ACATA GAGGG TACCT CTAAG 12 | frog ACATA GAGGG TACCT CTAAG 13 | snake ACATA GAGGG TACCT CTAAG 14 | mouse ACATA GAGGG TACCT CTAAG 15 | END; 16 | 17 | BEGIN TREES; 18 | Tree best=(fish, (frog, (snake, mouse))); 19 | END; 20 | -------------------------------------------------------------------------------- /tests/testthat/example_data/small_abund_mat.tsv: -------------------------------------------------------------------------------- 1 | tax sam_1 sam_2 otu_id 2 | 1 A;B;C 2 3 1 3 | 2 A;B;C 3 5 2 4 | 3 A;B;D 1 2 3 5 | 4 A;E;F 5 1 4 6 | -------------------------------------------------------------------------------- /tests/testthat/test--heat_tree.R: -------------------------------------------------------------------------------- 1 | library(metacoder) 2 | library(testthat) 3 | context("Tree plotting") 4 | 5 | 6 | my_data <- parse_tax_data(hmp_otus[1:5, ], class_cols = "lineage", class_sep = ";", 7 | class_key = c(tax_rank = "info", tax_name = "taxon_name"), 8 | class_regex = "^(.+)__(.+)$") 9 | 10 | 11 | test_that("basic tree plotting works", { 12 | expect_true(!is.null(heat_tree(my_data, 13 | node_size = n_obs, 14 | node_color = n_obs, 15 | node_label = taxon_names, 16 | tree_label = taxon_names, 17 | layout = "fruchterman-reingold"))) 18 | }) 19 | 20 | test_that("A single taxon can be plotted", { 21 | expect_true(!is.null(heat_tree(filter_taxa(my_data, 1), 22 | node_size = n_obs, 23 | node_color = n_obs, 24 | node_label = taxon_names, 25 | tree_label = taxon_names, 26 | layout = "fruchterman-reingold"))) 27 | }) 28 | 29 | test_that("Plotting with infinite inputs works ", { 30 | my_data$data$x <- n_obs(my_data) 31 | my_data$data$x[1] <- Inf 32 | my_data$data$x[2] <- -Inf 33 | 34 | expect_warning(heat_tree(my_data, 35 | node_label = taxon_names, 36 | node_size = x, 37 | node_color = x)) 38 | }) 39 | 40 | 41 | if (file.exists("Rplots.pdf")) { 42 | file.remove("Rplots.pdf") 43 | } -------------------------------------------------------------------------------- /tests/testthat/test--taxa.R: -------------------------------------------------------------------------------- 1 | context("taxa") 2 | 3 | x <- taxon( 4 | name = taxon_name("Poa annua"), 5 | rank = taxon_rank("species"), 6 | id = taxon_id(93036) 7 | ) 8 | 9 | test_that("taxa works", { 10 | aa <- taxa(x, x, x) 11 | 12 | expect_is(aa, "taxa") 13 | expect_is(unlist(aa), "list") 14 | expect_is(aa[[1]], "Taxon") 15 | expect_is(aa[[2]], "Taxon") 16 | expect_is(aa[[3]], "Taxon") 17 | }) 18 | 19 | test_that("taxa - empty", { 20 | aa <- taxa() 21 | 22 | expect_is(aa, "taxa") 23 | expect_is(unclass(aa), "list") 24 | expect_equal(length(aa), 0) 25 | }) 26 | 27 | test_that("taxa - print method", { 28 | # no inputs 29 | expect_output(print(taxa()), "") 30 | expect_output(print(taxa()), "no\\. taxa: 0") 31 | expect_output(print(taxa(x)), "no\\. taxa: 1") 32 | expect_output(print(taxa(x)), "Poa annua / species / 93036") 33 | }) 34 | 35 | test_that("taxa fails well", { 36 | expect_error(taxa(5), "all inputs to 'taxa' must be of class 'Taxon'") 37 | expect_error(taxa(mtcars), "all inputs to 'taxa' must be of class 'Taxon'") 38 | expect_error(taxa(4, x, "adff"), 39 | "all inputs to 'taxa' must be of class 'Taxon'") 40 | }) 41 | 42 | test_that("dots and .list return the same output", { 43 | expect_equal(taxa(x, x, x), taxa(.list = list(x, x, x))) 44 | expect_error(taxa(taxon("a"), .list = list(taxon("a"))), 45 | 'Both `...` and `.list` were supplied') 46 | }) 47 | 48 | -------------------------------------------------------------------------------- /tests/testthat/test-taxon.R: -------------------------------------------------------------------------------- 1 | context("taxon") 2 | 3 | name <- taxon_name("Poa annua") 4 | rank <- taxon_rank("species") 5 | id <- taxon_id(93036) 6 | 7 | test_that("taxa works", { 8 | aa <- taxon(name, rank, id) 9 | 10 | expect_is(aa, "Taxon") 11 | expect_null(aa$authority) 12 | expect_is(aa$id, "TaxonId") 13 | expect_is(aa$name, "TaxonName") 14 | expect_is(aa$rank, "TaxonRank") 15 | expect_output(aa$print()) 16 | }) 17 | 18 | test_that("taxa fails well", { 19 | expect_error(taxon(rank = "adfd"), 20 | "argument \"name\" is missing") 21 | expect_error(taxon(5), 22 | "name must be of class TaxonName, character") 23 | expect_error(taxon("adf", 5), 24 | "rank must be of class TaxonRank, character") 25 | expect_error(taxon("adfadsf", authority = 23), 26 | "authority must be of class character") 27 | }) 28 | 29 | test_that("taxon can do null data", { 30 | x <- taxon(NULL) 31 | expect_is(x, "Taxon") 32 | expect_null(x$name) 33 | expect_null(x$id) 34 | }) 35 | -------------------------------------------------------------------------------- /tests/testthat/test-taxon_id.R: -------------------------------------------------------------------------------- 1 | context("taxon_id") 2 | 3 | test_that("taxa_id - just ID", { 4 | aa <- taxon_id(93036) 5 | 6 | expect_is(aa, "TaxonId") 7 | expect_null(aa$database) 8 | expect_type(aa$id, "double") 9 | expect_output(aa$print()) 10 | }) 11 | 12 | test_that("taxa_id - ID and database (TaxonDatabase)", { 13 | aa <- taxon_id(93036, database_list$ncbi) 14 | 15 | expect_is(aa, "TaxonId") 16 | expect_is(aa$database, "TaxonDatabase") 17 | expect_equal(aa$database$name, "ncbi") 18 | expect_equal(aa$database$url, "http://www.ncbi.nlm.nih.gov/taxonomy") 19 | expect_type(aa$id, "double") 20 | expect_output(aa$print()) 21 | }) 22 | 23 | test_that("taxa_id - ID and database (character)", { 24 | aa <- taxon_id(93036, "ncbi") 25 | 26 | expect_is(aa, "TaxonId") 27 | expect_is(aa$database, "TaxonDatabase") 28 | expect_equal(aa$database$name, "ncbi") 29 | expect_null(aa$database$url) 30 | expect_type(aa$id, "double") 31 | expect_output(aa$print()) 32 | }) 33 | 34 | test_that("taxon_id fails well", { 35 | expect_error(taxon_id(), 36 | "argument \"id\" is missing") 37 | expect_error(taxon_id(mtcars), 38 | "id must be of class character, integer, numeric") 39 | expect_error(taxon_id("adf", 5), 40 | "database must be of class character") 41 | }) 42 | 43 | test_that("taxon_id can do null data", { 44 | # empty taxon_id() tested in above block 45 | x <- taxon_id(NULL) 46 | expect_is(x, "TaxonId") 47 | expect_null(x$name) 48 | expect_null(x$database) 49 | }) 50 | -------------------------------------------------------------------------------- /tests/testthat/test-taxon_name.R: -------------------------------------------------------------------------------- 1 | context("taxon_nane") 2 | 3 | test_that("taxa_name - just", { 4 | aa <- taxon_name("Poa") 5 | 6 | expect_is(aa, "TaxonName") 7 | expect_null(aa$database) 8 | expect_type(aa$name, "character") 9 | expect_output(aa$print()) 10 | }) 11 | 12 | test_that("taxa_name - name and database (TaxonDatabase)", { 13 | aa <- taxon_name("Poa", database_list$ncbi) 14 | 15 | expect_is(aa, "TaxonName") 16 | expect_is(aa$database, "TaxonDatabase") 17 | expect_equal(aa$database$name, "ncbi") 18 | expect_equal(aa$database$url, "http://www.ncbi.nlm.nih.gov/taxonomy") 19 | expect_type(aa$name, "character") 20 | expect_output(aa$print()) 21 | }) 22 | 23 | test_that("taxa_name - ID and database (character)", { 24 | aa <- taxon_name("Poa", "ncbi") 25 | 26 | expect_is(aa, "TaxonName") 27 | expect_is(aa$database, "TaxonDatabase") 28 | expect_equal(aa$database$name, "ncbi") 29 | expect_null(aa$database$url) 30 | expect_type(aa$name, "character") 31 | expect_output(aa$print()) 32 | }) 33 | 34 | test_that("taxon_name fails well", { 35 | expect_error(taxon_name(), 36 | "argument \"name\" is missing") 37 | expect_error(taxon_name(mtcars), 38 | "name must be of class character") 39 | expect_error(taxon_name("adf", 5), 40 | "database must be of class character, TaxonDatabase") 41 | }) 42 | 43 | test_that("taxon_name can do null data", { 44 | # empty taxon_name() tested in above block 45 | x <- taxon_name(NULL) 46 | expect_is(x, "TaxonName") 47 | expect_null(x$name) 48 | expect_null(x$database) 49 | }) 50 | -------------------------------------------------------------------------------- /tests/testthat/test-taxon_rank.R: -------------------------------------------------------------------------------- 1 | context("taxon_rank") 2 | 3 | test_that("taxa_rank - just rank", { 4 | aa <- taxon_rank("species") 5 | 6 | expect_is(aa, "TaxonRank") 7 | expect_null(aa$database) 8 | expect_type(aa$name, "character") 9 | expect_output(print(aa$print()), "") 10 | }) 11 | 12 | test_that("taxa_rank - name and database (TaxonRank)", { 13 | aa <- taxon_rank("species", database_list$ncbi) 14 | 15 | expect_is(aa, "TaxonRank") 16 | expect_is(aa$database, "TaxonDatabase") 17 | expect_equal(aa$database$name, "ncbi") 18 | expect_equal(aa$database$url, "http://www.ncbi.nlm.nih.gov/taxonomy") 19 | expect_type(aa$name, "character") 20 | }) 21 | 22 | test_that("taxa_rank - name and database (character)", { 23 | aa <- taxon_rank("genus", "ncbi") 24 | 25 | expect_is(aa, "TaxonRank") 26 | expect_is(aa$database, "TaxonDatabase") 27 | expect_equal(aa$database$name, "ncbi") 28 | expect_null(aa$database$url) 29 | expect_type(aa$name, "character") 30 | }) 31 | 32 | test_that("taxon_rank fails well", { 33 | expect_error(taxon_rank(), 34 | "argument \"name\" is missing") 35 | expect_error(taxon_rank(mtcars), 36 | "name must be of class character, TaxonName") 37 | expect_error(taxon_rank("adf", 5), 38 | "database must be of class character, TaxonDatabase") 39 | }) 40 | 41 | test_that("taxon_rank can do null data", { 42 | # empty taxon_rank() tested in above block 43 | x <- taxon_rank(NULL) 44 | expect_is(x, "TaxonRank") 45 | expect_null(x$name) 46 | expect_null(x$database) 47 | }) 48 | -------------------------------------------------------------------------------- /vignettes/introduction.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Documentation for metacoder" 3 | output: rmarkdown::html_vignette 4 | vignette: > 5 | %\VignetteIndexEntry{Documentation for metacoder} 6 | %\VignetteEngine{knitr::rmarkdown} 7 | %\VignetteEncoding{UTF-8} 8 | --- 9 | 10 | See the documentation at https://grunwaldlab.github.io/metacoder_documentation/. 11 | 12 | 13 | --------------------------------------------------------------------------------