knitr::opts_chunk$set(fig.width=12, fig.height=8, echo=TRUE, warning=FALSE, message=FALSE, tidy=TRUE)
rPinecone, is an R package designed to define sub-lineages within closely related LV populations. rPinecone uses root-to-tip directional approach to define sub-lineages within a phylogenetic tree according to SNV distance from the ancestral node.
library(phytools) library(rPinecone)
The package defines sub-lineages within a bacterial clonal expansion via a phylogenetic tree.
A rooted tree in newick format with branch lengths representing SNP distance
A SNP scaled tree can be produced using the algorithm of Pupko et al. available in python at pyjar
SNP threshold - used for sub-grouping
After loading a newick formatted tree rPinecone can be called as
tree.file.name <- system.file("extdata", "pyjar.staph_ST2371_45_re_itol_7079_1_6_root.joint.tre", package = "rPinecone") tree <- ape::read.tree(tree.file.name) results <- pinecone(tree, 2, 3, quiet = TRUE)
The resulting output can the be parsed for plotting with iTOL
To exports a data file for replacing Tip Labels with Sub-Group number (LABELS) run
itol_labels_template(results)
To export a data file for displaying the Sub-Groups (DATASET_COLOURSTRIP) run
itol_sublineage_output(results)
To export a data file for displaying the Major Sub-Groups (DATASET_COLOURSTRIP) run
itol_major_SL_output(results)
The phylogentic tree with dichotomies resolved into multichotomies can be saved by running
write.tree(results$tree, file = "rpinecone.tree")
nocite: '@*' ...
sessionInfo()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.