Conversation
| #' path of the sample metadata file (tsv). (Default: \code{NULL}). | ||
| #' | ||
| #' @param tree.file \code{Character scalar}. Optional path to a phylogenetic | ||
| #' tree. If provided, replaces any tree stored in the BIOM metadata. |
There was a problem hiding this comment.
Is it possible to provide multiple trees?
There was a problem hiding this comment.
In theory uses, but there is no any practical use-cases
| # Load/replace tree if provided | ||
| if (!is.null(tree.file)) { | ||
| if (!.is_non_empty_string(tree.file)) { | ||
| stop("'tree.file' must be a single character value or NULL.", | ||
| call. = FALSE) | ||
| } | ||
| tree <- ape::read.tree(tree.file) | ||
| rowTree(tse) <- tree | ||
| } |
There was a problem hiding this comment.
The node names in tree must match exactly the rownames. Otherwise, the rows cannot be linked with the tree and it leads to warning that some rows were dropped (it is hard for user to know what is the problem):
Warning message:
18371 row(s) couldn't be matched to the tree and are/is removed.
One could provide links between rows and nodes of tree, but it becomes too complicated.
Proposal:
- Pack this tree adding script into function
- Check if rownames can be found from tree. If not, give error:
"Rownames do not match with tree labels. Construct TreeSE without tree (tree.file=NULL) and then add the tree manually with changeTree(tse, tree = tree_object, rowNodeLab = link_vector)"
| rowTree(tse) <- tree | ||
| } | ||
|
|
||
| tse |
| #' path of the sample metadata file (tsv). (Default: \code{NULL}). | ||
| #' | ||
| #' @param tree.file \code{Character scalar}. Optional path to a phylogenetic | ||
| #' tree. If provided, replaces any tree stored in the BIOM metadata. |
There was a problem hiding this comment.
In theory uses, but there is no any practical use-cases
| stop("'tree.file' must be a single character value or NULL.", | ||
| call. = FALSE) | ||
| } | ||
| tree <- ape::read.tree(tree.file) |
There was a problem hiding this comment.
Add importFrom and use without specifying the package
ping #755