1 | 1 |
deleted file mode 100644 |
... | ... |
@@ -1,90 +0,0 @@ |
1 |
-## ##' @rdname get.tree-methods |
|
2 |
-## ##' @exportMethod get.tree |
|
3 |
-## setMethod("get.tree", signature(object="apeBootstrap"), |
|
4 |
-## function(object,...) { |
|
5 |
-## object@phylo |
|
6 |
-## } |
|
7 |
-## ) |
|
8 |
- |
|
9 |
-## ##' get.tree method |
|
10 |
-## ##' |
|
11 |
-## ##' |
|
12 |
-## ##' @docType methods |
|
13 |
-## ##' @name get.tree |
|
14 |
-## ##' @rdname get.tree-methods |
|
15 |
-## ##' @aliases get.tree,beast |
|
16 |
-## ##' @exportMethod get.tree |
|
17 |
-## ##' @author Guangchuang Yu \url{http://guangchuangyu.github.io} |
|
18 |
-## ##' @usage get.tree(object, ...) |
|
19 |
-## setMethod("get.tree", signature(object="beast"), |
|
20 |
-## function(object,...) { |
|
21 |
-## object@phylo |
|
22 |
-## } |
|
23 |
-## ) |
|
24 |
- |
|
25 |
- |
|
26 |
-## ##' @rdname get.tree-methods |
|
27 |
-## ##' @exportMethod get.tree |
|
28 |
-## ##' @param by one of rst or mlc |
|
29 |
-## setMethod("get.tree", signature(object="codeml"), |
|
30 |
-## function(object, by="rst", ...) { |
|
31 |
-## if (by == "rst") { |
|
32 |
-## return(object@rst@phylo) |
|
33 |
-## } else { |
|
34 |
-## return(object@mlc@phylo) |
|
35 |
-## } |
|
36 |
-## }) |
|
37 |
- |
|
38 |
- |
|
39 |
-## ##' @rdname get.tree-methods |
|
40 |
-## ##' @exportMethod get.tree |
|
41 |
-## setMethod("get.tree", signature(object="jplace"), |
|
42 |
-## function(object) { |
|
43 |
-## object@phylo |
|
44 |
-## }) |
|
45 |
- |
|
46 |
-## ##' @rdname get.tree-methods |
|
47 |
-## ##' @exportMethod get.tree |
|
48 |
-## setMethod("get.tree", signature(object = "nhx"), |
|
49 |
-## function(object) { |
|
50 |
-## object@phylo |
|
51 |
-## } |
|
52 |
-## ) |
|
53 |
- |
|
54 |
-## ##' @rdname get.tree-methods |
|
55 |
-## ##' @exportMethod get.tree |
|
56 |
-## setMethod("get.tree", signature(object="phylip"), |
|
57 |
-## function(object,...) { |
|
58 |
-## object@phylo |
|
59 |
-## } |
|
60 |
-## ) |
|
61 |
- |
|
62 |
-## ##' @rdname get.tree-methods |
|
63 |
-## ##' @exportMethod get.tree |
|
64 |
-## setMethod("get.tree", signature(object="phylo"), |
|
65 |
-## function(object, ...) { |
|
66 |
-## return(object) |
|
67 |
-## }) |
|
68 |
- |
|
69 |
-## ##' @rdname get.tree-methods |
|
70 |
-## ##' @exportMethod get.tree |
|
71 |
-## setMethod("get.tree", signature(object="data.frame"), |
|
72 |
-## function(object, ...) { |
|
73 |
-## edge <- object[, c("parent", "node")] |
|
74 |
-## i <- which(edge[,1] != 0 & edge[,1] != edge[,2]) |
|
75 |
-## edge <- edge[i, ] |
|
76 |
-## edge.length <- object[i, "branch.length"] |
|
77 |
-## tip.label <- object[object[, "isTip"], "label"] |
|
78 |
-## phylo <- list(edge = as.matrix(edge), |
|
79 |
-## edge.length = edge.length, |
|
80 |
-## tip.label = tip.label) |
|
81 |
- |
|
82 |
-## node.label <- object[!object[, "isTip"], "label"] |
|
83 |
-## if (!all(is.na(node.label))) { |
|
84 |
-## phylo$node.label <- node.label |
|
85 |
-## } |
|
86 |
-## phylo$Nnode <- sum(!object[, "isTip"]) |
|
87 |
-## class(phylo) <- "phylo" |
|
88 |
-## return(phylo) |
|
89 |
-## }) |
|
90 |
- |
... | ... |
@@ -1,90 +1,90 @@ |
1 |
-##' @rdname get.tree-methods |
|
2 |
-##' @exportMethod get.tree |
|
3 |
-setMethod("get.tree", signature(object="apeBootstrap"), |
|
4 |
- function(object,...) { |
|
5 |
- object@phylo |
|
6 |
- } |
|
7 |
- ) |
|
1 |
+## ##' @rdname get.tree-methods |
|
2 |
+## ##' @exportMethod get.tree |
|
3 |
+## setMethod("get.tree", signature(object="apeBootstrap"), |
|
4 |
+## function(object,...) { |
|
5 |
+## object@phylo |
|
6 |
+## } |
|
7 |
+## ) |
|
8 | 8 |
|
9 |
-##' get.tree method |
|
10 |
-##' |
|
11 |
-##' |
|
12 |
-##' @docType methods |
|
13 |
-##' @name get.tree |
|
14 |
-##' @rdname get.tree-methods |
|
15 |
-##' @aliases get.tree,beast |
|
16 |
-##' @exportMethod get.tree |
|
17 |
-##' @author Guangchuang Yu \url{http://guangchuangyu.github.io} |
|
18 |
-##' @usage get.tree(object, ...) |
|
19 |
-setMethod("get.tree", signature(object="beast"), |
|
20 |
- function(object,...) { |
|
21 |
- object@phylo |
|
22 |
- } |
|
23 |
- ) |
|
9 |
+## ##' get.tree method |
|
10 |
+## ##' |
|
11 |
+## ##' |
|
12 |
+## ##' @docType methods |
|
13 |
+## ##' @name get.tree |
|
14 |
+## ##' @rdname get.tree-methods |
|
15 |
+## ##' @aliases get.tree,beast |
|
16 |
+## ##' @exportMethod get.tree |
|
17 |
+## ##' @author Guangchuang Yu \url{http://guangchuangyu.github.io} |
|
18 |
+## ##' @usage get.tree(object, ...) |
|
19 |
+## setMethod("get.tree", signature(object="beast"), |
|
20 |
+## function(object,...) { |
|
21 |
+## object@phylo |
|
22 |
+## } |
|
23 |
+## ) |
|
24 | 24 |
|
25 | 25 |
|
26 |
-##' @rdname get.tree-methods |
|
27 |
-##' @exportMethod get.tree |
|
28 |
-##' @param by one of rst or mlc |
|
29 |
-setMethod("get.tree", signature(object="codeml"), |
|
30 |
- function(object, by="rst", ...) { |
|
31 |
- if (by == "rst") { |
|
32 |
- return(object@rst@phylo) |
|
33 |
- } else { |
|
34 |
- return(object@mlc@phylo) |
|
35 |
- } |
|
36 |
- }) |
|
26 |
+## ##' @rdname get.tree-methods |
|
27 |
+## ##' @exportMethod get.tree |
|
28 |
+## ##' @param by one of rst or mlc |
|
29 |
+## setMethod("get.tree", signature(object="codeml"), |
|
30 |
+## function(object, by="rst", ...) { |
|
31 |
+## if (by == "rst") { |
|
32 |
+## return(object@rst@phylo) |
|
33 |
+## } else { |
|
34 |
+## return(object@mlc@phylo) |
|
35 |
+## } |
|
36 |
+## }) |
|
37 | 37 |
|
38 | 38 |
|
39 |
-##' @rdname get.tree-methods |
|
40 |
-##' @exportMethod get.tree |
|
41 |
-setMethod("get.tree", signature(object="jplace"), |
|
42 |
- function(object) { |
|
43 |
- object@phylo |
|
44 |
- }) |
|
39 |
+## ##' @rdname get.tree-methods |
|
40 |
+## ##' @exportMethod get.tree |
|
41 |
+## setMethod("get.tree", signature(object="jplace"), |
|
42 |
+## function(object) { |
|
43 |
+## object@phylo |
|
44 |
+## }) |
|
45 | 45 |
|
46 |
-##' @rdname get.tree-methods |
|
47 |
-##' @exportMethod get.tree |
|
48 |
-setMethod("get.tree", signature(object = "nhx"), |
|
49 |
- function(object) { |
|
50 |
- object@phylo |
|
51 |
- } |
|
52 |
- ) |
|
46 |
+## ##' @rdname get.tree-methods |
|
47 |
+## ##' @exportMethod get.tree |
|
48 |
+## setMethod("get.tree", signature(object = "nhx"), |
|
49 |
+## function(object) { |
|
50 |
+## object@phylo |
|
51 |
+## } |
|
52 |
+## ) |
|
53 | 53 |
|
54 |
-##' @rdname get.tree-methods |
|
55 |
-##' @exportMethod get.tree |
|
56 |
-setMethod("get.tree", signature(object="phylip"), |
|
57 |
- function(object,...) { |
|
58 |
- object@phylo |
|
59 |
- } |
|
60 |
- ) |
|
54 |
+## ##' @rdname get.tree-methods |
|
55 |
+## ##' @exportMethod get.tree |
|
56 |
+## setMethod("get.tree", signature(object="phylip"), |
|
57 |
+## function(object,...) { |
|
58 |
+## object@phylo |
|
59 |
+## } |
|
60 |
+## ) |
|
61 | 61 |
|
62 |
-##' @rdname get.tree-methods |
|
63 |
-##' @exportMethod get.tree |
|
64 |
-setMethod("get.tree", signature(object="phylo"), |
|
65 |
- function(object, ...) { |
|
66 |
- return(object) |
|
67 |
- }) |
|
62 |
+## ##' @rdname get.tree-methods |
|
63 |
+## ##' @exportMethod get.tree |
|
64 |
+## setMethod("get.tree", signature(object="phylo"), |
|
65 |
+## function(object, ...) { |
|
66 |
+## return(object) |
|
67 |
+## }) |
|
68 | 68 |
|
69 |
-##' @rdname get.tree-methods |
|
70 |
-##' @exportMethod get.tree |
|
71 |
-setMethod("get.tree", signature(object="data.frame"), |
|
72 |
- function(object, ...) { |
|
73 |
- edge <- object[, c("parent", "node")] |
|
74 |
- i <- which(edge[,1] != 0 & edge[,1] != edge[,2]) |
|
75 |
- edge <- edge[i, ] |
|
76 |
- edge.length <- object[i, "branch.length"] |
|
77 |
- tip.label <- object[object[, "isTip"], "label"] |
|
78 |
- phylo <- list(edge = as.matrix(edge), |
|
79 |
- edge.length = edge.length, |
|
80 |
- tip.label = tip.label) |
|
69 |
+## ##' @rdname get.tree-methods |
|
70 |
+## ##' @exportMethod get.tree |
|
71 |
+## setMethod("get.tree", signature(object="data.frame"), |
|
72 |
+## function(object, ...) { |
|
73 |
+## edge <- object[, c("parent", "node")] |
|
74 |
+## i <- which(edge[,1] != 0 & edge[,1] != edge[,2]) |
|
75 |
+## edge <- edge[i, ] |
|
76 |
+## edge.length <- object[i, "branch.length"] |
|
77 |
+## tip.label <- object[object[, "isTip"], "label"] |
|
78 |
+## phylo <- list(edge = as.matrix(edge), |
|
79 |
+## edge.length = edge.length, |
|
80 |
+## tip.label = tip.label) |
|
81 | 81 |
|
82 |
- node.label <- object[!object[, "isTip"], "label"] |
|
83 |
- if (!all(is.na(node.label))) { |
|
84 |
- phylo$node.label <- node.label |
|
85 |
- } |
|
86 |
- phylo$Nnode <- sum(!object[, "isTip"]) |
|
87 |
- class(phylo) <- "phylo" |
|
88 |
- return(phylo) |
|
89 |
- }) |
|
82 |
+## node.label <- object[!object[, "isTip"], "label"] |
|
83 |
+## if (!all(is.na(node.label))) { |
|
84 |
+## phylo$node.label <- node.label |
|
85 |
+## } |
|
86 |
+## phylo$Nnode <- sum(!object[, "isTip"]) |
|
87 |
+## class(phylo) <- "phylo" |
|
88 |
+## return(phylo) |
|
89 |
+## }) |
|
90 | 90 |
|
... | ... |
@@ -65,20 +65,21 @@ setMethod("get.tree", signature(object="phylo"), |
65 | 65 |
function(object, ...) { |
66 | 66 |
return(object) |
67 | 67 |
}) |
68 |
- |
|
68 |
+ |
|
69 | 69 |
##' @rdname get.tree-methods |
70 | 70 |
##' @exportMethod get.tree |
71 | 71 |
setMethod("get.tree", signature(object="data.frame"), |
72 | 72 |
function(object, ...) { |
73 |
+ edge <- object[, c("parent", "node")] |
|
73 | 74 |
i <- which(edge[,1] != 0 & edge[,1] != edge[,2]) |
74 | 75 |
edge <- edge[i, ] |
75 | 76 |
edge.length <- object[i, "branch.length"] |
76 |
- tip.label <- object[object[, "isTip"], "label"] |
|
77 |
- phylo <- list(edge = edge, |
|
77 |
+ tip.label <- object[object[, "isTip"], "label"] |
|
78 |
+ phylo <- list(edge = as.matrix(edge), |
|
78 | 79 |
edge.length = edge.length, |
79 | 80 |
tip.label = tip.label) |
80 | 81 |
|
81 |
- node.label <- object[!object[, "isTip"], "label"] |
|
82 |
+ node.label <- object[!object[, "isTip"], "label"] |
|
82 | 83 |
if (!all(is.na(node.label))) { |
83 | 84 |
phylo$node.label <- node.label |
84 | 85 |
} |
... | ... |
@@ -65,3 +65,24 @@ setMethod("get.tree", signature(object="phylo"), |
65 | 65 |
function(object, ...) { |
66 | 66 |
return(object) |
67 | 67 |
}) |
68 |
+ |
|
69 |
+##' @rdname get.tree-methods |
|
70 |
+##' @exportMethod get.tree |
|
71 |
+setMethod("get.tree", signature(object="data.frame"), |
|
72 |
+ function(object, ...) { |
|
73 |
+ i <- which(edge[,1] != 0 & edge[,1] != edge[,2]) |
|
74 |
+ edge <- edge[i, ] |
|
75 |
+ edge.length <- object[i, "branch.length"] |
|
76 |
+ tip.label <- object[object[, "isTip"], "label"] |
|
77 |
+ phylo <- list(edge = edge, |
|
78 |
+ edge.length = edge.length, |
|
79 |
+ tip.label = tip.label) |
|
80 |
+ |
|
81 |
+ node.label <- object[!object[, "isTip"], "label"] |
|
82 |
+ if (!all(is.na(node.label))) { |
|
83 |
+ phylo$node.label <- node.label |
|
84 |
+ } |
|
85 |
+ phylo$Nnode <- sum(!object[, "isTip"]) |
|
86 |
+ class(phylo) <- "phylo" |
|
87 |
+ return(phylo) |
|
88 |
+ }) |
|
68 | 89 |
\ No newline at end of file |
git-svn-id: https://hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/ggtree@118092 bc3139a8-67e5-0310-9ffc-ced21a209358
git-svn-id: https://hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/ggtree@112578 bc3139a8-67e5-0310-9ffc-ced21a209358
1 | 1 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,61 @@ |
1 |
+##' @rdname get.tree-methods |
|
2 |
+##' @exportMethod get.tree |
|
3 |
+setMethod("get.tree", signature(object="apeBootstrap"), |
|
4 |
+ function(object,...) { |
|
5 |
+ object@phylo |
|
6 |
+ } |
|
7 |
+ ) |
|
8 |
+ |
|
9 |
+##' get.tree method |
|
10 |
+##' |
|
11 |
+##' |
|
12 |
+##' @docType methods |
|
13 |
+##' @name get.tree |
|
14 |
+##' @rdname get.tree-methods |
|
15 |
+##' @aliases get.tree,beast |
|
16 |
+##' @exportMethod get.tree |
|
17 |
+##' @author Guangchuang Yu \url{http://guangchuangyu.github.io} |
|
18 |
+##' @usage get.tree(object, ...) |
|
19 |
+setMethod("get.tree", signature(object="beast"), |
|
20 |
+ function(object,...) { |
|
21 |
+ object@phylo |
|
22 |
+ } |
|
23 |
+ ) |
|
24 |
+ |
|
25 |
+ |
|
26 |
+##' @rdname get.tree-methods |
|
27 |
+##' @exportMethod get.tree |
|
28 |
+##' @param by one of rst or mlc |
|
29 |
+setMethod("get.tree", signature(object="codeml"), |
|
30 |
+ function(object, by="rst", ...) { |
|
31 |
+ if (by == "rst") { |
|
32 |
+ return(object@rst@phylo) |
|
33 |
+ } else { |
|
34 |
+ return(object@mlc@phylo) |
|
35 |
+ } |
|
36 |
+ }) |
|
37 |
+ |
|
38 |
+ |
|
39 |
+##' @rdname get.tree-methods |
|
40 |
+##' @exportMethod get.tree |
|
41 |
+setMethod("get.tree", signature(object="jplace"), |
|
42 |
+ function(object) { |
|
43 |
+ object@phylo |
|
44 |
+ }) |
|
45 |
+ |
|
46 |
+##' @rdname get.tree-methods |
|
47 |
+##' @exportMethod get.tree |
|
48 |
+setMethod("get.tree", signature(object = "nhx"), |
|
49 |
+ function(object) { |
|
50 |
+ object@phylo |
|
51 |
+ } |
|
52 |
+ ) |
|
53 |
+ |
|
54 |
+##' @rdname get.tree-methods |
|
55 |
+##' @exportMethod get.tree |
|
56 |
+setMethod("get.tree", signature(object="phylip"), |
|
57 |
+ function(object,...) { |
|
58 |
+ object@phylo |
|
59 |
+ } |
|
60 |
+ ) |
|
61 |
+ |