Given a folder containing phylogenetic trees, exclude (i.e., "trim"),
tips on unusually long branches. Tips on a branch 10 times longer
than their sister AND longer than relative_cutoff, OR tips
that are longer than absolute_cutoff will be trimmed. This
function will overwrite any output files with the same name in
tree_folder.
trim_tips(path_to_ys = pkgconfig::get_config("baitfindR::path_to_ys"), tree_folder, tree_file_ending, relative_cutoff, absolute_cutoff, overwrite = FALSE, get_hash = TRUE, echo = pkgconfig::get_config("baitfindR::echo", fallback = FALSE), ...)
| path_to_ys | Character vector of length one; the path to the folder containing Y&S python scripts, e.g., |
|---|---|
| tree_folder | Character vector of length one; the path to the folder containing the trees to trim. |
| tree_file_ending | Character vector of length one; only tree files with this file ending will be used. |
| relative_cutoff | Numeric vector of length one; tips on a branch 10 times longer than their sister AND longer than this value will be trimmed. |
| absolute_cutoff | Numeric vector of length one; tips on branches longer than this value will be trimmed. |
| overwrite | Logical; should previous output of this command be erased so new output can be written? Once erased it cannot be restored, so use with caution! |
| get_hash | Logical; should the 32-byte MD5 hash be computed for all output trimmed tree files concatenated together? Used for by |
| echo | Logical; should the standard output and error be printed to the screen? |
| ... | Other arguments. Not used by this function, but meant to be used by |
For each input tree with a file ending matching tree_file_ending in tree_folder, a trimmed tree with a file ending in .tt will be written to tree_folder. If get_hash is TRUE, the 32-byte MD5 hash be computed for all trimmed tree files concatenated together will be returned.
Wrapper for Yang and Smith (2014) trim_tips.py
Yang, Y. and S.A. Smith. 2014. Orthology inference in non-model organisms using transcriptomes and low-coverage genomes: improving accuracy and matrix occupancy for phylogenomics. Molecular Biology and Evolution 31:3081-3092. https://bitbucket.org/yangya/phylogenomic_dataset_construction/overview
# NOT RUN { trim_tips(tree_folder = "some/folder/containing/tree/files", tree_file_ending = ".tre", relative_cutoff = 0.2, absolute_cutoff = 0.4) # }