Import tree

ltp <- ltp()
tree <- ltp$tree

Create two sets of known tip labels

known_x <- sample(tree$tip.label, 10)
known_y <- sample(tree$tip.label, 2000)

Get NSTI values

nodes_with_taxid <- grep("^n", tree$node.label, value = TRUE, invert = TRUE)
nsti_x <- getNsti(tree = tree, annotated_tip_labels = known_x, nodes = nodes_with_taxid)
nsti_y <- getNsti(tree = tree, annotated_tip_labels = known_y, nodes = nodes_with_taxid)

Plot a couple of histograms

nsti_x |> 
    ggplot(aes(nsti)) +
    geom_histogram(binwidth = 0.1, fill = 'gray70', color = 'black') +
    theme_bw()

nsti_y |> 
    ggplot(aes(nsti)) +
    geom_histogram(binwidth = 0.1, fill = 'gray70', color = 'black') +
    theme_bw()

Comments

System information

sessioninfo::session_info()
#> ─ Session info ───────────────────────────────────────────────────────────────
#>  setting  value
#>  version  R version 4.4.1 (2024-06-14)
#>  os       Ubuntu 22.04.4 LTS
#>  system   x86_64, linux-gnu
#>  ui       X11
#>  language en
#>  collate  en_US.UTF-8
#>  ctype    en_US.UTF-8
#>  tz       Etc/UTC
#>  date     2024-07-23
#>  pandoc   3.2 @ /usr/bin/ (via rmarkdown)
#> 
#> ─ Packages ───────────────────────────────────────────────────────────────────
#>  package     * version date (UTC) lib source
#>  ape           5.8     2024-04-11 [1] RSPM (R 4.4.0)
#>  bslib         0.7.0   2024-03-29 [1] RSPM (R 4.4.0)
#>  cachem        1.1.0   2024-05-16 [1] RSPM (R 4.4.0)
#>  castor      * 1.8.2   2024-06-29 [1] RSPM (R 4.4.0)
#>  cli           3.6.3   2024-06-21 [1] RSPM (R 4.4.0)
#>  colorspace    2.1-0   2023-01-23 [1] RSPM (R 4.4.0)
#>  desc          1.4.3   2023-12-10 [1] RSPM (R 4.4.0)
#>  digest        0.6.36  2024-06-23 [1] RSPM (R 4.4.0)
#>  dplyr         1.1.4   2023-11-17 [1] RSPM (R 4.4.0)
#>  evaluate      0.24.0  2024-06-10 [1] RSPM (R 4.4.0)
#>  fansi         1.0.6   2023-12-08 [1] RSPM (R 4.4.0)
#>  farver        2.1.2   2024-05-13 [1] RSPM (R 4.4.0)
#>  fastmap       1.2.0   2024-05-15 [1] RSPM (R 4.4.0)
#>  fs            1.6.4   2024-04-25 [1] RSPM (R 4.4.0)
#>  generics      0.1.3   2022-07-05 [1] RSPM (R 4.4.0)
#>  ggplot2     * 3.5.1   2024-04-23 [1] RSPM (R 4.4.0)
#>  glue          1.7.0   2024-01-09 [1] RSPM (R 4.4.0)
#>  gtable        0.3.5   2024-04-22 [1] RSPM (R 4.4.0)
#>  highr         0.11    2024-05-26 [1] RSPM (R 4.4.0)
#>  htmltools     0.5.8.1 2024-04-04 [1] RSPM (R 4.4.0)
#>  htmlwidgets   1.6.4   2023-12-06 [1] RSPM (R 4.4.0)
#>  jquerylib     0.1.4   2021-04-26 [1] RSPM (R 4.4.0)
#>  jsonlite      1.8.8   2023-12-04 [1] RSPM (R 4.4.0)
#>  knitr         1.48    2024-07-07 [1] RSPM (R 4.4.0)
#>  labeling      0.4.3   2023-08-29 [1] RSPM (R 4.4.0)
#>  lattice       0.22-6  2024-03-20 [2] CRAN (R 4.4.1)
#>  lifecycle     1.0.4   2023-11-07 [1] RSPM (R 4.4.0)
#>  magrittr      2.0.3   2022-03-30 [1] RSPM (R 4.4.0)
#>  Matrix        1.7-0   2024-04-26 [2] CRAN (R 4.4.1)
#>  munsell       0.5.1   2024-04-01 [1] RSPM (R 4.4.0)
#>  naturalsort   0.1.3   2016-08-30 [1] RSPM (R 4.4.0)
#>  nlme          3.1-165 2024-06-06 [2] RSPM (R 4.4.0)
#>  pillar        1.9.0   2023-03-22 [1] RSPM (R 4.4.0)
#>  pkgconfig     2.0.3   2019-09-22 [1] RSPM (R 4.4.0)
#>  pkgdown       2.1.0   2024-07-06 [1] RSPM (R 4.4.0)
#>  purrr         1.0.2   2023-08-10 [1] RSPM (R 4.4.0)
#>  R6            2.5.1   2021-08-19 [1] RSPM (R 4.4.0)
#>  ragg          1.3.2   2024-05-15 [1] RSPM (R 4.4.0)
#>  Rcpp        * 1.0.13  2024-07-17 [1] RSPM (R 4.4.0)
#>  rlang         1.1.4   2024-06-04 [1] RSPM (R 4.4.0)
#>  rmarkdown     2.27    2024-05-17 [1] RSPM (R 4.4.0)
#>  RSpectra      0.16-2  2024-07-18 [1] RSPM (R 4.4.0)
#>  sass          0.4.9   2024-03-15 [1] RSPM (R 4.4.0)
#>  scales        1.3.0   2023-11-28 [1] RSPM (R 4.4.0)
#>  sessioninfo   1.2.2   2021-12-06 [1] RSPM (R 4.4.0)
#>  systemfonts   1.1.0   2024-05-15 [1] RSPM (R 4.4.0)
#>  taxPPro     * 1.0.0   2024-07-23 [1] local
#>  textshaping   0.4.0   2024-05-24 [1] RSPM (R 4.4.0)
#>  tibble        3.2.1   2023-03-20 [1] RSPM (R 4.4.0)
#>  tidyselect    1.2.1   2024-03-11 [1] RSPM (R 4.4.0)
#>  utf8          1.2.4   2023-10-22 [1] RSPM (R 4.4.0)
#>  vctrs         0.6.5   2023-12-01 [1] RSPM (R 4.4.0)
#>  withr         3.0.0   2024-01-16 [1] RSPM (R 4.4.0)
#>  xfun          0.46    2024-07-18 [1] RSPM (R 4.4.0)
#>  yaml          2.3.9   2024-07-05 [1] RSPM (R 4.4.0)
#> 
#>  [1] /usr/local/lib/R/site-library
#>  [2] /usr/local/lib/R/library
#> 
#> ──────────────────────────────────────────────────────────────────────────────