Browse code

remove paml_rst, codeml_mlc, codeml and jplace fortify methods according to the change of treeio (v = 1.3.3)

guangchuang yu authored on 07/12/2017 07:21:58
Showing 1 changed files
1 1
deleted file mode 100644
... ...
@@ -1,175 +0,0 @@
1
-## ##' @rdname show-methods
2
-## ##' @importFrom ape print.phylo
3
-## ##' @exportMethod show
4
-## setMethod("show", signature(object = "beast"),
5
-##           function(object) {
6
-##               cat("'beast' S4 object that stored information of\n\t",
7
-##                   paste0("'", object@file, "'.\n\n"))
8
-##               cat("...@ tree: ")
9
-##               print.phylo(get.tree(object))
10
-##               cat("\nwith the following features available:\n")
11
-##               print_fields(object)
12
-##           })
13
-
14
-## ##' @rdname show-methods
15
-## ##' @exportMethod show
16
-## setMethod("show", signature(object = "codeml"),
17
-##           function(object) {
18
-##               cat("'codeml' S4 object that stored information of\n\t",
19
-##                   paste0("'", object@rst@rstfile, "' and \n\t'",
20
-##                          object@mlc@mlcfile, "'."),
21
-##                   "\n\n")
22
-##               cat("...@ tree:")
23
-##               print.phylo(get.tree(object))
24
-##               cat("\nwith the following features available:\n")
25
-##               print_fields(object, len=4)
26
-##           })
27
-
28
-## ##' @rdname show-methods
29
-## ##' @exportMethod show
30
-## setMethod("show", signature(object = "codeml_mlc"),
31
-##           function(object) {
32
-##               cat("'codeml_mlc' S4 object that stored information of\n\t",
33
-##                   paste0("'", object@mlcfile, "'."),
34
-##                   "\n\n")
35
-
36
-##               cat("...@ tree:")
37
-##               print.phylo(get.tree(object))
38
-
39
-##               cat("\nwith the following features available:\n")
40
-##               cat("\t", paste0("'",
41
-##                                  paste(get.fields(object), collapse="',\t'"),
42
-##                                  "'."),
43
-##                   "\n")
44
-##           }
45
-##           )
46
-
47
-## ##' show method for \code{jplace} instance
48
-## ##'
49
-## ##'
50
-## ##' @name show
51
-## ##' @docType methods
52
-## ##' @rdname show-methods
53
-## ##'
54
-## ##' @title show method
55
-## ##' @param object one of \code{jplace}, \code{beast} object
56
-## ##' @return print info
57
-## ##' @importFrom methods show
58
-## ##' @exportMethod show
59
-## ##' @usage show(object)
60
-## ##' @author Guangchuang Yu \url{http://ygc.name}
61
-## ##' @examples
62
-## ##' jp <- system.file("extdata", "sample.jplace", package="ggtree")
63
-## ##' jp <- read.jplace(jp)
64
-## ##' show(jp)
65
-## setMethod("show", signature(object = "jplace"),
66
-##           function(object) {
67
-##               cat("'jplace' S4 object that stored information of\n\t",
68
-##                   paste0("'", object@file, "'."),
69
-##                   "\n\n")
70
-
71
-##               cat("...@ tree: ")
72
-
73
-##               phylo <- get.tree(object)
74
-##               phylo$node.label <- NULL
75
-##               phylo$tip.label %<>% gsub("\\@\\d+", "", .)
76
-
77
-##               print.phylo(phylo)
78
-
79
-##               cat("\nwith the following features availables:\n")
80
-##               cat("\t", paste0("'",
81
-##                                paste(get.fields(object), collapse="',\t'"),
82
-##                                "'."),
83
-##                   "\n")
84
-##           }
85
-##           )
86
-
87
-
88
-## ##' @rdname show-methods
89
-## ##' @exportMethod show
90
-## setMethod("show", signature(object = "nhx"),
91
-##           function(object) {
92
-##               cat("'nhx' S4 object that stored information of\n\t",
93
-##                   paste0("'", object@file, "'.\n\n"))
94
-##               cat("...@ tree: ")
95
-##               print.phylo(get.tree(object))
96
-##               cat("\nwith the following features available:\n")
97
-##               print_fields(object)
98
-##           })
99
-
100
-
101
-## ##' @rdname show-methods
102
-## ##' @exportMethod show
103
-## setMethod("show", signature(object = "phylip"),
104
-##           function(object) {
105
-##               cat("'phylip' S4 object that stored information of\n\t",
106
-##                   paste0("'", object@file, "'.\n\n"))
107
-##               cat("...@ tree: ")
108
-##               print.phylo(get.tree(object))
109
-##               msg <- paste0("\nwith sequence alignment available (", length(object@sequence),
110
-##                             " sequences of length ", nchar(object@sequence)[1], ")\n")
111
-##               cat(msg)
112
-##           })
113
-
114
-## ##' @rdname show-methods
115
-## ##' @exportMethod show
116
-## setMethod("show", signature(object = "paml_rst"),
117
-##           function(object) {
118
-##               cat("'paml_rst' S4 object that stored information of\n\t",
119
-##                   paste0("'", object@rstfile, "'.\n\n"))
120
-##               ## if (length(object@tip.fasfile) != 0) {
121
-##               ##     cat(paste0(" and \n\t'", object@tip.fasfile, "'.\n\n"))
122
-##               ## } else {
123
-##               ##     cat(".\n\n")
124
-##               ## }
125
-##               fields <- get.fields(object)
126
-
127
-##               if (nrow(object@marginal_subs) == 0) {
128
-##                   fields <- fields[fields != "marginal_subs"]
129
-##                   fields <- fields[fields != "marginal_AA_subs"]
130
-##               }
131
-##               if (nrow(object@joint_subs) == 0) {
132
-##                   fields <- fields[fields != "joint_subs"]
133
-##                   fields <- fields[fields != "joint_AA_subs"]
134
-##               }
135
-
136
-##               cat("...@ tree:")
137
-##               print.phylo(get.tree(object))
138
-##               cat("\nwith the following features available:\n")
139
-##               cat("\t", paste0("'",
140
-##                                paste(fields, collapse="',\t'"),
141
-##                                "'."),
142
-##                   "\n")
143
-##           })
144
-
145
-
146
-
147
-## ##' @rdname show-methods
148
-## ##' @importFrom ape print.phylo
149
-## ##' @exportMethod show
150
-## setMethod("show", signature(object = "r8s"),
151
-##           function(object) {
152
-##               cat("'r8s' S4 object that stored information of\n\t",
153
-##                   paste0("'", object@file, "'.\n\n"))
154
-##               cat("...@ tree: ")
155
-##               print.phylo(get.tree(object))
156
-##               ## cat("\nwith the following features available:\n")
157
-##               ## print_fields(object)
158
-##           })
159
-
160
-
161
-## ##' @rdname show-methods
162
-## ##' @importFrom ape print.phylo
163
-## ##' @exportMethod show
164
-## setMethod("show", signature(object = "phangorn"),
165
-##           function(object) {
166
-##               cat("'phangorn' S4 object that stored ancestral sequences inferred by 'phangorn::ancestral.pml'", ".\n\n")
167
-##               cat("...@ tree: ")
168
-##               print.phylo(get.tree(object))
169
-##               fields <- get.fields(object)
170
-##               cat("\nwith the following features available:\n")
171
-##               cat("\t", paste0("'",
172
-##                                paste(fields, collapse="',\t'"),
173
-##                                "'."),
174
-##                   "\n")
175
-##           })
Browse code

