Skip to content

Commit

Permalink
update phytools vignette
Browse files Browse the repository at this point in the history
  • Loading branch information
sdgamboa committed Sep 27, 2023
1 parent e21b1aa commit 8b52fa2
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions vignettes/articles/phytools.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ set_without_ids <- phys_data |>
mutate(Evidence = 'tax') |>
ungroup() |>
select(-Total_score) |>
filter(!NCBI_ID %in% unique(set_with_ids$NCBI_ID)) |>
distinct()
dim(set_without_ids)
```
Expand Down Expand Up @@ -204,8 +205,6 @@ mean(tip_data$taxid %in% phys_data_ready$taxid)

### Map NCBI IDs to the NCBI taxonomic tree

At this point only genus, species, and strain annotations are present.

```{r}
ncbi_tree$Do(function(node) {
if (node$name %in% names(phys_data_list)) {
Expand Down Expand Up @@ -294,7 +293,7 @@ How many nodes family and above with attribute table? (it should be zero)

```{r}
ncbi_attr_kpcof <- ncbi_tree$Get(
'attribute_tbl', filterFun = function(node) grepl('^[kpcor]__', node$name)
'attribute_tbl', filterFun = function(node) grepl('^[dpcor]__', node$name)
)
mean(!map_lgl(ncbi_attr_kpcof, ~ all(is.na(.x))))
```
Expand Down Expand Up @@ -337,7 +336,7 @@ inh1 <- function(node, adjF = 0.1) {
ncbi_tree$Do(inh1, traversal = 'pre-order')
```

Proportion of nodes at the family level and above with attributes:
Proportion of nodes at the family level and above with attributes (it should be zero):

```{r}
ncbi_attr_kpcof <- ncbi_tree$Get(
Expand Down Expand Up @@ -468,7 +467,7 @@ node_rows <- length(tree$tip.label) + 1:tree$Nnode
rownames(res)[node_rows] <- tree$node.label
```

Probabiliites of internal nodes
Probabilities of internal nodes

```{r}
data.frame(prob = as.double(res[tree$node.label,])) |>
Expand Down

0 comments on commit 8b52fa2

Please sign in to comment.