Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a980ba3
commit 94ae8aa
Showing
11 changed files
with
111 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# LIB | ||
library(treeman) | ||
|
||
# Load BIG trees and get ages | ||
data(mammals) | ||
data(birds) | ||
mml_age <- getAge(mammals) | ||
brd_age <- getAge(birds) | ||
|
||
# Rename internal nodes | ||
mammals['nds'][1:10] | ||
birds['nds'][1:10] # possible node IDs are not unique | ||
mml_nds <- paste0('mml_', mammals['nds']) | ||
mml_nds[1:10] | ||
avs_nds <- paste0('avs_', birds['nds']) | ||
mammals <- setNdsID(mammals, mammals['nds'], mml_nds) | ||
birds <- setNdsID(birds, birds['nds'], avs_nds) | ||
|
||
# Generate incipient tree | ||
tree <- twoer() | ||
|
||
# Add to mammals and birds to tree | ||
tree <- setNdsID(tree, c('t1', 't2'), c('Mammalia', 'Aves')) | ||
# set spans to make tree ultrametric | ||
tree <- setNdSpn(tree, 'Aves', abs(brd_age - mml_age) + 1) | ||
# list of form: id=txnym | ||
txnyms <- list('Aves'='Aves', 'Mammalia'= 'Mammalia', | ||
'root'='Amniota') | ||
tree <- setTxnyms(tree, txnyms) | ||
tree <- addClade(tree=tree, id='Mammalia', clade=mammals) | ||
tree <- addClade(tree=tree, id='Aves', clade=birds) | ||
|
||
# Complete | ||
tree[['root']] | ||
summary(tree) | ||
# Note, plotting takes time.... have to convert to APE | ||
plot(as(tree, 'phylo'), show.tip.label=FALSE) |
Large diffs are not rendered by default.
Oops, something went wrong.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters