diff --git a/articles/Bayesian.html b/articles/Bayesian.html index e0c98b4..e8219ec 100644 --- a/articles/Bayesian.html +++ b/articles/Bayesian.html @@ -75,7 +75,7 @@

ORCiDMartin R. Smith, Durham University

-

2023-11-29

+

2024-02-23

Source: vignettes/Bayesian.Rmd
Bayesian.Rmd
diff --git a/news/index.html b/news/index.html index c94b2b8..666cc25 100644 --- a/news/index.html +++ b/news/index.html @@ -51,7 +51,7 @@
-

Rogue v2.1.6

+

Rogue v2.1.6

CRAN release: 2023-11-29

C_RogueNaRok() returns 0 if successful; -1 on error.

+

QuickRogue() returns a data.frame in the same format as +RogueTaxa().

+ + +

C_RogueNaRok() returns 0 if successful; -1 on error.

Details

@@ -329,7 +333,7 @@

Examplestrees <- list(read.tree(text = ("(a, (b, (c, (d, (e, (X1, X2))))));")), read.tree(text = ("((a, (X1, X2)), (b, (c, (d, e))));"))) RogueTaxa(trees, dropsetSize = 2) -#> 2023-11-29 10:05:42.718608: Dropped 2 leaves, rendering 4.64386 bits. +#> 2024-02-23 14:46:09.930404: Dropped 2 leaves, rendering 4.64386 bits. #> num taxNum taxon rawImprovement IC #> 1 0 <NA> <NA> NA 3.169925 #> 2 1 6,7 X1,X2 1.473931 4.643856 @@ -346,7 +350,7 @@