depends treeio

GuangchuangYu authored on 20/12/2016 16:39:07
Showing 1 changed files
... ...
@@ -1,175 +1,175 @@
1
-##' @rdname show-methods
2
-##' @importFrom ape print.phylo
3
-##' @exportMethod show
4
-setMethod("show", signature(object = "beast"),
5
-          function(object) {
6
-              cat("'beast' S4 object that stored information of\n\t",
7
-                  paste0("'", object@file, "'.\n\n"))
8
-              cat("...@ tree: ")
9
-              print.phylo(get.tree(object))
10
-              cat("\nwith the following features available:\n")
11
-              print_fields(object)
12
-          })
13
-
14
-##' @rdname show-methods
15
-##' @exportMethod show
16
-setMethod("show", signature(object = "codeml"),
17
-          function(object) {
18
-              cat("'codeml' S4 object that stored information of\n\t",
19
-                  paste0("'", object@rst@rstfile, "' and \n\t'",
20
-                         object@mlc@mlcfile, "'."),
21
-                  "\n\n")
22
-              cat("...@ tree:")
23
-              print.phylo(get.tree(object))
24
-              cat("\nwith the following features available:\n")
25
-              print_fields(object, len=4)
26
-          })
27
-
28
-##' @rdname show-methods
29
-##' @exportMethod show
30
-setMethod("show", signature(object = "codeml_mlc"),
31
-          function(object) {
32
-              cat("'codeml_mlc' S4 object that stored information of\n\t",
33
-                  paste0("'", object@mlcfile, "'."),
34
-                  "\n\n")
35
-
36
-              cat("...@ tree:")
37
-              print.phylo(get.tree(object))
38
-
39
-              cat("\nwith the following features available:\n")
40
-              cat("\t", paste0("'",
41
-                                 paste(get.fields(object), collapse="',\t'"),
42
-                                 "'."),
43
-                  "\n")
44
-          }
45
-          )
46
-
47
-##' show method for \code{jplace} instance
48
-##'
49
-##'
50
-##' @name show
51
-##' @docType methods
52
-##' @rdname show-methods
53
-##'
54
-##' @title show method
55
-##' @param object one of \code{jplace}, \code{beast} object
56
-##' @return print info
57
-##' @importFrom methods show
58
-##' @exportMethod show
59
-##' @usage show(object)
60
-##' @author Guangchuang Yu \url{http://ygc.name}
61
-##' @examples
62
-##' jp <- system.file("extdata", "sample.jplace", package="ggtree")
63
-##' jp <- read.jplace(jp)
64
-##' show(jp)
65
-setMethod("show", signature(object = "jplace"),
66
-          function(object) {
67
-              cat("'jplace' S4 object that stored information of\n\t",
68
-                  paste0("'", object@file, "'."),
69
-                  "\n\n")
70
-
71
-              cat("...@ tree: ")
72
-
73
-              phylo <- get.tree(object)
74
-              phylo$node.label <- NULL
75
-              phylo$tip.label %<>% gsub("\\@\\d+", "", .)
76
-
77
-              print.phylo(phylo)
78
-
79
-              cat("\nwith the following features availables:\n")
80
-              cat("\t", paste0("'",
81
-                               paste(get.fields(object), collapse="',\t'"),
82
-                               "'."),
83
-                  "\n")
84
-          }
85
-          )
86
-
87
-
88
-##' @rdname show-methods
89
-##' @exportMethod show
90
-setMethod("show", signature(object = "nhx"),
91
-          function(object) {
92
-              cat("'nhx' S4 object that stored information of\n\t",
93
-                  paste0("'", object@file, "'.\n\n"))
94
-              cat("...@ tree: ")
95
-              print.phylo(get.tree(object))
96
-              cat("\nwith the following features available:\n")
97
-              print_fields(object)
98
-          })
99
-
100
-
101
-##' @rdname show-methods
102
-##' @exportMethod show
103
-setMethod("show", signature(object = "phylip"),
104
-          function(object) {
105
-              cat("'phylip' S4 object that stored information of\n\t",
106
-                  paste0("'", object@file, "'.\n\n"))
107
-              cat("...@ tree: ")
108
-              print.phylo(get.tree(object))
109
-              msg <- paste0("\nwith sequence alignment available (", length(object@sequence),
110
-                            " sequences of length ", nchar(object@sequence)[1], ")\n")
111
-              cat(msg)
112
-          })
113
-
114
-##' @rdname show-methods
115
-##' @exportMethod show
116
-setMethod("show", signature(object = "paml_rst"),
117
-          function(object) {
118
-              cat("'paml_rst' S4 object that stored information of\n\t",
119
-                  paste0("'", object@rstfile, "'.\n\n"))
120
-              ## if (length(object@tip.fasfile) != 0) {
121
-              ##     cat(paste0(" and \n\t'", object@tip.fasfile, "'.\n\n"))
122
-              ## } else {
123
-              ##     cat(".\n\n")
124
-              ## }
125
-              fields <- get.fields(object)
126
-
127
-              if (nrow(object@marginal_subs) == 0) {
128
-                  fields <- fields[fields != "marginal_subs"]
129
-                  fields <- fields[fields != "marginal_AA_subs"]
130
-              }
131
-              if (nrow(object@joint_subs) == 0) {
132
-                  fields <- fields[fields != "joint_subs"]
133
-                  fields <- fields[fields != "joint_AA_subs"]
134
-              }
135
-
136
-              cat("...@ tree:")
137
-              print.phylo(get.tree(object))
138
-              cat("\nwith the following features available:\n")
139
-              cat("\t", paste0("'",
140
-                               paste(fields, collapse="',\t'"),
141
-                               "'."),
142
-                  "\n")
143
-          })
144
-
145
-
146
-
147
-##' @rdname show-methods
148
-##' @importFrom ape print.phylo
149
-##' @exportMethod show
150
-setMethod("show", signature(object = "r8s"),
151
-          function(object) {
152
-              cat("'r8s' S4 object that stored information of\n\t",
153
-                  paste0("'", object@file, "'.\n\n"))
154
-              cat("...@ tree: ")
155
-              print.phylo(get.tree(object))
156
-              ## cat("\nwith the following features available:\n")
157
-              ## print_fields(object)
158
-          })
159
-
160
-
161
-##' @rdname show-methods
162
-##' @importFrom ape print.phylo
163
-##' @exportMethod show
164
-setMethod("show", signature(object = "phangorn"),
165
-          function(object) {
166
-              cat("'phangorn' S4 object that stored ancestral sequences inferred by 'phangorn::ancestral.pml'", ".\n\n")
167
-              cat("...@ tree: ")
168
-              print.phylo(get.tree(object))
169
-              fields <- get.fields(object)
170
-              cat("\nwith the following features available:\n")
171
-              cat("\t", paste0("'",
172
-                               paste(fields, collapse="',\t'"),
173
-                               "'."),
174
-                  "\n")
175
-          })
1
+## ##' @rdname show-methods
2
+## ##' @importFrom ape print.phylo
3
+## ##' @exportMethod show
4
+## setMethod("show", signature(object = "beast"),
5
+##           function(object) {
6
+##               cat("'beast' S4 object that stored information of\n\t",
7
+##                   paste0("'", object@file, "'.\n\n"))
8
+##               cat("...@ tree: ")
9
+##               print.phylo(get.tree(object))
10
+##               cat("\nwith the following features available:\n")
11
+##               print_fields(object)
12
+##           })
13
+
14
+## ##' @rdname show-methods
15
+## ##' @exportMethod show
16
+## setMethod("show", signature(object = "codeml"),
17
+##           function(object) {
18
+##               cat("'codeml' S4 object that stored information of\n\t",
19
+##                   paste0("'", object@rst@rstfile, "' and \n\t'",
20
+##                          object@mlc@mlcfile, "'."),
21
+##                   "\n\n")
22
+##               cat("...@ tree:")
23
+##               print.phylo(get.tree(object))
24
+##               cat("\nwith the following features available:\n")
25
+##               print_fields(object, len=4)
26
+##           })
27
+
28
+## ##' @rdname show-methods
29
+## ##' @exportMethod show
30
+## setMethod("show", signature(object = "codeml_mlc"),
31
+##           function(object) {
32
+##               cat("'codeml_mlc' S4 object that stored information of\n\t",
33
+##                   paste0("'", object@mlcfile, "'."),
34
+##                   "\n\n")
35
+
36
+##               cat("...@ tree:")
37
+##               print.phylo(get.tree(object))
38
+
39
+##               cat("\nwith the following features available:\n")
40
+##               cat("\t", paste0("'",
41
+##                                  paste(get.fields(object), collapse="',\t'"),
42
+##                                  "'."),
43
+##                   "\n")
44
+##           }
45
+##           )
46
+
47
+## ##' show method for \code{jplace} instance
48
+## ##'
49
+## ##'
50
+## ##' @name show
51
+## ##' @docType methods
52
+## ##' @rdname show-methods
53
+## ##'
54
+## ##' @title show method
55
+## ##' @param object one of \code{jplace}, \code{beast} object
56
+## ##' @return print info
57
+## ##' @importFrom methods show
58
+## ##' @exportMethod show
59
+## ##' @usage show(object)
60
+## ##' @author Guangchuang Yu \url{http://ygc.name}
61
+## ##' @examples
62
+## ##' jp <- system.file("extdata", "sample.jplace", package="ggtree")
63
+## ##' jp <- read.jplace(jp)
64
+## ##' show(jp)
65
+## setMethod("show", signature(object = "jplace"),
66
+##           function(object) {
67
+##               cat("'jplace' S4 object that stored information of\n\t",
68
+##                   paste0("'", object@file, "'."),
69
+##                   "\n\n")
70
+
71
+##               cat("...@ tree: ")
72
+
73
+##               phylo <- get.tree(object)
74
+##               phylo$node.label <- NULL
75
+##               phylo$tip.label %<>% gsub("\\@\\d+", "", .)
76
+
77
+##               print.phylo(phylo)
78
+
79
+##               cat("\nwith the following features availables:\n")
80
+##               cat("\t", paste0("'",
81
+##                                paste(get.fields(object), collapse="',\t'"),
82
+##                                "'."),
83
+##                   "\n")
84
+##           }
85
+##           )
86
+
87
+
88
+## ##' @rdname show-methods
89
+## ##' @exportMethod show
90
+## setMethod("show", signature(object = "nhx"),
91
+##           function(object) {
92
+##               cat("'nhx' S4 object that stored information of\n\t",
93
+##                   paste0("'", object@file, "'.\n\n"))
94
+##               cat("...@ tree: ")
95
+##               print.phylo(get.tree(object))
96
+##               cat("\nwith the following features available:\n")
97
+##               print_fields(object)
98
+##           })
99
+
100
+
101
+## ##' @rdname show-methods
102
+## ##' @exportMethod show
103
+## setMethod("show", signature(object = "phylip"),
104
+##           function(object) {
105
+##               cat("'phylip' S4 object that stored information of\n\t",
106
+##                   paste0("'", object@file, "'.\n\n"))
107
+##               cat("...@ tree: ")
108
+##               print.phylo(get.tree(object))
109
+##               msg <- paste0("\nwith sequence alignment available (", length(object@sequence),
110
+##                             " sequences of length ", nchar(object@sequence)[1], ")\n")
111
+##               cat(msg)
112
+##           })
113
+
114
+## ##' @rdname show-methods
115
+## ##' @exportMethod show
116
+## setMethod("show", signature(object = "paml_rst"),
117
+##           function(object) {
118
+##               cat("'paml_rst' S4 object that stored information of\n\t",
119
+##                   paste0("'", object@rstfile, "'.\n\n"))
120
+##               ## if (length(object@tip.fasfile) != 0) {
121
+##               ##     cat(paste0(" and \n\t'", object@tip.fasfile, "'.\n\n"))
122
+##               ## } else {
123
+##               ##     cat(".\n\n")
124
+##               ## }
125
+##               fields <- get.fields(object)
126
+
127
+##               if (nrow(object@marginal_subs) == 0) {
128
+##                   fields <- fields[fields != "marginal_subs"]
129
+##                   fields <- fields[fields != "marginal_AA_subs"]
130
+##               }
131
+##               if (nrow(object@joint_subs) == 0) {
132
+##                   fields <- fields[fields != "joint_subs"]
133
+##                   fields <- fields[fields != "joint_AA_subs"]
134
+##               }
135
+
136
+##               cat("...@ tree:")
137
+##               print.phylo(get.tree(object))
138
+##               cat("\nwith the following features available:\n")
139
+##               cat("\t", paste0("'",
140
+##                                paste(fields, collapse="',\t'"),
141
+##                                "'."),
142
+##                   "\n")
143
+##           })
144
+
145
+
146
+
147
+## ##' @rdname show-methods
148
+## ##' @importFrom ape print.phylo
149
+## ##' @exportMethod show
150
+## setMethod("show", signature(object = "r8s"),
151
+##           function(object) {
152
+##               cat("'r8s' S4 object that stored information of\n\t",
153
+##                   paste0("'", object@file, "'.\n\n"))
154
+##               cat("...@ tree: ")
155
+##               print.phylo(get.tree(object))
156
+##               ## cat("\nwith the following features available:\n")
157
+##               ## print_fields(object)
158
+##           })
159
+
160
+
161
+## ##' @rdname show-methods
162
+## ##' @importFrom ape print.phylo
163
+## ##' @exportMethod show
164
+## setMethod("show", signature(object = "phangorn"),
165
+##           function(object) {
166
+##               cat("'phangorn' S4 object that stored ancestral sequences inferred by 'phangorn::ancestral.pml'", ".\n\n")
167
+##               cat("...@ tree: ")
168
+##               print.phylo(get.tree(object))
169
+##               fields <- get.fields(object)
170
+##               cat("\nwith the following features available:\n")
171
+##               cat("\t", paste0("'",
172
+##                                paste(fields, collapse="',\t'"),
173
+##                                "'."),
174
+##                   "\n")
175
+##           })
Browse code

