1 | 1 |
deleted file mode 100644 |
... | ... |
@@ -1,15 +0,0 @@ |
1 |
-##' merge phylo and output of boot.phylo to 'apeBootstrap' object |
|
2 |
-##' |
|
3 |
-##' |
|
4 |
-##' @title apeBoot |
|
5 |
-##' @param phylo phylo |
|
6 |
-##' @param boot bootstrap values |
|
7 |
-##' @return an instance of 'apeBootstrap' |
|
8 |
-##' @importFrom treeio as.treedata |
|
9 |
-##' @export |
|
10 |
-##' @author Guangchuang Yu |
|
11 |
-apeBoot <- function(phylo, boot) { |
|
12 |
- message("this function was deprecated, please use treeio::as.treedata") |
|
13 |
- as.treedata(phylo, boot) |
|
14 |
-} |
|
15 |
- |
... | ... |
@@ -1,31 +1,3 @@ |
1 |
- |
|
2 |
-## ##' @export |
|
3 |
-## ape::read.tree |
|
4 |
- |
|
5 |
- |
|
6 |
-## ##' generate random tree |
|
7 |
-## ##' @export |
|
8 |
-## ##' @rdname rtree |
|
9 |
-## ##' @param n number of tips in the tree |
|
10 |
-## ##' @param rooted logcial |
|
11 |
-## ##' @param tip.label tip label |
|
12 |
-## ##' @param br one of the following: (i) an R function used to generate the |
|
13 |
-## ##' branch lengths ('rtree'; use 'NULL' to simulate only a |
|
14 |
-## ##' topology), or the coalescence times ('rcoal'); (ii) a |
|
15 |
-## ##' character to simulate a genuine coalescent tree for 'rcoal' |
|
16 |
-## ##' (the default); or (iii) a numeric vector for the branch |
|
17 |
-## ##' lengths or the coalescence times. |
|
18 |
-## ##' @param ... additional parameters to be passed to 'br' |
|
19 |
-## ##' @source |
|
20 |
-## ##' This is just the imported function |
|
21 |
-## ##' from the ape package. The documentation you should |
|
22 |
-## ##' read for the rtree function can be found here: \link[ape]{rtree} |
|
23 |
-## ##' |
|
24 |
-## ##' @seealso |
|
25 |
-## ##' \link[ape]{rtree} |
|
26 |
-## rtree <- ape::rtree |
|
27 |
- |
|
28 |
- |
|
29 | 1 |
##' merge phylo and output of boot.phylo to 'apeBootstrap' object |
30 | 2 |
##' |
31 | 3 |
##' |
... | ... |
@@ -41,49 +13,3 @@ apeBoot <- function(phylo, boot) { |
41 | 13 |
as.treedata(phylo, boot) |
42 | 14 |
} |
43 | 15 |
|
44 |
-## apeBoot <- function(phylo, boot) { |
|
45 |
-## ## phylo is a phylo object |
|
46 |
-## ## boot is output from boot.phylo |
|
47 |
-## new("apeBootstrap", |
|
48 |
-## phylo=phylo, |
|
49 |
-## bootstrap=data.frame(node=(1:Nnode(phylo)) + Ntip(phylo), bootstrap=boot) |
|
50 |
-## ) |
|
51 |
-## } |
|
52 |
- |
|
53 |
- |
|
54 |
-## ##' @rdname show-methods |
|
55 |
-## ##' @importFrom ape print.phylo |
|
56 |
-## ##' @exportMethod show |
|
57 |
-## setMethod("show", signature(object = "apeBootstrap"), |
|
58 |
-## function(object) { |
|
59 |
-## cat("'apeBoot' S4 object that stored bootstrap value generated by 'ape::boot.phylo'", ".\n\n") |
|
60 |
-## cat("...@ tree: ") |
|
61 |
-## print.phylo(get.tree(object)) |
|
62 |
-## }) |
|
63 |
- |
|
64 |
- |
|
65 |
- |
|
66 |
- |
|
67 |
-## ##' @rdname groupClade-methods |
|
68 |
-## ##' @exportMethod groupClade |
|
69 |
-## setMethod("groupClade", signature(object="apeBootstrap"), |
|
70 |
-## function(object, node, group_name="group") { |
|
71 |
-## groupClade_(object, node, group_name) |
|
72 |
-## }) |
|
73 |
- |
|
74 |
-## ##' @rdname scale_color-methods |
|
75 |
-## ##' @exportMethod scale_color |
|
76 |
-## setMethod("scale_color", signature(object="apeBootstrap"), |
|
77 |
-## function(object, by="bootstrap", ...) { |
|
78 |
-## scale_color_(object, by, ...) |
|
79 |
-## }) |
|
80 |
- |
|
81 |
- |
|
82 |
-## ##' @rdname get.fields-methods |
|
83 |
-## ##' @exportMethod get.fields |
|
84 |
-## setMethod("get.fields", signature(object="apeBootstrap"), |
|
85 |
-## function(object, ...) { |
|
86 |
-## get.fields.tree(object) |
|
87 |
-## } |
|
88 |
-## ) |
|
89 |
- |
... | ... |
@@ -1,29 +1,29 @@ |
1 | 1 |
|
2 |
-##' @export |
|
3 |
-ape::read.tree |
|
2 |
+## ##' @export |
|
3 |
+## ape::read.tree |
|
4 | 4 |
|
5 | 5 |
|
6 |
-##' generate random tree |
|
7 |
-##' @export |
|
8 |
-##' @rdname rtree |
|
9 |
-##' @param n number of tips in the tree |
|
10 |
-##' @param rooted logcial |
|
11 |
-##' @param tip.label tip label |
|
12 |
-##' @param br one of the following: (i) an R function used to generate the |
|
13 |
-##' branch lengths ('rtree'; use 'NULL' to simulate only a |
|
14 |
-##' topology), or the coalescence times ('rcoal'); (ii) a |
|
15 |
-##' character to simulate a genuine coalescent tree for 'rcoal' |
|
16 |
-##' (the default); or (iii) a numeric vector for the branch |
|
17 |
-##' lengths or the coalescence times. |
|
18 |
-##' @param ... additional parameters to be passed to 'br' |
|
19 |
-##' @source |
|
20 |
-##' This is just the imported function |
|
21 |
-##' from the ape package. The documentation you should |
|
22 |
-##' read for the rtree function can be found here: \link[ape]{rtree} |
|
23 |
-##' |
|
24 |
-##' @seealso |
|
25 |
-##' \link[ape]{rtree} |
|
26 |
-rtree <- ape::rtree |
|
6 |
+## ##' generate random tree |
|
7 |
+## ##' @export |
|
8 |
+## ##' @rdname rtree |
|
9 |
+## ##' @param n number of tips in the tree |
|
10 |
+## ##' @param rooted logcial |
|
11 |
+## ##' @param tip.label tip label |
|
12 |
+## ##' @param br one of the following: (i) an R function used to generate the |
|
13 |
+## ##' branch lengths ('rtree'; use 'NULL' to simulate only a |
|
14 |
+## ##' topology), or the coalescence times ('rcoal'); (ii) a |
|
15 |
+## ##' character to simulate a genuine coalescent tree for 'rcoal' |
|
16 |
+## ##' (the default); or (iii) a numeric vector for the branch |
|
17 |
+## ##' lengths or the coalescence times. |
|
18 |
+## ##' @param ... additional parameters to be passed to 'br' |
|
19 |
+## ##' @source |
|
20 |
+## ##' This is just the imported function |
|
21 |
+## ##' from the ape package. The documentation you should |
|
22 |
+## ##' read for the rtree function can be found here: \link[ape]{rtree} |
|
23 |
+## ##' |
|
24 |
+## ##' @seealso |
|
25 |
+## ##' \link[ape]{rtree} |
|
26 |
+## rtree <- ape::rtree |
|
27 | 27 |
|
28 | 28 |
|
29 | 29 |
##' merge phylo and output of boot.phylo to 'apeBootstrap' object |
... | ... |
@@ -33,51 +33,57 @@ rtree <- ape::rtree |
33 | 33 |
##' @param phylo phylo |
34 | 34 |
##' @param boot bootstrap values |
35 | 35 |
##' @return an instance of 'apeBootstrap' |
36 |
+##' @importFrom treeio as.treedata |
|
36 | 37 |
##' @export |
37 | 38 |
##' @author Guangchuang Yu |
38 | 39 |
apeBoot <- function(phylo, boot) { |
39 |
- ## phylo is a phylo object |
|
40 |
- ## boot is output from boot.phylo |
|
41 |
- new("apeBootstrap", |
|
42 |
- phylo=phylo, |
|
43 |
- bootstrap=data.frame(node=(1:Nnode(phylo)) + Ntip(phylo), bootstrap=boot) |
|
44 |
- ) |
|
40 |
+ message("this function was deprecated, please use treeio::as.treedata") |
|
41 |
+ as.treedata(phylo, boot) |
|
45 | 42 |
} |
46 | 43 |
|
44 |
+## apeBoot <- function(phylo, boot) { |
|
45 |
+## ## phylo is a phylo object |
|
46 |
+## ## boot is output from boot.phylo |
|
47 |
+## new("apeBootstrap", |
|
48 |
+## phylo=phylo, |
|
49 |
+## bootstrap=data.frame(node=(1:Nnode(phylo)) + Ntip(phylo), bootstrap=boot) |
|
50 |
+## ) |
|
51 |
+## } |
|
52 |
+ |
|
47 | 53 |
|
48 |
-##' @rdname show-methods |
|
49 |
-##' @importFrom ape print.phylo |
|
50 |
-##' @exportMethod show |
|
51 |
-setMethod("show", signature(object = "apeBootstrap"), |
|
52 |
- function(object) { |
|
53 |
- cat("'apeBoot' S4 object that stored bootstrap value generated by 'ape::boot.phylo'", ".\n\n") |
|
54 |
- cat("...@ tree: ") |
|
55 |
- print.phylo(get.tree(object)) |
|
56 |
- }) |
|
54 |
+## ##' @rdname show-methods |
|
55 |
+## ##' @importFrom ape print.phylo |
|
56 |
+## ##' @exportMethod show |
|
57 |
+## setMethod("show", signature(object = "apeBootstrap"), |
|
58 |
+## function(object) { |
|
59 |
+## cat("'apeBoot' S4 object that stored bootstrap value generated by 'ape::boot.phylo'", ".\n\n") |
|
60 |
+## cat("...@ tree: ") |
|
61 |
+## print.phylo(get.tree(object)) |
|
62 |
+## }) |
|
57 | 63 |
|
58 | 64 |
|
59 | 65 |
|
60 | 66 |
|
61 |
-##' @rdname groupClade-methods |
|
62 |
-##' @exportMethod groupClade |
|
63 |
-setMethod("groupClade", signature(object="apeBootstrap"), |
|
64 |
- function(object, node, group_name="group") { |
|
65 |
- groupClade_(object, node, group_name) |
|
66 |
- }) |
|
67 |
+## ##' @rdname groupClade-methods |
|
68 |
+## ##' @exportMethod groupClade |
|
69 |
+## setMethod("groupClade", signature(object="apeBootstrap"), |
|
70 |
+## function(object, node, group_name="group") { |
|
71 |
+## groupClade_(object, node, group_name) |
|
72 |
+## }) |
|
67 | 73 |
|
68 |
-##' @rdname scale_color-methods |
|
69 |
-##' @exportMethod scale_color |
|
70 |
-setMethod("scale_color", signature(object="apeBootstrap"), |
|
71 |
- function(object, by="bootstrap", ...) { |
|
72 |
- scale_color_(object, by, ...) |
|
73 |
- }) |
|
74 |
+## ##' @rdname scale_color-methods |
|
75 |
+## ##' @exportMethod scale_color |
|
76 |
+## setMethod("scale_color", signature(object="apeBootstrap"), |
|
77 |
+## function(object, by="bootstrap", ...) { |
|
78 |
+## scale_color_(object, by, ...) |
|
79 |
+## }) |
|
74 | 80 |
|
75 | 81 |
|
76 |
-##' @rdname get.fields-methods |
|
77 |
-##' @exportMethod get.fields |
|
78 |
-setMethod("get.fields", signature(object="apeBootstrap"), |
|
79 |
- function(object, ...) { |
|
80 |
- get.fields.tree(object) |
|
81 |
- } |
|
82 |
- ) |
|
82 |
+## ##' @rdname get.fields-methods |
|
83 |
+## ##' @exportMethod get.fields |
|
84 |
+## setMethod("get.fields", signature(object="apeBootstrap"), |
|
85 |
+## function(object, ...) { |
|
86 |
+## get.fields.tree(object) |
|
87 |
+## } |
|
88 |
+## ) |
|
83 | 89 |
|
... | ... |
@@ -28,12 +28,11 @@ rtree <- ape::rtree |
28 | 28 |
|
29 | 29 |
##' merge phylo and output of boot.phylo to 'apeBootstrap' object |
30 | 30 |
##' |
31 |
-##' |
|
31 |
+##' |
|
32 | 32 |
##' @title apeBoot |
33 | 33 |
##' @param phylo phylo |
34 | 34 |
##' @param boot bootstrap values |
35 | 35 |
##' @return an instance of 'apeBootstrap' |
36 |
-##' @importFrom ape Nnode |
|
37 | 36 |
##' @export |
38 | 37 |
##' @author Guangchuang Yu |
39 | 38 |
apeBoot <- function(phylo, boot) { |
... | ... |
@@ -53,7 +52,7 @@ setMethod("show", signature(object = "apeBootstrap"), |
53 | 52 |
function(object) { |
54 | 53 |
cat("'apeBoot' S4 object that stored bootstrap value generated by 'ape::boot.phylo'", ".\n\n") |
55 | 54 |
cat("...@ tree: ") |
56 |
- print.phylo(get.tree(object)) |
|
55 |
+ print.phylo(get.tree(object)) |
|
57 | 56 |
}) |
58 | 57 |
|
59 | 58 |
|
git-svn-id: https://hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/ggtree@118925 bc3139a8-67e5-0310-9ffc-ced21a209358
... | ... |
@@ -1,24 +1,6 @@ |
1 |
-##' read newick tree |
|
1 |
+ |
|
2 | 2 |
##' @export |
3 |
-##' @rdname read.tree |
|
4 |
-##' @param file file name |
|
5 |
-##' @param text alternatively, using newick text |
|
6 |
-##' @param tree.names if read several trees, specify their names |
|
7 |
-##' @param skip number of lines of the input file to skip |
|
8 |
-##' @param comment.char a single character, |
|
9 |
-##' the remaining of the line after this character is ignored. |
|
10 |
-##' @param keep.multi if 'TRUE' and 'tree.names = NULL' |
|
11 |
-##' then single trees are returned in 'multiPhylo' format |
|
12 |
-##' with any name that is present. Default is 'FALSE' |
|
13 |
-##' @param ... further arguments to be passed to 'scan()'. |
|
14 |
-##' @source |
|
15 |
-##' This is just the imported function |
|
16 |
-##' from the ape package. The documentation you should |
|
17 |
-##' read for the read.tree function can be found here: \link[ape]{read.tree} |
|
18 |
-##' |
|
19 |
-##' @seealso |
|
20 |
-##' \link[ape]{read.tree} |
|
21 |
-read.tree <- ape::read.tree |
|
3 |
+ape::read.tree |
|
22 | 4 |
|
23 | 5 |
|
24 | 6 |
##' generate random tree |
git-svn-id: https://hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/ggtree@112578 bc3139a8-67e5-0310-9ffc-ced21a209358
... | ... |
@@ -92,17 +92,6 @@ setMethod("scale_color", signature(object="apeBootstrap"), |
92 | 92 |
}) |
93 | 93 |
|
94 | 94 |
|
95 |
- |
|
96 |
- |
|
97 |
-##' @rdname get.tree-methods |
|
98 |
-##' @exportMethod get.tree |
|
99 |
-setMethod("get.tree", signature(object="apeBootstrap"), |
|
100 |
- function(object,...) { |
|
101 |
- object@phylo |
|
102 |
- } |
|
103 |
- ) |
|
104 |
- |
|
105 |
- |
|
106 | 95 |
##' @rdname get.fields-methods |
107 | 96 |
##' @exportMethod get.fields |
108 | 97 |
setMethod("get.fields", signature(object="apeBootstrap"), |
git-svn-id: https://hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/ggtree@112112 bc3139a8-67e5-0310-9ffc-ced21a209358
... | ... |
@@ -92,12 +92,6 @@ setMethod("scale_color", signature(object="apeBootstrap"), |
92 | 92 |
}) |
93 | 93 |
|
94 | 94 |
|
95 |
-##' @rdname gzoom-methods |
|
96 |
-##' @exportMethod gzoom |
|
97 |
-setMethod("gzoom", signature(object="apeBootstrap"), |
|
98 |
- function(object, focus, subtree=FALSE, widths=c(.3, .7)) { |
|
99 |
- gzoom.phylo(get.tree(object), focus, subtree, widths) |
|
100 |
- }) |
|
101 | 95 |
|
102 | 96 |
|
103 | 97 |
##' @rdname get.tree-methods |
git-svn-id: https://hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/ggtree@111813 bc3139a8-67e5-0310-9ffc-ced21a209358
... | ... |
@@ -43,3 +43,77 @@ read.tree <- ape::read.tree |
43 | 43 |
##' \link[ape]{rtree} |
44 | 44 |
rtree <- ape::rtree |
45 | 45 |
|
46 |
+ |
|
47 |
+##' merge phylo and output of boot.phylo to 'apeBootstrap' object |
|
48 |
+##' |
|
49 |
+##' |
|
50 |
+##' @title apeBoot |
|
51 |
+##' @param phylo phylo |
|
52 |
+##' @param boot bootstrap values |
|
53 |
+##' @return an instance of 'apeBootstrap' |
|
54 |
+##' @importFrom ape Nnode |
|
55 |
+##' @export |
|
56 |
+##' @author Guangchuang Yu |
|
57 |
+apeBoot <- function(phylo, boot) { |
|
58 |
+ ## phylo is a phylo object |
|
59 |
+ ## boot is output from boot.phylo |
|
60 |
+ new("apeBootstrap", |
|
61 |
+ phylo=phylo, |
|
62 |
+ bootstrap=data.frame(node=(1:Nnode(phylo)) + Ntip(phylo), bootstrap=boot) |
|
63 |
+ ) |
|
64 |
+} |
|
65 |
+ |
|
66 |
+ |
|
67 |
+##' @rdname show-methods |
|
68 |
+##' @importFrom ape print.phylo |
|
69 |
+##' @exportMethod show |
|
70 |
+setMethod("show", signature(object = "apeBootstrap"), |
|
71 |
+ function(object) { |
|
72 |
+ cat("'apeBoot' S4 object that stored bootstrap value generated by 'ape::boot.phylo'", ".\n\n") |
|
73 |
+ cat("...@ tree: ") |
|
74 |
+ print.phylo(get.tree(object)) |
|
75 |
+ }) |
|
76 |
+ |
|
77 |
+ |
|
78 |
+ |
|
79 |
+ |
|
80 |
+##' @rdname groupClade-methods |
|
81 |
+##' @exportMethod groupClade |
|
82 |
+setMethod("groupClade", signature(object="apeBootstrap"), |
|
83 |
+ function(object, node, group_name="group") { |
|
84 |
+ groupClade_(object, node, group_name) |
|
85 |
+ }) |
|
86 |
+ |
|
87 |
+##' @rdname scale_color-methods |
|
88 |
+##' @exportMethod scale_color |
|
89 |
+setMethod("scale_color", signature(object="apeBootstrap"), |
|
90 |
+ function(object, by="bootstrap", ...) { |
|
91 |
+ scale_color_(object, by, ...) |
|
92 |
+ }) |
|
93 |
+ |
|
94 |
+ |
|
95 |
+##' @rdname gzoom-methods |
|
96 |
+##' @exportMethod gzoom |
|
97 |
+setMethod("gzoom", signature(object="apeBootstrap"), |
|
98 |
+ function(object, focus, subtree=FALSE, widths=c(.3, .7)) { |
|
99 |
+ gzoom.phylo(get.tree(object), focus, subtree, widths) |
|
100 |
+ }) |
|
101 |
+ |
|
102 |
+ |
|
103 |
+##' @rdname get.tree-methods |
|
104 |
+##' @exportMethod get.tree |
|
105 |
+setMethod("get.tree", signature(object="apeBootstrap"), |
|
106 |
+ function(object,...) { |
|
107 |
+ object@phylo |
|
108 |
+ } |
|
109 |
+ ) |
|
110 |
+ |
|
111 |
+ |
|
112 |
+##' @rdname get.fields-methods |
|
113 |
+##' @exportMethod get.fields |
|
114 |
+setMethod("get.fields", signature(object="apeBootstrap"), |
|
115 |
+ function(object, ...) { |
|
116 |
+ get.fields.tree(object) |
|
117 |
+ } |
|
118 |
+ ) |
|
119 |
+ |
git-svn-id: https://hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/ggtree@98386 bc3139a8-67e5-0310-9ffc-ced21a209358
1 | 1 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,45 @@ |
1 |
+##' read newick tree |
|
2 |
+##' @export |
|
3 |
+##' @rdname read.tree |
|
4 |
+##' @param file file name |
|
5 |
+##' @param text alternatively, using newick text |
|
6 |
+##' @param tree.names if read several trees, specify their names |
|
7 |
+##' @param skip number of lines of the input file to skip |
|
8 |
+##' @param comment.char a single character, |
|
9 |
+##' the remaining of the line after this character is ignored. |
|
10 |
+##' @param keep.multi if 'TRUE' and 'tree.names = NULL' |
|
11 |
+##' then single trees are returned in 'multiPhylo' format |
|
12 |
+##' with any name that is present. Default is 'FALSE' |
|
13 |
+##' @param ... further arguments to be passed to 'scan()'. |
|
14 |
+##' @source |
|
15 |
+##' This is just the imported function |
|
16 |
+##' from the ape package. The documentation you should |
|
17 |
+##' read for the read.tree function can be found here: \link[ape]{read.tree} |
|
18 |
+##' |
|
19 |
+##' @seealso |
|
20 |
+##' \link[ape]{read.tree} |
|
21 |
+read.tree <- ape::read.tree |
|
22 |
+ |
|
23 |
+ |
|
24 |
+##' generate random tree |
|
25 |
+##' @export |
|
26 |
+##' @rdname rtree |
|
27 |
+##' @param n number of tips in the tree |
|
28 |
+##' @param rooted logcial |
|
29 |
+##' @param tip.label tip label |
|
30 |
+##' @param br one of the following: (i) an R function used to generate the |
|
31 |
+##' branch lengths ('rtree'; use 'NULL' to simulate only a |
|
32 |
+##' topology), or the coalescence times ('rcoal'); (ii) a |
|
33 |
+##' character to simulate a genuine coalescent tree for 'rcoal' |
|
34 |
+##' (the default); or (iii) a numeric vector for the branch |
|
35 |
+##' lengths or the coalescence times. |
|
36 |
+##' @param ... additional parameters to be passed to 'br' |
|
37 |
+##' @source |
|
38 |
+##' This is just the imported function |
|
39 |
+##' from the ape package. The documentation you should |
|
40 |
+##' read for the rtree function can be found here: \link[ape]{rtree} |
|
41 |
+##' |
|
42 |
+##' @seealso |
|
43 |
+##' \link[ape]{rtree} |
|
44 |
+rtree <- ape::rtree |
|
45 |
+ |