ExamplesLabelSplits(cons, SplitFrequency(cons, trees) / length(trees)) reduced <- RogueTaxa(trees, info = "phylogenetic", ret = "tree") -#> 2023-11-29 10:05:42.824518: Dropped 2 leaves, rendering 17.0678 bits. +#> 2024-02-23 14:46:10.014404: Dropped 2 leaves, rendering 17.0678 bits. plot(reduced) LabelSplits(reduced, SplitFrequency(reduced, trees) / length(trees)) diff --git a/search.json b/search.json index f3b922f..1120b8f 100644 --- a/search.json +++ b/search.json @@ -1 +1 @@ -[{"path":"https://ms609.github.io/Rogue/CODE_OF_CONDUCT.html","id":null,"dir":"","previous_headings":"","what":"Contributor Code of Conduct","title":"Contributor Code of Conduct","text":"contributors maintainers project, pledge respect people contribute reporting issues, posting feature requests, updating documentation, submitting pull requests patches, activities. committed making participation project harassment-free experience everyone, regardless level experience, gender, gender identity expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion. Examples unacceptable behavior participants include use sexual language imagery, derogatory comments personal attacks, trolling, public private harassment, insults, unprofessional conduct. Project maintainers right responsibility remove, edit, reject comments, commits, code, wiki edits, issues, contributions aligned Code Conduct. Project maintainers follow Code Conduct may removed project team. Instances abusive, harassing, otherwise unacceptable behavior may reported opening issue contacting one project maintainers. Code Conduct adapted Contributor Covenant (https://www.contributor-covenant.org), version 1.0.0, available https://contributor-covenant.org/version/1/0/0/.","code":""},{"path":[]},{"path":"https://ms609.github.io/Rogue/CONTRIBUTING.html","id":"fixing-typos","dir":"","previous_headings":"","what":"Fixing typos","title":"CONTRIBUTING","text":"Small typos grammatical errors documentation may edited directly using GitHub web interface, long changes made source file. : edit roxygen comment .R file R/. DON’T: edit .Rd file man/.","code":""},{"path":"https://ms609.github.io/Rogue/CONTRIBUTING.html","id":"prerequisites","dir":"","previous_headings":"","what":"Prerequisites","title":"CONTRIBUTING","text":"make substantial pull request, always file issue make sure someone team agrees ’s problem. ’ve found bug, create associated issue illustrate bug minimal reprex.","code":""},{"path":"https://ms609.github.io/Rogue/CONTRIBUTING.html","id":"pull-request-process","dir":"","previous_headings":"","what":"Pull request process","title":"CONTRIBUTING","text":"recommend create Git branch pull request (PR). Look GitHub actions CodeCovr build status making changes. follow Google’s R style guide use camelCase variable names, TitleCase function names. use Oxford ending ‘ize’ (‘ise’), UK spelling (e.g. ‘colour’) possible avoid distinction (e.g. shortening ‘col’) use roxygen2 build documentation. use testthat. Contributions test cases included easier accept. user-facing changes, add bullet top NEWS.md current development version header describing changes made followed GitHub username, links relevant issue(s)/PR(s).","code":""},{"path":"https://ms609.github.io/Rogue/CONTRIBUTING.html","id":"code-of-conduct","dir":"","previous_headings":"","what":"Code of Conduct","title":"CONTRIBUTING","text":"Please note project released Contributor Code Conduct. contributing project agree abide terms.","code":""},{"path":"https://ms609.github.io/Rogue/CONTRIBUTING.html","id":"prefer-to-e-mail","dir":"","previous_headings":"","what":"Prefer to e-mail?","title":"CONTRIBUTING","text":"E-mail person listed maintainer DESCRIPTION file repo. Private discussions email don’t help others - course email totally warranted sensitive problems.","code":""},{"path":"https://ms609.github.io/Rogue/CONTRIBUTING.html","id":"thanks-for-contributing","dir":"","previous_headings":"","what":"Thanks for contributing!","title":"CONTRIBUTING","text":"document adapted tidyverse contributing guide.","code":""},{"path":"https://ms609.github.io/Rogue/articles/Bayesian.html","id":"set-up","dir":"Articles","previous_headings":"","what":"Set up","title":"Detecting rogue taxa in Bayesian posterior tree sets","text":"Let’s start loading packages ’ll need: ’ll work example data generated morphological analysis early brachiopods (Sun et al., 2018) using MrBayes (Hulsenbeck & Ronquist, 2001). data files stored GitHub. Let’s load results run 1:","code":"library(\"TreeTools\") # Read and plot trees library(\"Rogue\") # Find rogue taxa if (online) { dataFolder <- \"https://raw.githubusercontent.com/ms609/hyoliths/master/MrBayes/\" run1.t <- paste0(dataFolder, \"hyo.nex.run1.t\") # Reading 10k trees takes a second or two... run1Trees <- ape::read.nexus(run1.t) if (packageVersion('ape') <= \"5.6.1\") { # Workaround for a bug in ape, hopefully fixed in v5.6.2 run1Trees <- structure(lapply(run1Trees, function(tr) { tr$tip.label <- attr(run1Trees, 'TipLabel') tr }), class = 'multiPhylo') } } else { # If no internet connection, we can generate some example trees instead run1Trees <- structure(unlist(lapply(0:21, function(backbone) { AddTipEverywhere(ape::as.phylo(0, nTip = 12), 'ROGUE') }), recursive = FALSE), class = 'multiPhylo') }"},{"path":"https://ms609.github.io/Rogue/articles/Bayesian.html","id":"select-trees-to-analyse","dir":"Articles","previous_headings":"","what":"Select trees to analyse","title":"Detecting rogue taxa in Bayesian posterior tree sets","text":"tree file contains trees generated. typically want discard proportion trees burn-: large number trees analyse. save time initial analysis thinning sample somewhat. full analysis, consider output runs analysis, perhaps ","code":"burninFrac <- 0.25 nTrees <- length(run1Trees) trees <- run1Trees[seq(from = burninFrac * nTrees, to = nTrees)] sampleSize <- 100 trees <- run1Trees[seq(from = burninFrac * nTrees, to = nTrees, length.out = sampleSize)] nRuns <- 4 allTrees <- lapply(seq_len(nRuns), function(run) { runTrees <- ape::read.nexus(paste0(dataFolder, 'hyo.nex.run', run, .'t')) runTrees <- runTrees[seq(from = burninFrac * nTrees, to = nTrees, length.out = sampleSize / nRuns)] }) trees <- structure(unlist(allTrees, recursive = FALSE), class = 'multiPhylo')"},{"path":"https://ms609.github.io/Rogue/articles/Bayesian.html","id":"initial-appraisal","dir":"Articles","previous_headings":"","what":"Initial appraisal","title":"Detecting rogue taxa in Bayesian posterior tree sets","text":"Let’s start looking majority rule consensus tree. can instructive colour leaves instability; use ad hoc approach Smith (2022). First let’s define function plot gradient legend: taxa stand less stable position tree others. removing taxa reveal enough additional information remaining taxa compensate loss information taxa plot?","code":"plenary <- Consensus(trees, p = 0.5) par(mar = rep(0, 4), cex = 0.85) plot(plenary, tip.color = ColByStability(trees)) PlotTools::SpectrumLegend( \"bottomright\", legend = c(\"Stable\", \"Unstable\"), palette = hcl.colors(131, 'inferno')[1:101] )"},{"path":"https://ms609.github.io/Rogue/articles/Bayesian.html","id":"detect-rogue-taxa","dir":"Articles","previous_headings":"","what":"Detect rogue taxa","title":"Detecting rogue taxa in Bayesian posterior tree sets","text":"options evaluate negative impact retaining rogue taxa consensus tree. QuickRogue() uses quick heuristic method Smith (2022); RogueTaxa() supports Smith’s slower heuristic, might find set rogue taxa yield slightly improvement consensus tree; can also configured employ RogueNaRok approach (Aberer, Krompass, & Stamatakis, 2013).","code":"rogues <- QuickRogue(trees) # rogues <- RogueTaxa(trees) might do a better job, much more slowly rogues ## num taxNum taxon rawImprovement IC ## 1 0 NA 435.3517 ## 2 1 49 Paterimitra 68.263028 503.6148 ## 3 2 44 Micrina 13.384875 516.9996 ## 4 3 51 Siphonobolus_priscus 5.467555 522.4672 ## 5 4 53 Ussunia 15.200668 537.6679 # The first line reports the information content of the plenary tree rogueTaxa <- rogues$taxon[-1]"},{"path":"https://ms609.github.io/Rogue/articles/Bayesian.html","id":"visualize-results","dir":"Articles","previous_headings":"","what":"Visualize results","title":"Detecting rogue taxa in Bayesian posterior tree sets","text":"Let’s see taxa influence majority rule consensus results. Removing rogues may reveal information producing reduced consensus trees higher resolution, higher split support values. can also visualize locations rogue taxa plot reduced consensus tree: rogue occurs frequently brighter locations.","code":"par(mar = rep(0, 4)) # Remove plot margin par(mfrow = c(1, 2)) # Multi-panel plot par(cex = 0.85) # Smaller labels plenary <- Consensus(trees, p = 0.5) reduced <- ConsensusWithout(trees, rogueTaxa, p = 0.5) plot(plenary, tip.color = ifelse(plenary$tip.label %in% rogueTaxa, 2, 1)) LabelSplits(plenary, SplitFrequency(plenary, trees)) plot(reduced) LabelSplits(reduced, SplitFrequency(reduced, trees)) par(mar = rep(0, 4), cex = 0.8) whichTaxon <- length(rogueTaxa) # Select an illuminating taxon positions <- RoguePlot(trees, rogueTaxa[whichTaxon], p = 0.5, legend = \"bottomleft\", legend.inset = 0.06)"},{"path":[]},{"path":"https://ms609.github.io/Rogue/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Martin R. Smith. Author, maintainer, copyright holder. Andre J. Aberer. Author, copyright holder.","code":""},{"path":"https://ms609.github.io/Rogue/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":".J. Aberer, D. Krompass, . Stamatakis (2013): Pruning Rogue Taxa Improves Phylogenetic Accuracy: Efficient Algorithm Webservice, Systematic Biology 62(1): 162-166, doi:10.1093/sysbio/sys078 M.R. Smith (2021): Rogue: Identify Rogue Taxa Sets Phylogenetic Trees, Zotero, doi:10.5281/zenodo.5037327 M.R. Smith (2022): Using information theory detect rogue taxa improve consensus trees, Systematic Biology 71(5): 986–1008, doi:10.1093/sysbio/syab099.","code":"@Article{Aberer2013, title = {Pruning rogue taxa improves phylogenetic accuracy: an efficient algorithm and webservice}, author = {Andre J. Aberer and Denis Krompass and Alexandros Stamatakis}, year = {2013}, doi = {10.1093/sysbio/sys078}, journal = {Systematic Biology}, volume = {62}, pages = {162-166}, number = {1}, } @Manual{Smith2021, title = {Rogue: Identify Rogue Taxa in Sets of Phylogenetic Trees}, author = {Martin R. Smith}, year = {2021}, doi = {10.5281/zenodo.5037327}, journal = {Zotero}, } @Article{Smith2022, title = {Using information theory to detect rogue taxa and improve consensus trees}, author = {Martin R. Smith}, year = {2022}, doi = {10.1093/sysbio/syab099}, journal = {Systematic Biology}, volume = {71}, number = {5}, pages = {986-1008}, }"},{"path":"https://ms609.github.io/Rogue/index.html","id":"rogue","dir":"","previous_headings":"","what":"Identify Rogue Taxa in Sets of Phylogenetic Trees","title":"Identify Rogue Taxa in Sets of Phylogenetic Trees","text":"“Rogue” implements approaches identify rogue taxa phylogenetic analysis. Rogues wildcard leaves whose uncertain position reduces resolution consensus trees. Consensus trees omit rogue taxa can informative. “Rogue” allows user select concept “information” quality consensus trees evaluated, heuristic approach rogue taxa identified. Rogue detection using phylogenetic clustering information content measures (Smith, 2022) implemented using quick heuristic drops least “stable” leaves one time, using ad hoc definition stability (Smith, 2022); exhaustive (time-consuming) approach considers dropping possible sets n leaves (Aberer et al. 2013). latter heuristic implemented relative bipartition “information” content Pattengale’s criterion via RogueNaRok (Aberer et al. 2013).","code":""},{"path":"https://ms609.github.io/Rogue/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Identify Rogue Taxa in Sets of Phylogenetic Trees","text":"Install load stable version CRAN normal: Alternatively, install development version GitHub (Requires git installed added PATH system environment variable; may also require “curl” R package.)","code":"install.packages(\"Rogue\") library(\"Rogue\") devtools::install_github(\"ms609/Rogue\", args = \"--recursive\")"},{"path":"https://ms609.github.io/Rogue/index.html","id":"citing-rogue","dir":"","previous_headings":"","what":"Citing ‘Rogue’","title":"Identify Rogue Taxa in Sets of Phylogenetic Trees","text":"find package useful work, please consider citing Smith (2021). cite underlying methods, please cite Aberer et al. (2013) (‘RogueNaRok’) Smith (2022), appropriate.","code":""},{"path":"https://ms609.github.io/Rogue/index.html","id":"references","dir":"","previous_headings":"","what":"References","title":"Identify Rogue Taxa in Sets of Phylogenetic Trees","text":".J. Aberer, D. Krompass, . Stamatakis (2013): Pruning rogue taxa improves phylogenetic accuracy: efficient algorithm webservice. Systematic Biology 62(1): 162-166, doi:10.1093/sysbio/sys078. M.R. Smith (2021): Rogue: Identify rogue taxa sets phylogenetic trees. Zenodo, doi:10.5281/zenodo.5037327. M.R. Smith (2022): Using information theory detect rogue taxa improve consensus trees. Systematic Biology 71(5): 986–1008, doi:10.1093/sysbio/syab099","code":""},{"path":"https://ms609.github.io/Rogue/reference/GraphGeodesic.html","id":null,"dir":"Reference","previous_headings":"","what":"Graph Geodesic between leaves of unweighted tree — GraphGeodesic","title":"Graph Geodesic between leaves of unweighted tree — GraphGeodesic","text":"Graph Geodesic leaves unweighted tree","code":""},{"path":"https://ms609.github.io/Rogue/reference/GraphGeodesic.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Graph Geodesic between leaves of unweighted tree — GraphGeodesic","text":"","code":"GraphGeodesic(x, nTip = length(x$tip.label), log = FALSE, asMatrix = TRUE) Cophenetic(x, nTip = length(x$tip.label), log = FALSE, asMatrix = TRUE)"},{"path":"https://ms609.github.io/Rogue/reference/GraphGeodesic.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Graph Geodesic between leaves of unweighted tree — GraphGeodesic","text":"x Object class phylo. nTip Integer specifying number leaves. asMatrix Logical specifying whether coerce output matrix format.","code":""},{"path":"https://ms609.github.io/Rogue/reference/GraphGeodesic.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Graph Geodesic between leaves of unweighted tree — GraphGeodesic","text":"GraphGeodesic() returns unnamed integer matrix describing number edges pair edges.","code":""},{"path":"https://ms609.github.io/Rogue/reference/GraphGeodesic.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Graph Geodesic between leaves of unweighted tree — GraphGeodesic","text":"Martin R. Smith, modifying algorithm Emmanuel Paradis ape::dist.nodes().","code":""},{"path":"https://ms609.github.io/Rogue/reference/GraphGeodesic.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Graph Geodesic between leaves of unweighted tree — GraphGeodesic","text":"","code":"GraphGeodesic(TreeTools::BalancedTree(5)) #> [,1] [,2] [,3] [,4] [,5] #> [1,] 0 2 3 5 5 #> [2,] 2 0 3 5 5 #> [3,] 3 3 0 4 4 #> [4,] 5 5 4 0 2 #> [5,] 5 5 4 2 0"},{"path":"https://ms609.github.io/Rogue/reference/Rogue-package.html","id":null,"dir":"Reference","previous_headings":"","what":"Rogue — Rogue-package","title":"Rogue — Rogue-package","text":"\"Rogue\" implements approaches identify rogue taxa phylogenetic analysis. Rogues wildcard leaves whose uncertain position, perhaps result missing conflicting data, reduces resolution consensus trees (Kearney 2002) . Consensus trees omit rogue taxa can informative.","code":""},{"path":"https://ms609.github.io/Rogue/reference/Rogue-package.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Rogue — Rogue-package","text":"\"Rogue\" allows user select concept \"information\" quality consensus trees evaluated, heuristic approach rogue taxa identified. Rogue detection using phylogenetic clustering information content measures (SPIC, SCIC) (Smith 2022) implemented using quick heuristic drops least \"stable\" leaves one time, using ad hoc definition stability (Smith 2022) ; exhaustive (time-consuming) approach considers dropping possible sets n leaves (Aberer et al. 2013) . latter heuristic implemented relative bipartition \"information\" content Pattengale's criterion via RogueNaRok (Aberer et al. 2013) .","code":""},{"path":"https://ms609.github.io/Rogue/reference/Rogue-package.html","id":"citing-rogue-","dir":"Reference","previous_headings":"","what":"Citing \"Rogue\"","title":"Rogue — Rogue-package","text":"find package useful work, Please consider citing Smith (2021). cite underlying methods, please cite Aberer et al. (2013) (\"RogueNaRok\") Smith (2022) (SPIC, SCIC), appropriate.","code":""},{"path":"https://ms609.github.io/Rogue/reference/Rogue-package.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Rogue — Rogue-package","text":"Aberer AJ, Krompass D, Stamatakis (2013). “Pruning rogue taxa improves phylogenetic accuracy: efficient algorithm webservice.” Systematic Biology, 62(1), 162--166. doi:10.1093/sysbio/sys078 . Kearney M (2002). “Fragmentary taxa, missing data, ambiguity: mistaken assumptions conclusions.” Systematic Biology, 51(2), 369--381. doi:10.1080/10635150252899824 . Smith MR (2022). “Using information theory detect rogue taxa improve consensus trees.” Systematic Biology, 71(5), 986--1008. doi:10.1093/sysbio/syab099 .","code":""},{"path":[]},{"path":"https://ms609.github.io/Rogue/reference/Rogue-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Rogue — Rogue-package","text":"Maintainer: Martin R. Smith martin.smith@durham.ac.uk (ORCID) [copyright holder] Authors: Andre J. Aberer andre.aberer@googlemail.com [copyright holder]","code":""},{"path":"https://ms609.github.io/Rogue/reference/RogueTaxa.html","id":null,"dir":"Reference","previous_headings":"","what":"Drop rogue taxa to generate a more informative consensus — RogueTaxa","title":"Drop rogue taxa to generate a more informative consensus — RogueTaxa","text":"RogueTaxa() finds wildcard leaves whose removal increases resolution branch support values consensus tree, using relative bipartition, shared phylogenetic, mutual clustering concepts information.","code":""},{"path":"https://ms609.github.io/Rogue/reference/RogueTaxa.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Drop rogue taxa to generate a more informative consensus — RogueTaxa","text":"","code":"RogueTaxa( trees, info = c(\"spic\", \"scic\", \"fspic\", \"fscic\", \"rbic\"), return = c(\"taxa\", \"tree\"), bestTree = NULL, computeSupport = TRUE, dropsetSize = 1, neverDrop = character(0), labelPenalty = 0, mreOptimization = FALSE, threshold = 50, verbose = FALSE ) QuickRogue( trees, info = \"phylogenetic\", p = 0.5, log = TRUE, average = \"median\", deviation = \"mad\", neverDrop, fullSeq = FALSE, parallel = FALSE ) C_RogueNaRok( bootTrees = \"\", runId = \"tmp\", treeFile = \"\", computeSupport = TRUE, dropsetSize = 1, excludeFile = \"\", workDir = \"\", labelPenalty = 0, mreOptimization = FALSE, threshold = 50 )"},{"path":"https://ms609.github.io/Rogue/reference/RogueTaxa.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Drop rogue taxa to generate a more informative consensus — RogueTaxa","text":"trees List trees analyse. info Concept information employ; see details. return taxa, returns leaves identified rogues; tree, return consensus tree omitting rogue taxa. computeSupport Logical: FALSE, instead trying maximize support consensus tree, RogueNaRok try maximize number bipartitions final tree pruning taxa. dropsetSize Integer specifying maximum size dropset per iteration. dropsetSize == n, RogueNaRok test iteration tuple n taxa increases optimality criterion , pruning taxa accordingly. improves result, run times increase least linearly. neverDrop Tip labels dropped consensus. labelPenalty weight factor penalize dropset size info = \"rbic\". higher value, conservative algorithm pruning taxa. default value 0 gives RBIC; 1 gives Pattengale's criterion. threshold, mreOptimization threshold mode consensus tree optimized. Specify value 50 (majority rule consensus, default) 100 (strict consensus), set mreOptimization = TRUE extended majority rule consensus. Note rogue taxa identified respect different thresholds can vary substantially. verbose Logical specifying whether display output RogueNaRok. FALSE, output included attribute return value. p Proportion trees must contain split included consensus consideration. 0.5, default, corresponds majority rule tree; 1.0 maximize information content strict consensus. log Logical specifying whether log-transform distances calculating leaf stability. average Character specifying whether use \"mean\" \"median\" tip distances calculate leaf stability. deviation Character specifying whether use \"sd\" \"mad\" calculate leaf stability. fullSeq Logical specifying whether list taxa (TRUE), improve information content dropped (FALSE). parallel Logical specifying whether parallel execution take place C++. bootTrees Path file containing collection bootstrap trees. runId identifier run, appended output files. treeFile, bestTree single best-known tree (ML MP tree) provided, RogueNaRok optimizes bootstrap support best-known tree (still drawn bootstrap trees); threshold parameter ignored. excludeFile Taxa file (one taxon per line) considered pruning. workDir Path working directory output files created.","code":""},{"path":"https://ms609.github.io/Rogue/reference/RogueTaxa.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Drop rogue taxa to generate a more informative consensus — RogueTaxa","text":"RogueTaxa() returns data.frame. row first, describes starting tree, describes dropset operation. Columns describe: num: Sequential index drop operation taxNum: Numeric identifier dropped leaves taxon: Text identifier dropped leaves rawImprovement: Improvement score obtained operation IC: Information content tree dropping leaves far, measure indicated info. C_RogueNaRok() returns 0 successful; -1 error.","code":""},{"path":"https://ms609.github.io/Rogue/reference/RogueTaxa.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Drop rogue taxa to generate a more informative consensus — RogueTaxa","text":"\"Rogue\" (loosely) \"wildcard\" taxa (Nixon Wheeler 1992) leaves whose position tree poorly constrained, typically much phylogenetic data associated taxon either missing conflict data (Kearney 2002) . functions use heuristic methods identify rogue taxa whose removal improves information content consensus tree, definitions information discussed .","code":""},{"path":"https://ms609.github.io/Rogue/reference/RogueTaxa.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Drop rogue taxa to generate a more informative consensus — RogueTaxa","text":"QuickRogue(): Shortcut \"fast\" heuristic, option return evaluation taxa using fullSeq = TRUE.","code":""},{"path":"https://ms609.github.io/Rogue/reference/RogueTaxa.html","id":"information-criteria","dir":"Reference","previous_headings":"","what":"Information criteria","title":"Drop rogue taxa to generate a more informative consensus — RogueTaxa","text":"splitwise phylogenetic information content measure produces best results (Smith 2022) . uses splitwise information content shortcut, involves double counting information (may may desirable). holds mutual clustering information measure; measure less obviously suited detection rogues. measure interprets split frequency proxy probability split true, valid interpretation Bayesian posterior sample (Holder et al. 2008) , reasonable imperfect interpretation bootstrap sample (Berry Gascuel 1996) , bad interpretation sample parsimonious trees. \"relative bipartition information criterion\" (RBIC) sum support values divided maximum possible support fully bifurcating tree initial set taxa. relative bipartition information content approach employs 'RogueNaRok' implementation (Aberer et al. 2013) , can handle large trees relatively quickly. RBIC strictly measure information can produce undesirable results (Wilkinson Crotti 2017) . C_RogueNaRok() directly interfaces 'RogueNaRok' C implementation, input checking; aware invalid input cause undefined behaviour likely crash R.","code":""},{"path":"https://ms609.github.io/Rogue/reference/RogueTaxa.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Drop rogue taxa to generate a more informative consensus — RogueTaxa","text":"Aberer AJ, Krompass D, Stamatakis (2013). “Pruning rogue taxa improves phylogenetic accuracy: efficient algorithm webservice.” Systematic Biology, 62(1), 162--166. doi:10.1093/sysbio/sys078 . Berry V, Gascuel O (1996). “interpretation bootstrap trees: appropriate threshold clade selection induced gain.” Molecular Biology Evolution, 13(7), 999--1011. doi:10.1093/molbev/13.7.999 . Holder MT, Sukumaran J, Lewis PO (2008). “justification reporting majority-rule consensus tree Bayesian phylogenetics.” Systematic Biology, 57(5), 814--821. doi:10.1080/10635150802422308 . Kearney M (2002). “Fragmentary taxa, missing data, ambiguity: mistaken assumptions conclusions.” Systematic Biology, 51(2), 369--381. doi:10.1080/10635150252899824 . Nixon KC, Wheeler QD (1992). “Extinction origin species.” Novacek MJ, Wheeler QD (eds.), Extinction phylogeny, chapter Extinction origin species, 119-143. Columbia University Press, New York. Smith MR (2022). “Using information theory detect rogue taxa improve consensus trees.” Systematic Biology, 71(5), 986--1008. doi:10.1093/sysbio/syab099 . Wilkinson M, Crotti M (2017). “Comments detecting rogue taxa using RogueNaRok.” Systematics Biodiversity, 15(4), 291--295. doi:10.1080/14772000.2016.1252440 .","code":""},{"path":"https://ms609.github.io/Rogue/reference/RogueTaxa.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Drop rogue taxa to generate a more informative consensus — RogueTaxa","text":"Martin R. Smith (martin.smith@durham.ac.uk), linking RogueNaRok C library Andre Aberer ()","code":""},{"path":"https://ms609.github.io/Rogue/reference/RogueTaxa.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Drop rogue taxa to generate a more informative consensus — RogueTaxa","text":"","code":"library(\"TreeTools\", warn.conflicts = FALSE) #> Loading required package: ape trees <- list(read.tree(text = (\"(a, (b, (c, (d, (e, (X1, X2))))));\")), read.tree(text = (\"((a, (X1, X2)), (b, (c, (d, e))));\"))) RogueTaxa(trees, dropsetSize = 2) #> ✔ 2023-11-29 10:05:42.718608: Dropped 2 leaves, rendering 4.64386 bits. #> num taxNum taxon rawImprovement IC #> 1 0 NA 3.169925 #> 2 1 6,7 X1,X2 1.473931 4.643856 trees <- list( read.tree(text = \"((a, y), (b, (c, (z, ((d, e), (f, (g, x)))))));\"), read.tree(text = \"(a, (b, (c, (z, (((d, y), e), (f, (g, x)))))));\"), read.tree(text = \"(a, (b, ((c, z), ((d, (e, y)), ((f, x), g)))));\"), read.tree(text = \"(a, (b, ((c, z), ((d, (e, x)), (f, (g, y))))));\"), read.tree(text = \"(a, ((b, x), ((c, z), ((d, e), (f, (g, y))))));\") ) cons <- consensus(trees, p = 0.5) plot(cons) LabelSplits(cons, SplitFrequency(cons, trees) / length(trees)) reduced <- RogueTaxa(trees, info = \"phylogenetic\", ret = \"tree\") #> ✔ 2023-11-29 10:05:42.824518: Dropped 2 leaves, rendering 17.0678 bits. plot(reduced) LabelSplits(reduced, SplitFrequency(reduced, trees) / length(trees)) QuickRogue(trees, fullSeq = TRUE) #> num taxNum taxon rawImprovement IC #> 1 0 NA 8.806435 #> 2 1 2 y 3.818116 12.624552 #> 3 2 10 x 4.443274 17.067826 #> 4 3 1 a -17.067826 0.000000 #> 5 4 3 b 0.000000 0.000000 #> 6 5 4 c 0.000000 0.000000 #> 7 6 5 z 0.000000 0.000000 #> 8 7 6 d 0.000000 0.000000 #> 9 8 7 e 0.000000 0.000000 #> 10 9 8 f 0.000000 0.000000 #> 11 10 9 g 0.000000 0.000000 bootTrees <- system.file(\"example/150.bs\", package = \"Rogue\") tmpDir <- tempdir() XX <- capture.output( # Don't print verbose run details to console C_RogueNaRok(bootTrees, workDir = tmpDir) ) # Results have been written to our temporary directory oldwd <- setwd(tmpDir) head(read.table(\"RogueNaRok_droppedRogues.tmp\", header = TRUE)) #> num taxNum taxon rawImprovement RBIC #> 1 0 NA 0.000 0.570381 #> 2 1 9 Species172 1.238 0.578803 #> 3 2 89 Species099 0.801 0.584252 #> 4 3 16 Species028 0.712 0.589095 #> 5 4 43 Species077 0.592 0.593122 #> 6 5 148 Species137 0.539 0.596789 # Delete temporary files file.remove(\"RogueNaRok_droppedRogues.tmp\") #> [1] TRUE file.remove(\"RogueNaRok_info.tmp\") #> [1] TRUE setwd(oldwd)"},{"path":"https://ms609.github.io/Rogue/reference/TipInstability.html","id":null,"dir":"Reference","previous_headings":"","what":"Tip instability — TipInstability","title":"Tip instability — TipInstability","text":"TipInstability() calculates instability leaf tree. Unstable leaves likely display roguish behaviour.","code":""},{"path":"https://ms609.github.io/Rogue/reference/TipInstability.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Tip instability — TipInstability","text":"","code":"TipInstability( trees, log = TRUE, average = \"mean\", deviation = \"sd\", checkTips = TRUE, parallel = FALSE ) ColByStability( trees, log = TRUE, average = \"mean\", deviation = \"sd\", pal = hcl.colors(131, \"inferno\")[1:101] )"},{"path":"https://ms609.github.io/Rogue/reference/TipInstability.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Tip instability — TipInstability","text":"trees List trees analyse. log Logical specifying whether log-transform distances calculating leaf stability. average Character specifying whether use \"mean\" \"median\" tip distances calculate leaf stability. deviation Character specifying whether use \"sd\" \"mad\" calculate leaf stability. checkTips Logical specifying whether check tips numbered consistently. parallel Logical specifying whether parallel execution take place C++. pal vector listing sequence colours used plotting. earliest entries assigned stable tips.","code":""},{"path":"https://ms609.github.io/Rogue/reference/TipInstability.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Tip instability — TipInstability","text":"ColByStability() returns named character vector assigns colour leaf trees according stability.","code":""},{"path":"https://ms609.github.io/Rogue/reference/TipInstability.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Tip instability — TipInstability","text":"Smith (2022) defines instability pair leaves median absolute divergence graph geodesic (number edges shortest path leaves) across trees, normalized mean graph geodesic. instability single leaf mean instability pairs include leaf; higher values characterise leaves whose position variable trees. concepts leaf instability include \"taxonomic instability index\", implemented Mesquite: described Thomson Shaffer (2010) \\(\\sum\\limits_{(x, y), j \\neq }{\\frac{|D~ijx~ - D~ijy~|}{(D~ijx~ - D~ijy~)^2}}\\), \\(D~ijx~\\) patristic distance (.e. length edges) leaves \\(\\) \\(j\\) tree \\(x\\). average stability triplets (.e. quartets including root) include leaf (Thorley Wilkinson 1999) , implemented \"Phyutility\" (Smith Dunn 2008) ; related \"positional congruence\" measures (Estabrook 1992; Pol Escapa 2009) .","code":""},{"path":"https://ms609.github.io/Rogue/reference/TipInstability.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Tip instability — TipInstability","text":"Estabrook GF (1992). “Evaluating undirected positional congruence individual taxa two estimates phylogenetic tree group taxa.” Systematic Biology, 41(2), 172--177. doi:10.1093/sysbio/41.2.172 . Pol D, Escapa IH (2009). “Unstable taxa cladistic analysis: identification assessment relevant characters.” Cladistics, 25(5), 515--527. doi:10.1111/j.1096-0031.2009.00258.x . Smith MR (2022). “Using information theory detect rogue taxa improve consensus trees.” Systematic Biology, 71(5), 986--1008. doi:10.1093/sysbio/syab099 . Smith SA, Dunn CW (2008). “Phyutility: phyloinformatics tool trees, alignments molecular data.” Bioinformatics, 24(5), 715--716. doi:10.1093/bioinformatics/btm619 . Thomson RC, Shaffer HB (2010). “Sparse supermatrices phylogenetic inference: taxonomy, alignment, rogue taxa, phylogeny living turtles.” Systematic Biology, 59(1), 42--58. doi:10.1093/sysbio/syp075 . Thorley JL, Wilkinson M (1999). “Testing phylogenetic stability early tetrapods.” Journal Theoretical Biology, 200(3), 343--344. doi:10.1006/jtbi.1999.0999 .","code":""},{"path":[]},{"path":"https://ms609.github.io/Rogue/reference/TipInstability.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Tip instability — TipInstability","text":"Martin R. Smith (martin.smith@durham.ac.uk)","code":""},{"path":"https://ms609.github.io/Rogue/reference/TipInstability.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Tip instability — TipInstability","text":"","code":"library(\"TreeTools\", quietly = TRUE) # Generate some trees with a rogue taxon trees <- AddTipEverywhere(BalancedTree(8), \"Rogue\")[3:6] # Display the strict consensus plot(consensus(trees), tip.col = ColByStability(trees)) # Add a legend for the colour scale used PlotTools::SpectrumLegend( \"bottomleft\", bty = \"n\", # No box legend = c(\"Unstable\", \"\", \"Stable\"), palette = hcl.colors(131, \"inferno\")[1:101] ) # Calculate leaf stability instab <- TipInstability(trees, log = FALSE, ave = \"mean\", dev = \"mad\") # Plot a consensus that omits the least stable leaves plot(ConsensusWithout(trees, names(instab[instab > 0.2])))"},{"path":"https://ms609.github.io/Rogue/reference/TipVolatility.html","id":null,"dir":"Reference","previous_headings":"","what":"Detect rogue taxa using phylogenetic information distance — TipVolatility","title":"Detect rogue taxa using phylogenetic information distance — TipVolatility","text":"Calculate volatility tip: namely, impact mean phylogenetic information distance (Smith 2020) trees tip removed. Effective number trees small.","code":""},{"path":"https://ms609.github.io/Rogue/reference/TipVolatility.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Detect rogue taxa using phylogenetic information distance — TipVolatility","text":"","code":"TipVolatility(trees)"},{"path":"https://ms609.github.io/Rogue/reference/TipVolatility.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Detect rogue taxa using phylogenetic information distance — TipVolatility","text":"trees List trees analyse.","code":""},{"path":"https://ms609.github.io/Rogue/reference/TipVolatility.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Detect rogue taxa using phylogenetic information distance — TipVolatility","text":"TipVolatility() returns named vector listing volatility index calculated leaf.","code":""},{"path":"https://ms609.github.io/Rogue/reference/TipVolatility.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Detect rogue taxa using phylogenetic information distance — TipVolatility","text":"Smith MR (2020). “Information theoretic Generalized Robinson--Foulds metrics comparing phylogenetic trees.” Bioinformatics, 36(20), 5007--5013. doi:10.1093/bioinformatics/btaa614 .","code":""},{"path":[]},{"path":"https://ms609.github.io/Rogue/reference/TipVolatility.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Detect rogue taxa using phylogenetic information distance — TipVolatility","text":"","code":"library(\"TreeTools\", quietly = TRUE) # Generate some trees with two rogue taxa trees <- AddTipEverywhere(BalancedTree(8), \"Rogue\") trees[] <- lapply(trees, AddTip, \"Rogue\", \"Rogue2\") # Calculate tip volatility sb <- TipVolatility(trees) # Use volatility to colour leaves in consensus tree sbNorm <- 1 + (99 * (sb - min(sb)) / (max(sb - min(sb)))) col <- hcl.colors(128, \"inferno\")[sbNorm] plot(consensus(trees), tip.color = col) # Add a legend for the colour scale used PlotTools::SpectrumLegend( \"bottomleft\", bty = \"n\", # Suppress box inset = -0.02, # Avoid overlap title = \"Volatility\", legend = signif(seq(max(sb), min(sb), length.out = 4), 3), palette = hcl.colors(128, \"inferno\") ) # Plot consensus after removing highly volatile taxa plot(ConsensusWithout(trees, names(sb[sb == max(sb)])))"},{"path":"https://ms609.github.io/Rogue/news/index.html","id":"rogue-v216","dir":"Changelog","previous_headings":"","what":"Rogue v2.1.6","title":"Rogue v2.1.6","text":"Legend annotations documentation. Disable parallel evaluation default TipInstability(), adding parallel parameter allow user override. Use format string REprintf().","code":""},{"path":"https://ms609.github.io/Rogue/news/index.html","id":"rogue-v215","dir":"Changelog","previous_headings":"","what":"Rogue v2.1.5","title":"Rogue v2.1.5","text":"CRAN release: 2023-03-20 Call C functions using symbols, strings.","code":""},{"path":"https://ms609.github.io/Rogue/news/index.html","id":"rogue-v214","dir":"Changelog","previous_headings":"","what":"Rogue v2.1.4","title":"Rogue v2.1.4","text":"CRAN release: 2023-01-16 C2X compliant function prototypes. Remove unused sprintf() calls.","code":""},{"path":"https://ms609.github.io/Rogue/news/index.html","id":"rogue-v213","dir":"Changelog","previous_headings":"","what":"Rogue v2.1.3","title":"Rogue v2.1.3","text":"CRAN release: 2022-09-26 ColByStability() gains pal argument allow specification custom palettes.","code":""},{"path":"https://ms609.github.io/Rogue/news/index.html","id":"rogue-v212","dir":"Changelog","previous_headings":"","what":"Rogue v2.1.2","title":"Rogue v2.1.2","text":"CRAN release: 2022-08-16 Faster rogue detection edge lengths provided, per report Joe Keating. Don’t list neverDrop QuickRogue(fullSeq = TRUE).","code":""},{"path":"https://ms609.github.io/Rogue/news/index.html","id":"rogue-v211","dir":"Changelog","previous_headings":"","what":"Rogue v2.1.1","title":"Rogue v2.1.1","text":"CRAN release: 2022-07-20 Handle ColByStability(trees = NULL).","code":""},{"path":"https://ms609.github.io/Rogue/news/index.html","id":"rogue-v210","dir":"Changelog","previous_headings":"","what":"Rogue v2.1.0","title":"Rogue v2.1.0","text":"CRAN release: 2022-01-13 Early termination QuickRogue() improvement possible. Cophenetic() renamed accurate GraphGeodesic(). Calculate information content consensus trees p > 0.5 (#15). Improve support multiPhylo objects. New vignette detailing rogue detection Bayesian tree samples.","code":""},{"path":"https://ms609.github.io/Rogue/news/index.html","id":"rogue-v200","dir":"Changelog","previous_headings":"","what":"Rogue v2.0.0","title":"Rogue v2.0.0","text":"CRAN release: 2021-09-13 Information theoretic rogue detection (per Smith, 2022).","code":""},{"path":"https://ms609.github.io/Rogue/news/index.html","id":"rogue-v100","dir":"Changelog","previous_headings":"","what":"Rogue v1.0.0","title":"Rogue v1.0.0","text":"CRAN release: 2021-07-01 R interface RogueNaRok.","code":""}] +[{"path":"https://ms609.github.io/Rogue/CODE_OF_CONDUCT.html","id":null,"dir":"","previous_headings":"","what":"Contributor Code of Conduct","title":"Contributor Code of Conduct","text":"contributors maintainers project, pledge respect people contribute reporting issues, posting feature requests, updating documentation, submitting pull requests patches, activities. committed making participation project harassment-free experience everyone, regardless level experience, gender, gender identity expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion. Examples unacceptable behavior participants include use sexual language imagery, derogatory comments personal attacks, trolling, public private harassment, insults, unprofessional conduct. Project maintainers right responsibility remove, edit, reject comments, commits, code, wiki edits, issues, contributions aligned Code Conduct. Project maintainers follow Code Conduct may removed project team. Instances abusive, harassing, otherwise unacceptable behavior may reported opening issue contacting one project maintainers. Code Conduct adapted Contributor Covenant (https://www.contributor-covenant.org), version 1.0.0, available https://contributor-covenant.org/version/1/0/0/.","code":""},{"path":[]},{"path":"https://ms609.github.io/Rogue/CONTRIBUTING.html","id":"fixing-typos","dir":"","previous_headings":"","what":"Fixing typos","title":"CONTRIBUTING","text":"Small typos grammatical errors documentation may edited directly using GitHub web interface, long changes made source file. : edit roxygen comment .R file R/. DON’T: edit .Rd file man/.","code":""},{"path":"https://ms609.github.io/Rogue/CONTRIBUTING.html","id":"prerequisites","dir":"","previous_headings":"","what":"Prerequisites","title":"CONTRIBUTING","text":"make substantial pull request, always file issue make sure someone team agrees ’s problem. ’ve found bug, create associated issue illustrate bug minimal reprex.","code":""},{"path":"https://ms609.github.io/Rogue/CONTRIBUTING.html","id":"pull-request-process","dir":"","previous_headings":"","what":"Pull request process","title":"CONTRIBUTING","text":"recommend create Git branch pull request (PR). Look GitHub actions CodeCovr build status making changes. follow Google’s R style guide use camelCase variable names, TitleCase function names. use Oxford ending ‘ize’ (‘ise’), UK spelling (e.g. ‘colour’) possible avoid distinction (e.g. shortening ‘col’) use roxygen2 build documentation. use testthat. Contributions test cases included easier accept. user-facing changes, add bullet top NEWS.md current development version header describing changes made followed GitHub username, links relevant issue(s)/PR(s).","code":""},{"path":"https://ms609.github.io/Rogue/CONTRIBUTING.html","id":"code-of-conduct","dir":"","previous_headings":"","what":"Code of Conduct","title":"CONTRIBUTING","text":"Please note project released Contributor Code Conduct. contributing project agree abide terms.","code":""},{"path":"https://ms609.github.io/Rogue/CONTRIBUTING.html","id":"prefer-to-e-mail","dir":"","previous_headings":"","what":"Prefer to e-mail?","title":"CONTRIBUTING","text":"E-mail person listed maintainer DESCRIPTION file repo. Private discussions email don’t help others - course email totally warranted sensitive problems.","code":""},{"path":"https://ms609.github.io/Rogue/CONTRIBUTING.html","id":"thanks-for-contributing","dir":"","previous_headings":"","what":"Thanks for contributing!","title":"CONTRIBUTING","text":"document adapted tidyverse contributing guide.","code":""},{"path":"https://ms609.github.io/Rogue/articles/Bayesian.html","id":"set-up","dir":"Articles","previous_headings":"","what":"Set up","title":"Detecting rogue taxa in Bayesian posterior tree sets","text":"Let’s start loading packages ’ll need: ’ll work example data generated morphological analysis early brachiopods (Sun et al., 2018) using MrBayes (Hulsenbeck & Ronquist, 2001). data files stored GitHub. Let’s load results run 1:","code":"library(\"TreeTools\") # Read and plot trees library(\"Rogue\") # Find rogue taxa if (online) { dataFolder <- \"https://raw.githubusercontent.com/ms609/hyoliths/master/MrBayes/\" run1.t <- paste0(dataFolder, \"hyo.nex.run1.t\") # Reading 10k trees takes a second or two... run1Trees <- ape::read.nexus(run1.t) if (packageVersion('ape') <= \"5.6.1\") { # Workaround for a bug in ape, hopefully fixed in v5.6.2 run1Trees <- structure(lapply(run1Trees, function(tr) { tr$tip.label <- attr(run1Trees, 'TipLabel') tr }), class = 'multiPhylo') } } else { # If no internet connection, we can generate some example trees instead run1Trees <- structure(unlist(lapply(0:21, function(backbone) { AddTipEverywhere(ape::as.phylo(0, nTip = 12), 'ROGUE') }), recursive = FALSE), class = 'multiPhylo') }"},{"path":"https://ms609.github.io/Rogue/articles/Bayesian.html","id":"select-trees-to-analyse","dir":"Articles","previous_headings":"","what":"Select trees to analyse","title":"Detecting rogue taxa in Bayesian posterior tree sets","text":"tree file contains trees generated. typically want discard proportion trees burn-: large number trees analyse. save time initial analysis thinning sample somewhat. full analysis, consider output runs analysis, perhaps ","code":"burninFrac <- 0.25 nTrees <- length(run1Trees) trees <- run1Trees[seq(from = burninFrac * nTrees, to = nTrees)] sampleSize <- 100 trees <- run1Trees[seq(from = burninFrac * nTrees, to = nTrees, length.out = sampleSize)] nRuns <- 4 allTrees <- lapply(seq_len(nRuns), function(run) { runTrees <- ape::read.nexus(paste0(dataFolder, 'hyo.nex.run', run, .'t')) runTrees <- runTrees[seq(from = burninFrac * nTrees, to = nTrees, length.out = sampleSize / nRuns)] }) trees <- structure(unlist(allTrees, recursive = FALSE), class = 'multiPhylo')"},{"path":"https://ms609.github.io/Rogue/articles/Bayesian.html","id":"initial-appraisal","dir":"Articles","previous_headings":"","what":"Initial appraisal","title":"Detecting rogue taxa in Bayesian posterior tree sets","text":"Let’s start looking majority rule consensus tree. can instructive colour leaves instability; use ad hoc approach Smith (2022). First let’s define function plot gradient legend: taxa stand less stable position tree others. removing taxa reveal enough additional information remaining taxa compensate loss information taxa plot?","code":"plenary <- Consensus(trees, p = 0.5) par(mar = rep(0, 4), cex = 0.85) plot(plenary, tip.color = ColByStability(trees)) PlotTools::SpectrumLegend( \"bottomright\", legend = c(\"Stable\", \"Unstable\"), palette = hcl.colors(131, 'inferno')[1:101] )"},{"path":"https://ms609.github.io/Rogue/articles/Bayesian.html","id":"detect-rogue-taxa","dir":"Articles","previous_headings":"","what":"Detect rogue taxa","title":"Detecting rogue taxa in Bayesian posterior tree sets","text":"options evaluate negative impact retaining rogue taxa consensus tree. QuickRogue() uses quick heuristic method Smith (2022); RogueTaxa() supports Smith’s slower heuristic, might find set rogue taxa yield slightly improvement consensus tree; can also configured employ RogueNaRok approach (Aberer, Krompass, & Stamatakis, 2013).","code":"rogues <- QuickRogue(trees) # rogues <- RogueTaxa(trees) might do a better job, much more slowly rogues ## num taxNum taxon rawImprovement IC ## 1 0 NA 435.3517 ## 2 1 49 Paterimitra 68.263028 503.6148 ## 3 2 44 Micrina 13.384875 516.9996 ## 4 3 51 Siphonobolus_priscus 5.467555 522.4672 ## 5 4 53 Ussunia 15.200668 537.6679 # The first line reports the information content of the plenary tree rogueTaxa <- rogues$taxon[-1]"},{"path":"https://ms609.github.io/Rogue/articles/Bayesian.html","id":"visualize-results","dir":"Articles","previous_headings":"","what":"Visualize results","title":"Detecting rogue taxa in Bayesian posterior tree sets","text":"Let’s see taxa influence majority rule consensus results. Removing rogues may reveal information producing reduced consensus trees higher resolution, higher split support values. can also visualize locations rogue taxa plot reduced consensus tree: rogue occurs frequently brighter locations.","code":"par(mar = rep(0, 4)) # Remove plot margin par(mfrow = c(1, 2)) # Multi-panel plot par(cex = 0.85) # Smaller labels plenary <- Consensus(trees, p = 0.5) reduced <- ConsensusWithout(trees, rogueTaxa, p = 0.5) plot(plenary, tip.color = ifelse(plenary$tip.label %in% rogueTaxa, 2, 1)) LabelSplits(plenary, SplitFrequency(plenary, trees)) plot(reduced) LabelSplits(reduced, SplitFrequency(reduced, trees)) par(mar = rep(0, 4), cex = 0.8) whichTaxon <- length(rogueTaxa) # Select an illuminating taxon positions <- RoguePlot(trees, rogueTaxa[whichTaxon], p = 0.5, legend = \"bottomleft\", legend.inset = 0.06)"},{"path":[]},{"path":"https://ms609.github.io/Rogue/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Martin R. Smith. Author, maintainer, copyright holder. Andre J. Aberer. Author, copyright holder.","code":""},{"path":"https://ms609.github.io/Rogue/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":".J. Aberer, D. Krompass, . Stamatakis (2013): Pruning Rogue Taxa Improves Phylogenetic Accuracy: Efficient Algorithm Webservice, Systematic Biology 62(1): 162-166, doi:10.1093/sysbio/sys078 M.R. Smith (2021): Rogue: Identify Rogue Taxa Sets Phylogenetic Trees, Zotero, doi:10.5281/zenodo.5037327 M.R. Smith (2022): Using information theory detect rogue taxa improve consensus trees, Systematic Biology 71(5): 986–1008, doi:10.1093/sysbio/syab099.","code":"@Article{Aberer2013, title = {Pruning rogue taxa improves phylogenetic accuracy: an efficient algorithm and webservice}, author = {Andre J. Aberer and Denis Krompass and Alexandros Stamatakis}, year = {2013}, doi = {10.1093/sysbio/sys078}, journal = {Systematic Biology}, volume = {62}, pages = {162-166}, number = {1}, } @Manual{Smith2021, title = {Rogue: Identify Rogue Taxa in Sets of Phylogenetic Trees}, author = {Martin R. Smith}, year = {2021}, doi = {10.5281/zenodo.5037327}, journal = {Zotero}, } @Article{Smith2022, title = {Using information theory to detect rogue taxa and improve consensus trees}, author = {Martin R. Smith}, year = {2022}, doi = {10.1093/sysbio/syab099}, journal = {Systematic Biology}, volume = {71}, number = {5}, pages = {986-1008}, }"},{"path":"https://ms609.github.io/Rogue/index.html","id":"rogue","dir":"","previous_headings":"","what":"Identify Rogue Taxa in Sets of Phylogenetic Trees","title":"Identify Rogue Taxa in Sets of Phylogenetic Trees","text":"“Rogue” implements approaches identify rogue taxa phylogenetic analysis. Rogues wildcard leaves whose uncertain position reduces resolution consensus trees. Consensus trees omit rogue taxa can informative. “Rogue” allows user select concept “information” quality consensus trees evaluated, heuristic approach rogue taxa identified. Rogue detection using phylogenetic clustering information content measures (Smith, 2022) implemented using quick heuristic drops least “stable” leaves one time, using ad hoc definition stability (Smith, 2022); exhaustive (time-consuming) approach considers dropping possible sets n leaves (Aberer et al. 2013). latter heuristic implemented relative bipartition “information” content Pattengale’s criterion via RogueNaRok (Aberer et al. 2013).","code":""},{"path":"https://ms609.github.io/Rogue/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Identify Rogue Taxa in Sets of Phylogenetic Trees","text":"Install load stable version CRAN normal: Alternatively, install development version GitHub (Requires git installed added PATH system environment variable; may also require “curl” R package.)","code":"install.packages(\"Rogue\") library(\"Rogue\") devtools::install_github(\"ms609/Rogue\", args = \"--recursive\")"},{"path":"https://ms609.github.io/Rogue/index.html","id":"citing-rogue","dir":"","previous_headings":"","what":"Citing ‘Rogue’","title":"Identify Rogue Taxa in Sets of Phylogenetic Trees","text":"find package useful work, please consider citing Smith (2021). cite underlying methods, please cite Aberer et al. (2013) (‘RogueNaRok’) Smith (2022), appropriate.","code":""},{"path":"https://ms609.github.io/Rogue/index.html","id":"references","dir":"","previous_headings":"","what":"References","title":"Identify Rogue Taxa in Sets of Phylogenetic Trees","text":".J. Aberer, D. Krompass, . Stamatakis (2013): Pruning rogue taxa improves phylogenetic accuracy: efficient algorithm webservice. Systematic Biology 62(1): 162-166, doi:10.1093/sysbio/sys078. M.R. Smith (2021): Rogue: Identify rogue taxa sets phylogenetic trees. Zenodo, doi:10.5281/zenodo.5037327. M.R. Smith (2022): Using information theory detect rogue taxa improve consensus trees. Systematic Biology 71(5): 986–1008, doi:10.1093/sysbio/syab099","code":""},{"path":"https://ms609.github.io/Rogue/reference/GraphGeodesic.html","id":null,"dir":"Reference","previous_headings":"","what":"Graph Geodesic between leaves of unweighted tree — GraphGeodesic","title":"Graph Geodesic between leaves of unweighted tree — GraphGeodesic","text":"Graph Geodesic leaves unweighted tree","code":""},{"path":"https://ms609.github.io/Rogue/reference/GraphGeodesic.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Graph Geodesic between leaves of unweighted tree — GraphGeodesic","text":"","code":"GraphGeodesic(x, nTip = length(x$tip.label), log = FALSE, asMatrix = TRUE) Cophenetic(x, nTip = length(x$tip.label), log = FALSE, asMatrix = TRUE)"},{"path":"https://ms609.github.io/Rogue/reference/GraphGeodesic.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Graph Geodesic between leaves of unweighted tree — GraphGeodesic","text":"x Object class phylo. nTip Integer specifying number leaves. asMatrix Logical specifying whether coerce output matrix format.","code":""},{"path":"https://ms609.github.io/Rogue/reference/GraphGeodesic.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Graph Geodesic between leaves of unweighted tree — GraphGeodesic","text":"GraphGeodesic() returns unnamed integer matrix describing number edges pair edges.","code":""},{"path":"https://ms609.github.io/Rogue/reference/GraphGeodesic.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Graph Geodesic between leaves of unweighted tree — GraphGeodesic","text":"Martin R. Smith, modifying algorithm Emmanuel Paradis ape::dist.nodes().","code":""},{"path":"https://ms609.github.io/Rogue/reference/GraphGeodesic.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Graph Geodesic between leaves of unweighted tree — GraphGeodesic","text":"","code":"GraphGeodesic(TreeTools::BalancedTree(5)) #> [,1] [,2] [,3] [,4] [,5] #> [1,] 0 2 3 5 5 #> [2,] 2 0 3 5 5 #> [3,] 3 3 0 4 4 #> [4,] 5 5 4 0 2 #> [5,] 5 5 4 2 0"},{"path":"https://ms609.github.io/Rogue/reference/Rogue-package.html","id":null,"dir":"Reference","previous_headings":"","what":"Rogue — Rogue-package","title":"Rogue — Rogue-package","text":"\"Rogue\" implements approaches identify rogue taxa phylogenetic analysis. Rogues wildcard leaves whose uncertain position, perhaps result missing conflicting data, reduces resolution consensus trees (Kearney 2002) . Consensus trees omit rogue taxa can informative.","code":""},{"path":"https://ms609.github.io/Rogue/reference/Rogue-package.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Rogue — Rogue-package","text":"\"Rogue\" allows user select concept \"information\" quality consensus trees evaluated, heuristic approach rogue taxa identified. Rogue detection using phylogenetic clustering information content measures (SPIC, SCIC) (Smith 2022) implemented using quick heuristic drops least \"stable\" leaves one time, using ad hoc definition stability (Smith 2022) ; exhaustive (time-consuming) approach considers dropping possible sets n leaves (Aberer et al. 2013) . latter heuristic implemented relative bipartition \"information\" content Pattengale's criterion via RogueNaRok (Aberer et al. 2013) .","code":""},{"path":"https://ms609.github.io/Rogue/reference/Rogue-package.html","id":"citing-rogue-","dir":"Reference","previous_headings":"","what":"Citing \"Rogue\"","title":"Rogue — Rogue-package","text":"find package useful work, Please consider citing Smith (2021). cite underlying methods, please cite Aberer et al. (2013) (\"RogueNaRok\") Smith (2022) (SPIC, SCIC), appropriate.","code":""},{"path":"https://ms609.github.io/Rogue/reference/Rogue-package.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Rogue — Rogue-package","text":"Aberer AJ, Krompass D, Stamatakis (2013). “Pruning rogue taxa improves phylogenetic accuracy: efficient algorithm webservice.” Systematic Biology, 62(1), 162--166. doi:10.1093/sysbio/sys078 . Kearney M (2002). “Fragmentary taxa, missing data, ambiguity: mistaken assumptions conclusions.” Systematic Biology, 51(2), 369--381. doi:10.1080/10635150252899824 . Smith MR (2022). “Using information theory detect rogue taxa improve consensus trees.” Systematic Biology, 71(5), 986--1008. doi:10.1093/sysbio/syab099 .","code":""},{"path":[]},{"path":"https://ms609.github.io/Rogue/reference/Rogue-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Rogue — Rogue-package","text":"Maintainer: Martin R. Smith martin.smith@durham.ac.uk (ORCID) [copyright holder] Authors: Andre J. Aberer andre.aberer@googlemail.com [copyright holder]","code":""},{"path":"https://ms609.github.io/Rogue/reference/RogueTaxa.html","id":null,"dir":"Reference","previous_headings":"","what":"Drop rogue taxa to generate a more informative consensus — RogueTaxa","title":"Drop rogue taxa to generate a more informative consensus — RogueTaxa","text":"RogueTaxa() finds wildcard leaves whose removal increases resolution branch support values consensus tree, using relative bipartition, shared phylogenetic, mutual clustering concepts information.","code":""},{"path":"https://ms609.github.io/Rogue/reference/RogueTaxa.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Drop rogue taxa to generate a more informative consensus — RogueTaxa","text":"","code":"RogueTaxa( trees, info = c(\"spic\", \"scic\", \"fspic\", \"fscic\", \"rbic\"), return = c(\"taxa\", \"tree\"), bestTree = NULL, computeSupport = TRUE, dropsetSize = 1, neverDrop = character(0), labelPenalty = 0, mreOptimization = FALSE, threshold = 50, verbose = FALSE ) QuickRogue( trees, info = \"phylogenetic\", p = 0.5, log = TRUE, average = \"median\", deviation = \"mad\", neverDrop, fullSeq = FALSE, parallel = FALSE ) C_RogueNaRok( bootTrees = \"\", runId = \"tmp\", treeFile = \"\", computeSupport = TRUE, dropsetSize = 1, excludeFile = \"\", workDir = \"\", labelPenalty = 0, mreOptimization = FALSE, threshold = 50 )"},{"path":"https://ms609.github.io/Rogue/reference/RogueTaxa.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Drop rogue taxa to generate a more informative consensus — RogueTaxa","text":"trees List trees analyse. info Concept information employ; see details. return taxa, returns leaves identified rogues; tree, return consensus tree omitting rogue taxa. computeSupport Logical: FALSE, instead trying maximize support consensus tree, RogueNaRok try maximize number bipartitions final tree pruning taxa. dropsetSize Integer specifying maximum size dropset per iteration. dropsetSize == n, RogueNaRok test iteration tuple n taxa increases optimality criterion , pruning taxa accordingly. improves result, run times increase least linearly. neverDrop Tip labels dropped consensus. labelPenalty weight factor penalize dropset size info = \"rbic\". higher value, conservative algorithm pruning taxa. default value 0 gives RBIC; 1 gives Pattengale's criterion. threshold, mreOptimization threshold mode consensus tree optimized. Specify value 50 (majority rule consensus, default) 100 (strict consensus), set mreOptimization = TRUE extended majority rule consensus. Note rogue taxa identified respect different thresholds can vary substantially. verbose Logical specifying whether display output RogueNaRok. FALSE, output included attribute return value. p Proportion trees must contain split included consensus consideration. 0.5, default, corresponds majority rule tree; 1.0 maximize information content strict consensus. log Logical specifying whether log-transform distances calculating leaf stability. average Character specifying whether use \"mean\" \"median\" tip distances calculate leaf stability. deviation Character specifying whether use \"sd\" \"mad\" calculate leaf stability. fullSeq Logical specifying whether list taxa (TRUE), improve information content dropped (FALSE). parallel Logical specifying whether parallel execution take place C++. bootTrees Path file containing collection bootstrap trees. runId identifier run, appended output files. treeFile, bestTree single best-known tree (ML MP tree) provided, RogueNaRok optimizes bootstrap support best-known tree (still drawn bootstrap trees); threshold parameter ignored. excludeFile Taxa file (one taxon per line) considered pruning. workDir Path working directory output files created.","code":""},{"path":"https://ms609.github.io/Rogue/reference/RogueTaxa.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Drop rogue taxa to generate a more informative consensus — RogueTaxa","text":"RogueTaxa() returns data.frame. row first, describes starting tree, describes dropset operation. Columns describe: num: Sequential index drop operation taxNum: Numeric identifier dropped leaves taxon: Text identifier dropped leaves rawImprovement: Improvement score obtained operation IC: Information content tree dropping leaves far, measure indicated info. QuickRogue() returns data.frame format RogueTaxa(). C_RogueNaRok() returns 0 successful; -1 error.","code":""},{"path":"https://ms609.github.io/Rogue/reference/RogueTaxa.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Drop rogue taxa to generate a more informative consensus — RogueTaxa","text":"\"Rogue\" (loosely) \"wildcard\" taxa (Nixon Wheeler 1992) leaves whose position tree poorly constrained, typically much phylogenetic data associated taxon either missing conflict data (Kearney 2002) . functions use heuristic methods identify rogue taxa whose removal improves information content consensus tree, definitions information discussed .","code":""},{"path":"https://ms609.github.io/Rogue/reference/RogueTaxa.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Drop rogue taxa to generate a more informative consensus — RogueTaxa","text":"QuickRogue(): Shortcut \"fast\" heuristic, option return evaluation taxa using fullSeq = TRUE.","code":""},{"path":"https://ms609.github.io/Rogue/reference/RogueTaxa.html","id":"information-criteria","dir":"Reference","previous_headings":"","what":"Information criteria","title":"Drop rogue taxa to generate a more informative consensus — RogueTaxa","text":"splitwise phylogenetic information content measure produces best results (Smith 2022) . uses splitwise information content shortcut, involves double counting information (may may desirable). holds mutual clustering information measure; measure less obviously suited detection rogues. measure interprets split frequency proxy probability split true, valid interpretation Bayesian posterior sample (Holder et al. 2008) , reasonable imperfect interpretation bootstrap sample (Berry Gascuel 1996) , bad interpretation sample parsimonious trees. \"relative bipartition information criterion\" (RBIC) sum support values divided maximum possible support fully bifurcating tree initial set taxa. relative bipartition information content approach employs 'RogueNaRok' implementation (Aberer et al. 2013) , can handle large trees relatively quickly. RBIC strictly measure information can produce undesirable results (Wilkinson Crotti 2017) . C_RogueNaRok() directly interfaces 'RogueNaRok' C implementation, input checking; aware invalid input cause undefined behaviour likely crash R.","code":""},{"path":"https://ms609.github.io/Rogue/reference/RogueTaxa.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Drop rogue taxa to generate a more informative consensus — RogueTaxa","text":"Aberer AJ, Krompass D, Stamatakis (2013). “Pruning rogue taxa improves phylogenetic accuracy: efficient algorithm webservice.” Systematic Biology, 62(1), 162--166. doi:10.1093/sysbio/sys078 . Berry V, Gascuel O (1996). “interpretation bootstrap trees: appropriate threshold clade selection induced gain.” Molecular Biology Evolution, 13(7), 999--1011. doi:10.1093/molbev/13.7.999 . Holder MT, Sukumaran J, Lewis PO (2008). “justification reporting majority-rule consensus tree Bayesian phylogenetics.” Systematic Biology, 57(5), 814--821. doi:10.1080/10635150802422308 . Kearney M (2002). “Fragmentary taxa, missing data, ambiguity: mistaken assumptions conclusions.” Systematic Biology, 51(2), 369--381. doi:10.1080/10635150252899824 . Nixon KC, Wheeler QD (1992). “Extinction origin species.” Novacek MJ, Wheeler QD (eds.), Extinction phylogeny, chapter Extinction origin species, 119-143. Columbia University Press, New York. Smith MR (2022). “Using information theory detect rogue taxa improve consensus trees.” Systematic Biology, 71(5), 986--1008. doi:10.1093/sysbio/syab099 . Wilkinson M, Crotti M (2017). “Comments detecting rogue taxa using RogueNaRok.” Systematics Biodiversity, 15(4), 291--295. doi:10.1080/14772000.2016.1252440 .","code":""},{"path":"https://ms609.github.io/Rogue/reference/RogueTaxa.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Drop rogue taxa to generate a more informative consensus — RogueTaxa","text":"Martin R. Smith (martin.smith@durham.ac.uk), linking RogueNaRok C library Andre Aberer ()","code":""},{"path":"https://ms609.github.io/Rogue/reference/RogueTaxa.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Drop rogue taxa to generate a more informative consensus — RogueTaxa","text":"","code":"library(\"TreeTools\", warn.conflicts = FALSE) #> Loading required package: ape trees <- list(read.tree(text = (\"(a, (b, (c, (d, (e, (X1, X2))))));\")), read.tree(text = (\"((a, (X1, X2)), (b, (c, (d, e))));\"))) RogueTaxa(trees, dropsetSize = 2) #> ✔ 2024-02-23 14:46:09.930404: Dropped 2 leaves, rendering 4.64386 bits. #> num taxNum taxon rawImprovement IC #> 1 0 NA 3.169925 #> 2 1 6,7 X1,X2 1.473931 4.643856 trees <- list( read.tree(text = \"((a, y), (b, (c, (z, ((d, e), (f, (g, x)))))));\"), read.tree(text = \"(a, (b, (c, (z, (((d, y), e), (f, (g, x)))))));\"), read.tree(text = \"(a, (b, ((c, z), ((d, (e, y)), ((f, x), g)))));\"), read.tree(text = \"(a, (b, ((c, z), ((d, (e, x)), (f, (g, y))))));\"), read.tree(text = \"(a, ((b, x), ((c, z), ((d, e), (f, (g, y))))));\") ) cons <- consensus(trees, p = 0.5) plot(cons) LabelSplits(cons, SplitFrequency(cons, trees) / length(trees)) reduced <- RogueTaxa(trees, info = \"phylogenetic\", ret = \"tree\") #> ✔ 2024-02-23 14:46:10.014404: Dropped 2 leaves, rendering 17.0678 bits. plot(reduced) LabelSplits(reduced, SplitFrequency(reduced, trees) / length(trees)) QuickRogue(trees, fullSeq = TRUE) #> num taxNum taxon rawImprovement IC #> 1 0 NA 8.806435 #> 2 1 2 y 3.818116 12.624552 #> 3 2 10 x 4.443274 17.067826 #> 4 3 1 a -17.067826 0.000000 #> 5 4 3 b 0.000000 0.000000 #> 6 5 4 c 0.000000 0.000000 #> 7 6 5 z 0.000000 0.000000 #> 8 7 6 d 0.000000 0.000000 #> 9 8 7 e 0.000000 0.000000 #> 10 9 8 f 0.000000 0.000000 #> 11 10 9 g 0.000000 0.000000 bootTrees <- system.file(\"example/150.bs\", package = \"Rogue\") tmpDir <- tempdir() XX <- capture.output( # Don't print verbose run details to console C_RogueNaRok(bootTrees, workDir = tmpDir) ) # Results have been written to our temporary directory oldwd <- setwd(tmpDir) head(read.table(\"RogueNaRok_droppedRogues.tmp\", header = TRUE)) #> num taxNum taxon rawImprovement RBIC #> 1 0 NA 0.000 0.570381 #> 2 1 9 Species172 1.238 0.578803 #> 3 2 89 Species099 0.801 0.584252 #> 4 3 16 Species028 0.712 0.589095 #> 5 4 43 Species077 0.592 0.593122 #> 6 5 148 Species137 0.539 0.596789 # Delete temporary files file.remove(\"RogueNaRok_droppedRogues.tmp\") #> [1] TRUE file.remove(\"RogueNaRok_info.tmp\") #> [1] TRUE setwd(oldwd)"},{"path":"https://ms609.github.io/Rogue/reference/TipInstability.html","id":null,"dir":"Reference","previous_headings":"","what":"Tip instability — TipInstability","title":"Tip instability — TipInstability","text":"TipInstability() calculates instability leaf tree. Unstable leaves likely display roguish behaviour.","code":""},{"path":"https://ms609.github.io/Rogue/reference/TipInstability.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Tip instability — TipInstability","text":"","code":"TipInstability( trees, log = TRUE, average = \"mean\", deviation = \"sd\", checkTips = TRUE, parallel = FALSE ) ColByStability( trees, log = TRUE, average = \"mean\", deviation = \"sd\", pal = hcl.colors(131, \"inferno\")[1:101] )"},{"path":"https://ms609.github.io/Rogue/reference/TipInstability.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Tip instability — TipInstability","text":"trees List trees analyse. log Logical specifying whether log-transform distances calculating leaf stability. average Character specifying whether use \"mean\" \"median\" tip distances calculate leaf stability. deviation Character specifying whether use \"sd\" \"mad\" calculate leaf stability. checkTips Logical specifying whether check tips numbered consistently. parallel Logical specifying whether parallel execution take place C++. pal vector listing sequence colours used plotting. earliest entries assigned stable tips.","code":""},{"path":"https://ms609.github.io/Rogue/reference/TipInstability.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Tip instability — TipInstability","text":"ColByStability() returns named character vector assigns colour leaf trees according stability.","code":""},{"path":"https://ms609.github.io/Rogue/reference/TipInstability.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Tip instability — TipInstability","text":"Smith (2022) defines instability pair leaves median absolute divergence graph geodesic (number edges shortest path leaves) across trees, normalized mean graph geodesic. instability single leaf mean instability pairs include leaf; higher values characterise leaves whose position variable trees. concepts leaf instability include \"taxonomic instability index\", implemented Mesquite: described Thomson Shaffer (2010) \\(\\sum\\limits_{(x, y), j \\neq }{\\frac{|D~ijx~ - D~ijy~|}{(D~ijx~ - D~ijy~)^2}}\\), \\(D~ijx~\\) patristic distance (.e. length edges) leaves \\(\\) \\(j\\) tree \\(x\\). average stability triplets (.e. quartets including root) include leaf (Thorley Wilkinson 1999) , implemented \"Phyutility\" (Smith Dunn 2008) ; related \"positional congruence\" measures (Estabrook 1992; Pol Escapa 2009) .","code":""},{"path":"https://ms609.github.io/Rogue/reference/TipInstability.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Tip instability — TipInstability","text":"Estabrook GF (1992). “Evaluating undirected positional congruence individual taxa two estimates phylogenetic tree group taxa.” Systematic Biology, 41(2), 172--177. doi:10.1093/sysbio/41.2.172 . Pol D, Escapa IH (2009). “Unstable taxa cladistic analysis: identification assessment relevant characters.” Cladistics, 25(5), 515--527. doi:10.1111/j.1096-0031.2009.00258.x . Smith MR (2022). “Using information theory detect rogue taxa improve consensus trees.” Systematic Biology, 71(5), 986--1008. doi:10.1093/sysbio/syab099 . Smith SA, Dunn CW (2008). “Phyutility: phyloinformatics tool trees, alignments molecular data.” Bioinformatics, 24(5), 715--716. doi:10.1093/bioinformatics/btm619 . Thomson RC, Shaffer HB (2010). “Sparse supermatrices phylogenetic inference: taxonomy, alignment, rogue taxa, phylogeny living turtles.” Systematic Biology, 59(1), 42--58. doi:10.1093/sysbio/syp075 . Thorley JL, Wilkinson M (1999). “Testing phylogenetic stability early tetrapods.” Journal Theoretical Biology, 200(3), 343--344. doi:10.1006/jtbi.1999.0999 .","code":""},{"path":[]},{"path":"https://ms609.github.io/Rogue/reference/TipInstability.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Tip instability — TipInstability","text":"Martin R. Smith (martin.smith@durham.ac.uk)","code":""},{"path":"https://ms609.github.io/Rogue/reference/TipInstability.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Tip instability — TipInstability","text":"","code":"library(\"TreeTools\", quietly = TRUE) # Generate some trees with a rogue taxon trees <- AddTipEverywhere(BalancedTree(8), \"Rogue\")[3:6] # Display the strict consensus plot(consensus(trees), tip.col = ColByStability(trees)) # Add a legend for the colour scale used PlotTools::SpectrumLegend( \"bottomleft\", bty = \"n\", # No box legend = c(\"Unstable\", \"\", \"Stable\"), palette = hcl.colors(131, \"inferno\")[1:101] ) # Calculate leaf stability instab <- TipInstability(trees, log = FALSE, ave = \"mean\", dev = \"mad\") # Plot a consensus that omits the least stable leaves plot(ConsensusWithout(trees, names(instab[instab > 0.2])))"},{"path":"https://ms609.github.io/Rogue/reference/TipVolatility.html","id":null,"dir":"Reference","previous_headings":"","what":"Detect rogue taxa using phylogenetic information distance — TipVolatility","title":"Detect rogue taxa using phylogenetic information distance — TipVolatility","text":"Calculate volatility tip: namely, impact mean phylogenetic information distance (Smith 2020) trees tip removed. Effective number trees small.","code":""},{"path":"https://ms609.github.io/Rogue/reference/TipVolatility.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Detect rogue taxa using phylogenetic information distance — TipVolatility","text":"","code":"TipVolatility(trees)"},{"path":"https://ms609.github.io/Rogue/reference/TipVolatility.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Detect rogue taxa using phylogenetic information distance — TipVolatility","text":"trees List trees analyse.","code":""},{"path":"https://ms609.github.io/Rogue/reference/TipVolatility.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Detect rogue taxa using phylogenetic information distance — TipVolatility","text":"TipVolatility() returns named vector listing volatility index calculated leaf.","code":""},{"path":"https://ms609.github.io/Rogue/reference/TipVolatility.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Detect rogue taxa using phylogenetic information distance — TipVolatility","text":"Smith MR (2020). “Information theoretic Generalized Robinson--Foulds metrics comparing phylogenetic trees.” Bioinformatics, 36(20), 5007--5013. doi:10.1093/bioinformatics/btaa614 .","code":""},{"path":[]},{"path":"https://ms609.github.io/Rogue/reference/TipVolatility.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Detect rogue taxa using phylogenetic information distance — TipVolatility","text":"","code":"library(\"TreeTools\", quietly = TRUE) # Generate some trees with two rogue taxa trees <- AddTipEverywhere(BalancedTree(8), \"Rogue\") trees[] <- lapply(trees, AddTip, \"Rogue\", \"Rogue2\") # Calculate tip volatility sb <- TipVolatility(trees) # Use volatility to colour leaves in consensus tree sbNorm <- 1 + (99 * (sb - min(sb)) / (max(sb - min(sb)))) col <- hcl.colors(128, \"inferno\")[sbNorm] plot(consensus(trees), tip.color = col) # Add a legend for the colour scale used PlotTools::SpectrumLegend( \"bottomleft\", bty = \"n\", # Suppress box inset = -0.02, # Avoid overlap title = \"Volatility\", legend = signif(seq(max(sb), min(sb), length.out = 4), 3), palette = hcl.colors(128, \"inferno\") ) # Plot consensus after removing highly volatile taxa plot(ConsensusWithout(trees, names(sb[sb == max(sb)])))"},{"path":"https://ms609.github.io/Rogue/news/index.html","id":"rogue-v216","dir":"Changelog","previous_headings":"","what":"Rogue v2.1.6","title":"Rogue v2.1.6","text":"CRAN release: 2023-11-29 Legend annotations documentation. Disable parallel evaluation default TipInstability(), adding parallel parameter allow user override. Use format string REprintf().","code":""},{"path":"https://ms609.github.io/Rogue/news/index.html","id":"rogue-v215","dir":"Changelog","previous_headings":"","what":"Rogue v2.1.5","title":"Rogue v2.1.5","text":"CRAN release: 2023-03-20 Call C functions using symbols, strings.","code":""},{"path":"https://ms609.github.io/Rogue/news/index.html","id":"rogue-v214","dir":"Changelog","previous_headings":"","what":"Rogue v2.1.4","title":"Rogue v2.1.4","text":"CRAN release: 2023-01-16 C2X compliant function prototypes. Remove unused sprintf() calls.","code":""},{"path":"https://ms609.github.io/Rogue/news/index.html","id":"rogue-v213","dir":"Changelog","previous_headings":"","what":"Rogue v2.1.3","title":"Rogue v2.1.3","text":"CRAN release: 2022-09-26 ColByStability() gains pal argument allow specification custom palettes.","code":""},{"path":"https://ms609.github.io/Rogue/news/index.html","id":"rogue-v212","dir":"Changelog","previous_headings":"","what":"Rogue v2.1.2","title":"Rogue v2.1.2","text":"CRAN release: 2022-08-16 Faster rogue detection edge lengths provided, per report Joe Keating. Don’t list neverDrop QuickRogue(fullSeq = TRUE).","code":""},{"path":"https://ms609.github.io/Rogue/news/index.html","id":"rogue-v211","dir":"Changelog","previous_headings":"","what":"Rogue v2.1.1","title":"Rogue v2.1.1","text":"CRAN release: 2022-07-20 Handle ColByStability(trees = NULL).","code":""},{"path":"https://ms609.github.io/Rogue/news/index.html","id":"rogue-v210","dir":"Changelog","previous_headings":"","what":"Rogue v2.1.0","title":"Rogue v2.1.0","text":"CRAN release: 2022-01-13 Early termination QuickRogue() improvement possible. Cophenetic() renamed accurate GraphGeodesic(). Calculate information content consensus trees p > 0.5 (#15). Improve support multiPhylo objects. New vignette detailing rogue detection Bayesian tree samples.","code":""},{"path":"https://ms609.github.io/Rogue/news/index.html","id":"rogue-v200","dir":"Changelog","previous_headings":"","what":"Rogue v2.0.0","title":"Rogue v2.0.0","text":"CRAN release: 2021-09-13 Information theoretic rogue detection (per Smith, 2022).","code":""},{"path":"https://ms609.github.io/Rogue/news/index.html","id":"rogue-v100","dir":"Changelog","previous_headings":"","what":"Rogue v1.0.0","title":"Rogue v1.0.0","text":"CRAN release: 2021-07-01 R interface RogueNaRok.","code":""}]