bug fixed

guangchuang yu authored on 14/12/2016 09:07:44
Showing 1 changed files
... ...
@@ -6,7 +6,7 @@ setMethod("show", signature(object = "beast"),
6 6
               cat("'beast' S4 object that stored information of\n\t",
7 7
                   paste0("'", object@file, "'.\n\n"))
8 8
               cat("...@ tree: ")
9
-              print.phylo(get.tree(object))                  
9
+              print.phylo(get.tree(object))
10 10
               cat("\nwith the following features available:\n")
11 11
               print_fields(object)
12 12
           })
... ...
@@ -20,7 +20,7 @@ setMethod("show", signature(object = "codeml"),
20 20
                          object@mlc@mlcfile, "'."),
21 21
                   "\n\n")
22 22
               cat("...@ tree:")
23
-              print.phylo(get.tree(object))                  
23
+              print.phylo(get.tree(object))
24 24
               cat("\nwith the following features available:\n")
25 25
               print_fields(object, len=4)
26 26
           })
... ...
@@ -32,10 +32,10 @@ setMethod("show", signature(object = "codeml_mlc"),
32 32
               cat("'codeml_mlc' S4 object that stored information of\n\t",
33 33
                   paste0("'", object@mlcfile, "'."),
34 34
                   "\n\n")
35
-              
35
+
36 36
               cat("...@ tree:")
37
-              print.phylo(get.tree(object))                  
38
-              
37
+              print.phylo(get.tree(object))
38
+
39 39
               cat("\nwith the following features available:\n")
40 40
               cat("\t", paste0("'",
41 41
                                  paste(get.fields(object), collapse="',\t'"),
... ...
@@ -46,7 +46,7 @@ setMethod("show", signature(object = "codeml_mlc"),
46 46
 
47 47
 ##' show method for \code{jplace} instance
48 48
 ##'
49
-##' 
49
+##'
50 50
 ##' @name show
51 51
 ##' @docType methods
52 52
 ##' @rdname show-methods
... ...
@@ -72,8 +72,8 @@ setMethod("show", signature(object = "jplace"),
72 72
 
73 73
               phylo <- get.tree(object)
74 74
               phylo$node.label <- NULL
75
-              phylo$tip.label %<>% gsub("\\@\\d+", "", .) 
76
-        
75
+              phylo$tip.label %<>% gsub("\\@\\d+", "", .)
76
+
77 77
               print.phylo(phylo)
78 78
 
79 79
               cat("\nwith the following features availables:\n")
... ...
@@ -92,7 +92,7 @@ setMethod("show", signature(object = "nhx"),
92 92
               cat("'nhx' S4 object that stored information of\n\t",
93 93
                   paste0("'", object@file, "'.\n\n"))
94 94
               cat("...@ tree: ")
95
-              print.phylo(get.tree(object))                  
95
+              print.phylo(get.tree(object))
96 96
               cat("\nwith the following features available:\n")
97 97
               print_fields(object)
98 98
           })
... ...
@@ -105,7 +105,7 @@ setMethod("show", signature(object = "phylip"),
105 105
               cat("'phylip' S4 object that stored information of\n\t",
106 106
                   paste0("'", object@file, "'.\n\n"))
107 107
               cat("...@ tree: ")
108
-              print.phylo(get.tree(object))                  
108
+              print.phylo(get.tree(object))
109 109
               msg <- paste0("\nwith sequence alignment available (", length(object@sequence),
110 110
                             " sequences of length ", nchar(object@sequence)[1], ")\n")
111 111
               cat(msg)
... ...
@@ -132,9 +132,9 @@ setMethod("show", signature(object = "paml_rst"),
132 132
                   fields <- fields[fields != "joint_subs"]
133 133
                   fields <- fields[fields != "joint_AA_subs"]
134 134
               }
135
-              
135
+
136 136
               cat("...@ tree:")
137
-              print.phylo(get.tree(object))                  
137
+              print.phylo(get.tree(object))
138 138
               cat("\nwith the following features available:\n")
139 139
               cat("\t", paste0("'",
140 140
                                paste(fields, collapse="',\t'"),
... ...
@@ -152,7 +152,24 @@ setMethod("show", signature(object = "r8s"),
152 152
               cat("'r8s' S4 object that stored information of\n\t",
153 153
                   paste0("'", object@file, "'.\n\n"))
154 154
               cat("...@ tree: ")
155
-              print.phylo(get.tree(object))                  
155
+              print.phylo(get.tree(object))
156 156
               ## cat("\nwith the following features available:\n")
157 157
               ## print_fields(object)
158 158
           })
159
+
160
+
161
+##' @rdname show-methods
162
+##' @importFrom ape print.phylo
163
+##' @exportMethod show
164
+setMethod("show", signature(object = "phangorn"),
165
+          function(object) {
166
+              cat("'phangorn' S4 object that stored ancestral sequences inferred by 'phangorn::ancestral.pml'", ".\n\n")
167
+              cat("...@ tree: ")
168
+              print.phylo(get.tree(object))
169
+              fields <- get.fields(object)
170
+              cat("\nwith the following features available:\n")
171
+              cat("\t", paste0("'",
172
+                               paste(fields, collapse="',\t'"),
173
+                               "'."),
174
+                  "\n")
175
+          })
Browse code

clean dependencies

git-svn-id: https://hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/ggtree@119521 bc3139a8-67e5-0310-9ffc-ced21a209358

g.yu authored on 21/07/2016 13:16:38
Showing 1 changed files
... ...
@@ -107,7 +107,7 @@ setMethod("show", signature(object = "phylip"),
107 107
               cat("...@ tree: ")
108 108
               print.phylo(get.tree(object))                  
109 109
               msg <- paste0("\nwith sequence alignment available (", length(object@sequence),
110
-                            " sequences of length ", width(object@sequence)[1], ")\n")
110
+                            " sequences of length ", nchar(object@sequence)[1], ")\n")
111 111
               cat(msg)
112 112
           })
113 113
 
Browse code

support MCC trees

git-svn-id: https://hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/ggtree@117329 bc3139a8-67e5-0310-9ffc-ced21a209358

g.yu authored on 12/05/2016 07:09:03
Showing 1 changed files
... ...
@@ -1,5 +1,3 @@
1
-
2
-
3 1
 ##' @rdname show-methods
4 2
 ##' @importFrom ape print.phylo
5 3
 ##' @exportMethod show
Browse code

support textConnection

git-svn-id: https://hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/ggtree@116643 bc3139a8-67e5-0310-9ffc-ced21a209358

g.yu authored on 21/04/2016 11:51:12
Showing 1 changed files
... ...
@@ -27,6 +27,25 @@ setMethod("show", signature(object = "codeml"),
27 27
               print_fields(object, len=4)
28 28
           })
29 29
 
30
+##' @rdname show-methods
31
+##' @exportMethod show
32
+setMethod("show", signature(object = "codeml_mlc"),
33
+          function(object) {
34
+              cat("'codeml_mlc' S4 object that stored information of\n\t",
35
+                  paste0("'", object@mlcfile, "'."),
36
+                  "\n\n")
37
+              
38
+              cat("...@ tree:")
39
+              print.phylo(get.tree(object))                  
40
+              
41
+              cat("\nwith the following features available:\n")
42
+              cat("\t", paste0("'",
43
+                                 paste(get.fields(object), collapse="',\t'"),
44
+                                 "'."),
45
+                  "\n")
46
+          }
47
+          )
48
+
30 49
 ##' show method for \code{jplace} instance
31 50
 ##'
32 51
 ##' 
... ...
@@ -94,3 +113,48 @@ setMethod("show", signature(object = "phylip"),
94 113
               cat(msg)
95 114
           })
96 115
 
116
+##' @rdname show-methods
117
+##' @exportMethod show
118
+setMethod("show", signature(object = "paml_rst"),
119
+          function(object) {
120
+              cat("'paml_rst' S4 object that stored information of\n\t",
121
+                  paste0("'", object@rstfile, "'.\n\n"))
122
+              ## if (length(object@tip.fasfile) != 0) {
123
+              ##     cat(paste0(" and \n\t'", object@tip.fasfile, "'.\n\n"))
124
+              ## } else {
125
+              ##     cat(".\n\n")
126
+              ## }
127
+              fields <- get.fields(object)
128
+
129
+              if (nrow(object@marginal_subs) == 0) {
130
+                  fields <- fields[fields != "marginal_subs"]
131
+                  fields <- fields[fields != "marginal_AA_subs"]
132
+              }
133
+              if (nrow(object@joint_subs) == 0) {
134
+                  fields <- fields[fields != "joint_subs"]
135
+                  fields <- fields[fields != "joint_AA_subs"]
136
+              }
137
+              
138
+              cat("...@ tree:")
139
+              print.phylo(get.tree(object))                  
140
+              cat("\nwith the following features available:\n")
141
+              cat("\t", paste0("'",
142
+                               paste(fields, collapse="',\t'"),
143
+                               "'."),
144
+                  "\n")
145
+          })
146
+
147
+
148
+
149
+##' @rdname show-methods
150
+##' @importFrom ape print.phylo
151
+##' @exportMethod show
152
+setMethod("show", signature(object = "r8s"),
153
+          function(object) {
154
+              cat("'r8s' S4 object that stored information of\n\t",
155
+                  paste0("'", object@file, "'.\n\n"))
156
+              cat("...@ tree: ")
157
+              print.phylo(get.tree(object))                  
158
+              ## cat("\nwith the following features available:\n")
159
+              ## print_fields(object)
160
+          })
Browse code

support phylip format

git-svn-id: https://hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/ggtree@112578 bc3139a8-67e5-0310-9ffc-ced21a209358

g.yu authored on 15/01/2016 04:55:05
Showing 1 changed files
... ...
@@ -13,6 +13,60 @@ setMethod("show", signature(object = "beast"),
13 13
               print_fields(object)
14 14
           })
15 15
 
16
+##' @rdname show-methods
17
+##' @exportMethod show
18
+setMethod("show", signature(object = "codeml"),
19
+          function(object) {
20
+              cat("'codeml' S4 object that stored information of\n\t",
21
+                  paste0("'", object@rst@rstfile, "' and \n\t'",
22
+                         object@mlc@mlcfile, "'."),
23
+                  "\n\n")
24
+              cat("...@ tree:")
25
+              print.phylo(get.tree(object))                  
26
+              cat("\nwith the following features available:\n")
27
+              print_fields(object, len=4)
28
+          })
29
+
30
+##' show method for \code{jplace} instance
31
+##'
32
+##' 
33
+##' @name show
34
+##' @docType methods
35
+##' @rdname show-methods
36
+##'
37
+##' @title show method
38
+##' @param object one of \code{jplace}, \code{beast} object
39
+##' @return print info
40
+##' @importFrom methods show
41
+##' @exportMethod show
42
+##' @usage show(object)
43
+##' @author Guangchuang Yu \url{http://ygc.name}
44
+##' @examples
45
+##' jp <- system.file("extdata", "sample.jplace", package="ggtree")
46
+##' jp <- read.jplace(jp)
47
+##' show(jp)
48
+setMethod("show", signature(object = "jplace"),
49
+          function(object) {
50
+              cat("'jplace' S4 object that stored information of\n\t",
51
+                  paste0("'", object@file, "'."),
52
+                  "\n\n")
53
+
54
+              cat("...@ tree: ")
55
+
56
+              phylo <- get.tree(object)
57
+              phylo$node.label <- NULL
58
+              phylo$tip.label %<>% gsub("\\@\\d+", "", .) 
59
+        
60
+              print.phylo(phylo)
61
+
62
+              cat("\nwith the following features availables:\n")
63
+              cat("\t", paste0("'",
64
+                               paste(get.fields(object), collapse="',\t'"),
65
+                               "'."),
66
+                  "\n")
67
+          }
68
+          )
69
+
16 70
 
17 71
 ##' @rdname show-methods
18 72
 ##' @exportMethod show
... ...
@@ -25,3 +79,18 @@ setMethod("show", signature(object = "nhx"),
25 79
               cat("\nwith the following features available:\n")
26 80
               print_fields(object)
27 81
           })
