From 310b4ce22159318b26246fb8a05cc5fdc05c294b Mon Sep 17 00:00:00 2001 From: "Joseph W. Brown" Date: Thu, 21 Apr 2016 14:04:34 -0400 Subject: [PATCH 1/7] return tol_mrca invisible, print --- NAMESPACE | 1 + R/tol.R | 20 +++++++++++++++++++- man/tol_mrca.Rd | 2 +- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/NAMESPACE b/NAMESPACE index 3f8d31d2..75721f86 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -21,6 +21,7 @@ S3method(ott_id,tol_summary) S3method(print,study_ids) S3method(print,study_meta) S3method(print,tnrs_contexts) +S3method(print,tol_mrca) S3method(print,tol_summary) S3method(source_list,tol_mrca) S3method(source_list,tol_node) diff --git a/R/tol.R b/R/tol.R index 6464632f..bfada1d5 100644 --- a/R/tol.R +++ b/R/tol.R @@ -192,7 +192,7 @@ source_list.tol_summary <- .source_list ##' @param ... additional arguments to customize the API call (see ##' \code{\link{rotl}} for more information). ##' -##' @return A list +##' @return An invisible list of of the MRCA node properties ##' ##' @examples ##' \dontrun{ @@ -208,6 +208,24 @@ tol_mrca <- function(ott_ids=NULL, node_ids=NULL, ...) { return(res) } +##' @export +print.tol_mrca <- function(x, ...) { + cat("\nOpenTree MRCA node.\n\n") + cat("Node id: ", x$mrca$node_id, "\n", sep="") + cat("Number of terminal descendants: ", x$mrca$num_tips, "\n", sep="") + if (is_taxon(x[["mrca"]][["taxon"]])) { + cat("Is taxon: TRUE\n") + cat("Name: ", x$mrca$taxon$name, "\n", sep="") + cat("ott id: ", x$mrca$taxon$ott_id, "\n", sep="") + } else { + cat("Is taxon: FALSE\n") + cat("Nearest taxon:\n") + cat(" Name: ", x$nearest_taxon$name, "\n", sep="") + cat(" ott id: ", x$nearest_taxon$ott_id, "\n", sep="") + } +} + + tol_mrca_method_factory <- function(.f) { function(tax, ...) { if (is_taxon(tax[["mrca"]][["taxon"]])) { diff --git a/man/tol_mrca.Rd b/man/tol_mrca.Rd index d92c8611..d23dffcd 100644 --- a/man/tol_mrca.Rd +++ b/man/tol_mrca.Rd @@ -35,7 +35,7 @@ tol_mrca(ott_ids = NULL, node_ids = NULL, ...) \item{tax}{an object returned by \code{tol_mrca()}.} } \value{ -A list +An invisible list of of the MRCA node properties } \description{ Most Recent Common Ancestor for a set of nodes From a7eee49d1b4b2a23f2be6797464107532a6fc8d8 Mon Sep 17 00:00:00 2001 From: "Joseph W. Brown" Date: Thu, 21 Apr 2016 14:13:18 -0400 Subject: [PATCH 2/7] make example tol_subtree smaller (hummingbirds, not Aves) --- R/tol.R | 2 +- man/tol_subtree.Rd | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/R/tol.R b/R/tol.R index bfada1d5..a6b095f0 100644 --- a/R/tol.R +++ b/R/tol.R @@ -295,7 +295,7 @@ source_list.tol_mrca <- .source_list ##' ##' @examples ##' \dontrun{ -##' res <- tol_subtree(ott_id=81461) +##' res <- tol_subtree(ott_id=241841) ##' } ##' @export tol_subtree <- function(ott_id=NULL, node_id=NULL, label_format=NULL, diff --git a/man/tol_subtree.Rd b/man/tol_subtree.Rd index acf1c5ca..9e2f96cf 100644 --- a/man/tol_subtree.Rd +++ b/man/tol_subtree.Rd @@ -41,7 +41,7 @@ Given a node, return the subtree of the synthetic tree descended } \examples{ \dontrun{ - res <- tol_subtree(ott_id=81461) + res <- tol_subtree(ott_id=241841) } } From 50d10a0d7d4523ad9c8c0f5652c69d74970d83ad Mon Sep 17 00:00:00 2001 From: "Joseph W. Brown" Date: Thu, 21 Apr 2016 14:19:37 -0400 Subject: [PATCH 3/7] get rid of ugly tabs --- R/tol.R | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/R/tol.R b/R/tol.R index a6b095f0..efdbadc7 100644 --- a/R/tol.R +++ b/R/tol.R @@ -119,16 +119,16 @@ tol_about <- function(include_source_list=FALSE, ...) { ##' @export print.tol_summary <- function(x, ...) { cat("\nOpenTree Synthetic Tree of Life.\n\n") - cat("\tTree version: ", x$synth_id, "\n", sep="") - cat("\tTaxonomy version: ", x$taxonomy, "\n", sep="") - cat("\tConstructed on: ", x$date_created, "\n", sep="") - cat("\tNumber of terminal taxa: ", x$root$num_tips, "\n", sep="") - cat("\tNumber of source trees: ", x$num_source_trees, "\n", sep="") - cat("\tNumber of source studies: ", x$num_source_studies, "\n", sep = "") - cat("\tSource list present: ", ifelse(exists("source_list", x), "true", "false"), "\n", sep="") - cat("\tRoot taxon: ", x$root$taxon$name, "\n", sep="") - cat("\tRoot ott_id: ", x$root$taxon$ott_id, "\n", sep="") - cat("\tRoot node_id: ", x$root$node_id, "\n", sep="") + cat("Tree version: ", x$synth_id, "\n", sep="") + cat("Taxonomy version: ", x$taxonomy, "\n", sep="") + cat("Constructed on: ", x$date_created, "\n", sep="") + cat("Number of terminal taxa: ", x$root$num_tips, "\n", sep="") + cat("Number of source trees: ", x$num_source_trees, "\n", sep="") + cat("Number of source studies: ", x$num_source_studies, "\n", sep = "") + cat("Source list present: ", ifelse(exists("source_list", x), "true", "false"), "\n", sep="") + cat("Root taxon: ", x$root$taxon$name, "\n", sep="") + cat("Root ott_id: ", x$root$taxon$ott_id, "\n", sep="") + cat("Root node_id: ", x$root$node_id, "\n", sep="") } tol_about_method_factory <- function(.f) { From 4a146933306160a207ec163c070a81def5e2979d Mon Sep 17 00:00:00 2001 From: "Joseph W. Brown" Date: Thu, 21 Apr 2016 14:36:45 -0400 Subject: [PATCH 4/7] return tol_node_info invisible, print --- NAMESPACE | 1 + R/tol.R | 20 +++++++++++++++++--- man/tol_node_info.Rd | 4 ++-- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/NAMESPACE b/NAMESPACE index 75721f86..e9246047 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -22,6 +22,7 @@ S3method(print,study_ids) S3method(print,study_meta) S3method(print,tnrs_contexts) S3method(print,tol_mrca) +S3method(print,tol_node) S3method(print,tol_summary) S3method(source_list,tol_mrca) S3method(source_list,tol_node) diff --git a/R/tol.R b/R/tol.R index efdbadc7..0587154a 100644 --- a/R/tol.R +++ b/R/tol.R @@ -225,7 +225,6 @@ print.tol_mrca <- function(x, ...) { } } - tol_mrca_method_factory <- function(.f) { function(tax, ...) { if (is_taxon(tax[["mrca"]][["taxon"]])) { @@ -408,8 +407,8 @@ strip_ott_ids <- function(tip_labels) { ##' @param ... additional arguments to customize the API call (see ##' ?rotl for more information) ##' -##' @return \code{tol_node_info} returns a list of summary information -##' about the queried node. +##' @return \code{tol_node_info} returns an invisible list of summary +##' information about the queried node: ##' ##' \itemize{ ##' @@ -505,6 +504,21 @@ tol_node_method_factory <- function(.f) { } } +##' @export +print.tol_node <- function(x, ...) { + cat("\nOpenTree node.\n\n") + cat("Node id: ", x$node_id, "\n", sep="") + cat("Number of terminal descendants: ", x$num_tips, "\n", sep="") + if (is_taxon(x[["taxon"]])) { + cat("Is taxon: TRUE\n") + cat("Name: ", x$taxon$name, "\n", sep="") + cat("Rank: ", x$taxon$rank, "\n", sep="") + cat("ott id: ", x$taxon$ott_id, "\n", sep="") + } else { + cat("Is taxon: FALSE\n") + } +} + ##' @export ##' @param tax an object returned by \code{tol_node_info}. ##' @rdname tol_node_info diff --git a/man/tol_node_info.Rd b/man/tol_node_info.Rd index 2f61bf88..67e014ce 100644 --- a/man/tol_node_info.Rd +++ b/man/tol_node_info.Rd @@ -47,8 +47,8 @@ tol_node_info(ott_id = NULL, node_id = NULL, include_lineage = FALSE, ...) lineage of the node from the synthetic tree.} } \value{ -\code{tol_node_info} returns a list of summary information - about the queried node. +\code{tol_node_info} returns an invisible list of summary + information about the queried node: \itemize{ From 9faa13a1bd57dd5c5bcdc140690c2618d1c11f79 Mon Sep 17 00:00:00 2001 From: "Joseph W. Brown" Date: Thu, 21 Apr 2016 14:48:15 -0400 Subject: [PATCH 5/7] remove nonexistent tree_id arg from test, add node_id --- tests/testthat/test-api-tol.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/testthat/test-api-tol.R b/tests/testthat/test-api-tol.R index 01beb4d8..1de904c7 100644 --- a/tests/testthat/test-api-tol.R +++ b/tests/testthat/test-api-tol.R @@ -26,7 +26,7 @@ test_that("neither ott_ids nor node_ids are NULL for .tol_mrca", { test_that("ott_id is not NULL", { skip_on_cran() - expect_error(.tol_subtree(ott_id = NULL, tree_id = NULL), + expect_error(.tol_subtree(ott_id = NULL, node_id = NULL), "Must provide") }) From 894861fb0aa95d23a61f8218bc45319b8080e1f6 Mon Sep 17 00:00:00 2001 From: "Joseph W. Brown" Date: Thu, 21 Apr 2016 15:43:22 -0400 Subject: [PATCH 6/7] better documentation for tol_mrca --- R/tol.R | 92 ++++++++++++++++++++++++++++++++++++++++++++++++- man/tol_mrca.Rd | 92 ++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 182 insertions(+), 2 deletions(-) diff --git a/R/tol.R b/R/tol.R index 0587154a..70ed079f 100644 --- a/R/tol.R +++ b/R/tol.R @@ -192,7 +192,97 @@ source_list.tol_summary <- .source_list ##' @param ... additional arguments to customize the API call (see ##' \code{\link{rotl}} for more information). ##' -##' @return An invisible list of of the MRCA node properties +##' @return An invisible list of the MRCA node properties: +##' +##' \itemize{ +##' +##' \item {mrca} {List of node properties.} +##' +##' \itemize{ +##' \item {node_id} {String. The canonical identifier of the node.} +##' +##' \item {num_tips} {Numeric. The number of descendent tips.} +##' +##' \item {taxon} {A list of taxonomic properties. Only returned if +##' the queried node is a taxon. (If the node is not a taxon, a +##' \code{nearest_taxon} list is returned (see below)).} +##' +##' \itemize{ +##' \item {ott_id} {Numeric. The OpenTree Taxonomy ID (ottID).} +##' +##' \item {name} {String. The taxonomic name of the queried node.} +##' +##' \item {unique_name} {String. The string that uniquely +##' identifies the taxon in OTT.} +##' +##' \item {rank} {String. The taxonomic rank of the taxon in OTT.} +##' +##' \item {tax_sources} {List. A list of identifiers for taxonomic +##' sources, such as other taxonomies, that define taxa judged +##' equivalent to this taxon.} +##' } +##' +##' The following properties list support/conflict for the node across +##' synthesis source trees. All properties involve sourceid keys and +##' nodeid values (see \code{source_id_map} below) Not all properties are +##' are present for every node. +##' +##' \item {partial_path_of} {List. The edge below this synthetic tree node +##' is compatible with the edge below each of these input tree nodes (one +##' per tree). Each returned element is reported as sourceid:nodeid.} +##' +##' \item {supported_by} {List. Input tree nodes (one per tree) that support +##' this synthetic tree node. Each returned element is reported as +##' sourceid:nodeid.} +##' +##' \item {terminal} {List. Input tree nodes (one per tree) that are equivalent +##' to this synthetic tree node (via an exact mapping, or the input tree +##' terminal may be the only terminal descended from this synthetic tree node. +##' Each returned element is reported as sourceid:nodeid.} +##' +##' \item {conflicts_with} {Named list of lists. Names correspond to +##' sourceid keys. Each list contains input tree node ids (one or more per tree) +##' that conflict with this synthetic node.} +##' } +##' +##' \item {nearest_taxon} {A list of taxonomic properties of the nearest rootward +##' taxon node to the MRCA node. Only returned if the MRCA node is a not taxon +##' (otherwise the \code{taxon} list above is returned).} +##' +##' \itemize{ +##' \item {ott_id} {Numeric. The OpenTree Taxonomy ID (ottID).} +##' +##' \item {name} {String. The taxonomic name of the queried node.} +##' +##' \item {unique_name} {String. The string that uniquely +##' identifies the taxon in OTT.} +##' +##' \item {rank} {String. The taxonomic rank of the taxon in OTT.} +##' +##' \item {tax_sources} {List. A list of identifiers for taxonomic +##' sources, such as other taxonomies, that define taxa judged +##' equivalent to this taxon.} +##' } +##' +##' \item {source_id_map} {Named list of lists. Names correspond to the +##' sourceid keys used in the 4 properties above. Source trees will have the +##' following properties:} +##' +##' \itemize{ +##' \item {git_sha} {The git SHA identifying a particular source +##' version.} +##' +##' \item {tree_id} {The tree id associated with the study id used.} +##' +##' \item {study_id} {The study identifier. Will typically include +##' a prefix ("pg_" or "ot_").} +##' } +##' The only sourceid that does not correspond to a source tree is the taxonomy, +##' which will have the name "ott"+`taxonomy_version`, and the value is the +##' ott_id of the taxon in that taxonomy version. "Taxonomy" will only ever +##' appear in \code{supported_by}. +##' +##' } ##' ##' @examples ##' \dontrun{ diff --git a/man/tol_mrca.Rd b/man/tol_mrca.Rd index d23dffcd..8ede862e 100644 --- a/man/tol_mrca.Rd +++ b/man/tol_mrca.Rd @@ -35,7 +35,97 @@ tol_mrca(ott_ids = NULL, node_ids = NULL, ...) \item{tax}{an object returned by \code{tol_mrca()}.} } \value{ -An invisible list of of the MRCA node properties +An invisible list of the MRCA node properties: + +\itemize{ + + \item {mrca} {List of node properties.} + + \itemize{ + \item {node_id} {String. The canonical identifier of the node.} + + \item {num_tips} {Numeric. The number of descendent tips.} + + \item {taxon} {A list of taxonomic properties. Only returned if + the queried node is a taxon. (If the node is not a taxon, a + \code{nearest_taxon} list is returned (see below)).} + + \itemize{ + \item {ott_id} {Numeric. The OpenTree Taxonomy ID (ottID).} + + \item {name} {String. The taxonomic name of the queried node.} + + \item {unique_name} {String. The string that uniquely + identifies the taxon in OTT.} + + \item {rank} {String. The taxonomic rank of the taxon in OTT.} + + \item {tax_sources} {List. A list of identifiers for taxonomic + sources, such as other taxonomies, that define taxa judged + equivalent to this taxon.} + } + + The following properties list support/conflict for the node across + synthesis source trees. All properties involve sourceid keys and + nodeid values (see \code{source_id_map} below) Not all properties are + are present for every node. + + \item {partial_path_of} {List. The edge below this synthetic tree node + is compatible with the edge below each of these input tree nodes (one + per tree). Each returned element is reported as sourceid:nodeid.} + + \item {supported_by} {List. Input tree nodes (one per tree) that support + this synthetic tree node. Each returned element is reported as + sourceid:nodeid.} + + \item {terminal} {List. Input tree nodes (one per tree) that are equivalent + to this synthetic tree node (via an exact mapping, or the input tree + terminal may be the only terminal descended from this synthetic tree node. + Each returned element is reported as sourceid:nodeid.} + + \item {conflicts_with} {Named list of lists. Names correspond to + sourceid keys. Each list contains input tree node ids (one or more per tree) + that conflict with this synthetic node.} + } + + \item {nearest_taxon} {A list of taxonomic properties of the nearest rootward + taxon node to the MRCA node. Only returned if the MRCA node is a not taxon + (otherwise the \code{taxon} list above is returned).} + + \itemize{ + \item {ott_id} {Numeric. The OpenTree Taxonomy ID (ottID).} + + \item {name} {String. The taxonomic name of the queried node.} + + \item {unique_name} {String. The string that uniquely + identifies the taxon in OTT.} + + \item {rank} {String. The taxonomic rank of the taxon in OTT.} + + \item {tax_sources} {List. A list of identifiers for taxonomic + sources, such as other taxonomies, that define taxa judged + equivalent to this taxon.} + } + + \item {source_id_map} {Named list of lists. Names correspond to the + sourceid keys used in the 4 properties above. Source trees will have the + following properties:} + + \itemize{ + \item {git_sha} {The git SHA identifying a particular source + version.} + + \item {tree_id} {The tree id associated with the study id used.} + + \item {study_id} {The study identifier. Will typically include + a prefix ("pg_" or "ot_").} + } + The only sourceid that does not correspond to a source tree is the taxonomy, + which will have the name "ott"+`taxonomy_version`, and the value is the + ott_id of the taxon in that taxonomy version. "Taxonomy" will only ever + appear in \code{supported_by}. + + } } \description{ Most Recent Common Ancestor for a set of nodes From 477af6117138eb41d0085ea5fb0235e2bb387661 Mon Sep 17 00:00:00 2001 From: "Joseph W. Brown" Date: Thu, 21 Apr 2016 16:37:26 -0400 Subject: [PATCH 7/7] update tol documentation --- R/tol.R | 38 ++++++++++++++++---------------------- man/strip_ott_ids.Rd | 5 ++--- man/tol_about.Rd | 3 +-- man/tol_induced_subtree.Rd | 3 +-- man/tol_mrca.Rd | 7 +++---- man/tol_node_info.Rd | 3 +-- man/tol_subtree.Rd | 17 ++++++++--------- 7 files changed, 32 insertions(+), 44 deletions(-) diff --git a/R/tol.R b/R/tol.R index 70ed079f..20cbd9e1 100644 --- a/R/tol.R +++ b/R/tol.R @@ -105,8 +105,7 @@ ##' res <- tol_about() ##' tax_sources(res) ##' ott_id(res) -##' studies <- source_list(tol_about(include_source_list=TRUE)) -##' } +##' studies <- source_list(tol_about(include_source_list=TRUE))} ##' @rdname tol_about ##' @export tol_about <- function(include_source_list=FALSE, ...) { @@ -265,8 +264,8 @@ source_list.tol_summary <- .source_list ##' } ##' ##' \item {source_id_map} {Named list of lists. Names correspond to the -##' sourceid keys used in the 4 properties above. Source trees will have the -##' following properties:} +##' sourceid keys used in the support/conflict properties of the \code{mrca} +##' list above. Source trees will have the following properties:} ##' ##' \itemize{ ##' \item {git_sha} {The git SHA identifying a particular source @@ -288,8 +287,7 @@ source_list.tol_summary <- .source_list ##' \dontrun{ ##' birds_mrca <- tol_mrca(ott_ids=c(412129, 536234)) ##' ott_id(birds_mrca) -##' tax_sources(birds_mrca) -##' } +##' tax_sources(birds_mrca)} ##' @rdname tol_mrca ##' @export tol_mrca <- function(ott_ids=NULL, node_ids=NULL, ...) { @@ -355,15 +353,15 @@ ott_id.tol_mrca <- tol_mrca_method_factory(.tax_ott_id) source_list.tol_mrca <- .source_list -##' Extract a subtree from the synthetic tree from an ott id. +##' Extract a subtree from the synthetic tree from an Open Tree node id. ##' ##' @title Extract a subtree from the synthetic tree ##' ##' @details Given a node, return the subtree of the synthetic tree descended -##' from that node, either in newick or ArguSON format. The start node may -##' be specified using either a node id or an ott id, but not both. If the -##' specified node is not in the synthetic tree an error will be returned. -##' There is a size limit of 25000 tips for this method. +##' from that node. The start node may be specified using either a node id +##' or an ott id, but not both. If the specified node is not in the +##' synthetic tree an error will be returned. There is a size limit of +##' 25000 tips for this method. ##' ##' @param ott_id Numeric. The ott id of the node in the tree that should ##' serve as the root of the tree returned. @@ -372,7 +370,7 @@ source_list.tol_mrca <- .source_list ##' @param label_format Character. Defines the label type; one of ##' \dQuote{\code{name}}, \dQuote{\code{id}}, or ##' \dQuote{\code{name_and_id}} (the default). -##' @param file if specified, the function will write the subtree to a +##' @param file If specified, the function will write the subtree to a ##' file in newick format. ##' @param ... additional arguments to customize the API call (see ##' \code{\link{rotl}} for more information). @@ -383,9 +381,8 @@ source_list.tol_mrca <- .source_list ##' whether the file was successfully created. ##' ##' @examples -##' \dontrun{ -##' res <- tol_subtree(ott_id=241841) -##' } +##' \dontrun{ +##' res <- tol_subtree(ott_id=241841)} ##' @export tol_subtree <- function(ott_id=NULL, node_id=NULL, label_format=NULL, file, ...) { @@ -435,8 +432,7 @@ tol_subtree <- function(ott_id=NULL, node_id=NULL, label_format=NULL, ##' res <- tol_induced_subtree(ott_ids=c(292466, 267845, 666104, 316878, 102710)) ##' tree_file <- tempfile(fileext=".tre") ##' tol_induced_subtree(ott_ids=c(292466, 267845, 666104, 316878, 102710), -##' file=tree_file) -##' } +##' file=tree_file)} ##' @export tol_induced_subtree <- function(ott_ids=NULL, node_ids=NULL, label_format=NULL, file, ...) { @@ -456,7 +452,7 @@ tol_induced_subtree <- function(ott_ids=NULL, node_ids=NULL, label_format=NULL, ##' Strip OTT ids from tip labels ##' @param tip_labels a character vector containing tip labels (most likely ##' the \code{tip.label} element from a tree returned by -##' \code{\link{tol_induced_subtree}} +##' \code{\link{tol_induced_subtree}}). ##' ##' @return A character vector containing the contents of \code{tip_labels} ##' with any OTT ids removed. @@ -467,8 +463,7 @@ tol_induced_subtree <- function(ott_ids=NULL, node_ids=NULL, label_format=NULL, ##' tr <- tol_induced_subtree(ott_ids=c(292466, 267845, 666104, 102710)) ##' tr$tip.label %in% genera ##' tr$tip.label <- strip_ott_ids(tr$tip.label) -##' tr$tip.label %in% genera -##'} +##' tr$tip.label %in% genera} ##'@export strip_ott_ids <- function(tip_labels) { sub("_ott\\d+$", "", tip_labels) @@ -577,8 +572,7 @@ strip_ott_ids <- function(tip_labels) { ##' tax_rank(birds) ##' ott_id(birds) ##' tax_lineage(birds) -##' tol_lineage(birds) -##' } +##' tol_lineage(birds)} ##' @export tol_node_info <- function(ott_id=NULL, node_id=NULL, include_lineage=FALSE, ...) { res <- .tol_node_info(ott_id=ott_id, node_id=node_id, diff --git a/man/strip_ott_ids.Rd b/man/strip_ott_ids.Rd index 27ec2098..f4d57223 100644 --- a/man/strip_ott_ids.Rd +++ b/man/strip_ott_ids.Rd @@ -9,7 +9,7 @@ strip_ott_ids(tip_labels) \arguments{ \item{tip_labels}{a character vector containing tip labels (most likely the \code{tip.label} element from a tree returned by -\code{\link{tol_induced_subtree}}} +\code{\link{tol_induced_subtree}}).} } \value{ A character vector containing the contents of \code{tip_labels} @@ -24,7 +24,6 @@ genera <- c("Perdix", "Dendroica", "Cinclus", "Selasphorus", "Struthio") tr <- tol_induced_subtree(ott_ids=c(292466, 267845, 666104, 102710)) tr$tip.label \%in\% genera tr$tip.label <- strip_ott_ids(tr$tip.label) -tr$tip.label \%in\% genera -} +tr$tip.label \%in\% genera} } diff --git a/man/tol_about.Rd b/man/tol_about.Rd index 2adb47f5..e27b95f6 100644 --- a/man/tol_about.Rd +++ b/man/tol_about.Rd @@ -114,8 +114,7 @@ Summary information about the current draft tree of life, res <- tol_about() tax_sources(res) ott_id(res) -studies <- source_list(tol_about(include_source_list=TRUE)) -} +studies <- source_list(tol_about(include_source_list=TRUE))} } \seealso{ \code{\link{source_list}} to explore the list of studies diff --git a/man/tol_induced_subtree.Rd b/man/tol_induced_subtree.Rd index 1559b688..6818bc53 100644 --- a/man/tol_induced_subtree.Rd +++ b/man/tol_induced_subtree.Rd @@ -45,7 +45,6 @@ induced on the draft tree by the set of identified nodes. res <- tol_induced_subtree(ott_ids=c(292466, 267845, 666104, 316878, 102710)) tree_file <- tempfile(fileext=".tre") tol_induced_subtree(ott_ids=c(292466, 267845, 666104, 316878, 102710), - file=tree_file) -} + file=tree_file)} } diff --git a/man/tol_mrca.Rd b/man/tol_mrca.Rd index 8ede862e..80a56ca4 100644 --- a/man/tol_mrca.Rd +++ b/man/tol_mrca.Rd @@ -108,8 +108,8 @@ An invisible list of the MRCA node properties: } \item {source_id_map} {Named list of lists. Names correspond to the - sourceid keys used in the 4 properties above. Source trees will have the - following properties:} + sourceid keys used in the support/conflict properties of the \code{mrca} + list above. Source trees will have the following properties:} \itemize{ \item {git_sha} {The git SHA identifying a particular source @@ -152,7 +152,6 @@ Get the MRCA of a set of nodes on the current synthetic \dontrun{ birds_mrca <- tol_mrca(ott_ids=c(412129, 536234)) ott_id(birds_mrca) -tax_sources(birds_mrca) -} +tax_sources(birds_mrca)} } diff --git a/man/tol_node_info.Rd b/man/tol_node_info.Rd index 67e014ce..5ac3a7df 100644 --- a/man/tol_node_info.Rd +++ b/man/tol_node_info.Rd @@ -141,7 +141,6 @@ source_list(birds) tax_rank(birds) ott_id(birds) tax_lineage(birds) -tol_lineage(birds) -} +tol_lineage(birds)} } diff --git a/man/tol_subtree.Rd b/man/tol_subtree.Rd index 9e2f96cf..569713a2 100644 --- a/man/tol_subtree.Rd +++ b/man/tol_subtree.Rd @@ -17,7 +17,7 @@ serve as the root of the tree returned.} \dQuote{\code{name}}, \dQuote{\code{id}}, or \dQuote{\code{name_and_id}} (the default).} -\item{file}{if specified, the function will write the subtree to a +\item{file}{If specified, the function will write the subtree to a file in newick format.} \item{...}{additional arguments to customize the API call (see @@ -30,18 +30,17 @@ If no value is specified to the \code{file} argument whether the file was successfully created. } \description{ -Extract a subtree from the synthetic tree from an ott id. +Extract a subtree from the synthetic tree from an Open Tree node id. } \details{ Given a node, return the subtree of the synthetic tree descended - from that node, either in newick or ArguSON format. The start node may - be specified using either a node id or an ott id, but not both. If the - specified node is not in the synthetic tree an error will be returned. - There is a size limit of 25000 tips for this method. + from that node. The start node may be specified using either a node id + or an ott id, but not both. If the specified node is not in the + synthetic tree an error will be returned. There is a size limit of + 25000 tips for this method. } \examples{ - \dontrun{ - res <- tol_subtree(ott_id=241841) - } +\dontrun{ +res <- tol_subtree(ott_id=241841)} }