82
+
83
+
84
+##' @rdname show-methods
85
+##' @exportMethod show
86
+setMethod("show", signature(object = "phylip"),
87
+          function(object) {
88
+              cat("'phylip' S4 object that stored information of\n\t",
89
+                  paste0("'", object@file, "'.\n\n"))
90
+              cat("...@ tree: ")
91
+              print.phylo(get.tree(object))                  
92
+              msg <- paste0("\nwith sequence alignment available (", length(object@sequence),
93
+                            " sequences of length ", width(object@sequence)[1], ")\n")
94
+              cat(msg)
95
+          })
96
+
Browse code

lots of new layers

git-svn-id: https://hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/ggtree@111815 bc3139a8-67e5-0310-9ffc-ced21a209358

g.yu authored on 22/12/2015 04:13:13
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,27 @@
1
+
2
+
3
+##' @rdname show-methods
4
+##' @importFrom ape print.phylo
5
+##' @exportMethod show
6
+setMethod("show", signature(object = "beast"),
7
+          function(object) {
8
+              cat("'beast' S4 object that stored information of\n\t",
9
+                  paste0("'", object@file, "'.\n\n"))
10
+              cat("...@ tree: ")
11
+              print.phylo(get.tree(object))                  
12
+              cat("\nwith the following features available:\n")
13
+              print_fields(object)
14
+          })
15
+
16
+
17
+##' @rdname show-methods
18
+##' @exportMethod show
19
+setMethod("show", signature(object = "nhx"),
20
+          function(object) {
21
+              cat("'nhx' S4 object that stored information of\n\t",
22
+                  paste0("'", object@file, "'.\n\n"))
23
+              cat("...@ tree: ")
24
+              print.phylo(get.tree(object))                  
25
+              cat("\nwith the following features available:\n")
26
+              print_fields(object)
27
+          })