ggtree-py 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
ggtree/__init__.py ADDED
@@ -0,0 +1,569 @@
1
+ """
2
+ ggtree: Grammar of Graphics for Phylogenetic Trees in Python (v4.3.2)
3
+ Complete Python port of the R/Bioconductor ggtree package.
4
+ """
5
+
6
+ __version__ = "0.1.0"
7
+ __r_ggtree_version__ = "4.3.2"
8
+
9
+ from .dataframe import (
10
+ DataFrame,
11
+ TblTree,
12
+ ColumnSeries,
13
+ Factor,
14
+ options,
15
+ getOption,
16
+ attr,
17
+ set_attr,
18
+ data_frame,
19
+ tibble,
20
+ c,
21
+ rep,
22
+ seq,
23
+ seq_len,
24
+ seq_along,
25
+ paste,
26
+ paste0,
27
+ factor,
28
+ rnorm,
29
+ runif,
30
+ rbinom,
31
+ sample,
32
+ set_seed,
33
+ LETTERS,
34
+ letters,
35
+ NA,
36
+ TRUE,
37
+ FALSE,
38
+ NULL,
39
+ is_na,
40
+ match,
41
+ mutate,
42
+ filter,
43
+ select,
44
+ arrange,
45
+ left_join,
46
+ full_join,
47
+ inner_join,
48
+ bind_rows,
49
+ unnest,
50
+ read_table,
51
+ read_csv,
52
+ )
53
+
54
+ from .tree import (
55
+ Phylo,
56
+ TreeData,
57
+ MultiPhylo,
58
+ TreeDataList,
59
+ Hclust,
60
+ hclust,
61
+ read_tree,
62
+ read_beast,
63
+ read_nhx,
64
+ read_jplace,
65
+ read_fasta,
66
+ write_tree,
67
+ rtree,
68
+ rmtree,
69
+ stree,
70
+ estimate_dates,
71
+ reorder_phylo,
72
+ ladderize,
73
+ di2multi,
74
+ as_polytomy,
75
+ extract_clade,
76
+ Ntip,
77
+ Nnode,
78
+ Nnode2,
79
+ getNodeNum,
80
+ is_rooted,
81
+ get_tree,
82
+ as_phylo,
83
+ as_treedata,
84
+ as_tibble,
85
+ system_file,
86
+ get_seqs,
87
+ subtrees,
88
+ )
89
+
90
+ from .tidytree import (
91
+ taxa2node,
92
+ nodeid,
93
+ nodelab,
94
+ rootnode,
95
+ getRoot,
96
+ isTip as _tidytree_isTip,
97
+ itself,
98
+ child,
99
+ parent as _tidytree_parent,
100
+ sibling,
101
+ ancestor,
102
+ offspring,
103
+ offspring_bulk,
104
+ MRCA,
105
+ groupOTU,
106
+ groupClade,
107
+ tree_subset,
108
+ td_filter,
109
+ td_mutate,
110
+ td_unnest,
111
+ )
112
+
113
+ from .layout import (
114
+ Date2decimal,
115
+ decimal2Date,
116
+ getXcoord2,
117
+ getXcoord,
118
+ getXcoord_no_length,
119
+ getXcoord_no_length_slanted,
120
+ getYcoord_no_length_slanted,
121
+ getYcoord,
122
+ getYcoord_tidy,
123
+ re_assign_ycoord_df,
124
+ reassign_y_from_node_to_root,
125
+ calculate_branch_mid,
126
+ calculate_angle,
127
+ add_angle_slanted,
128
+ set_branch_length_cladogram,
129
+ getNodes_by_postorder,
130
+ getNodesBreadthFirst_df,
131
+ layoutEqualAngle,
132
+ applyLayoutDaylight,
133
+ layoutDaylight,
134
+ layoutApe,
135
+ layoutTreeAndLeaf,
136
+ scaleX_by_time_from_mrsd,
137
+ scaleY,
138
+ adjust_hclust_tip_edge_len,
139
+ tree_layout,
140
+ fortify,
141
+ get_layout,
142
+ tip_y_alignment,
143
+ check_reverse,
144
+ get_clade_position_,
145
+ get_clade_position,
146
+ clade_geometry,
147
+ adjust_cladelabel_angle,
148
+ )
149
+
150
+ from .aes import (
151
+ SymExpr,
152
+ CallableSymExpr,
153
+ Aes,
154
+ aes,
155
+ modifyList,
156
+ eval_expr,
157
+ eval_subset,
158
+ node,
159
+ label,
160
+ branch,
161
+ branch_length,
162
+ x,
163
+ y,
164
+ angle,
165
+ group,
166
+ rate,
167
+ posterior,
168
+ height,
169
+ value,
170
+ id,
171
+ _id,
172
+ place,
173
+ type_,
174
+ annote,
175
+ image,
176
+ offset,
177
+ ta1,
178
+ ta2,
179
+ taxa1,
180
+ taxa2,
181
+ tree,
182
+ v,
183
+ S,
184
+ trait,
185
+ score,
186
+ )
187
+
188
+ isTip = CallableSymExpr("isTip", _tidytree_isTip)
189
+ parent = CallableSymExpr("parent", _tidytree_parent)
190
+
191
+ from .themes_scales import (
192
+ PlotModifier,
193
+ Theme,
194
+ Scale,
195
+ Coord,
196
+ rel,
197
+ unit,
198
+ margin,
199
+ arrow,
200
+ element_blank,
201
+ element_text,
202
+ element_line,
203
+ element_rect,
204
+ guide_legend,
205
+ guide_colorbar,
206
+ guides,
207
+ theme,
208
+ theme_tree,
209
+ theme_tree2,
210
+ theme_dendrogram,
211
+ theme_inset,
212
+ theme_bw,
213
+ theme_minimal,
214
+ theme_void,
215
+ theme_classic,
216
+ labs,
217
+ ggtitle,
218
+ xlab,
219
+ ylab,
220
+ xlim,
221
+ ylim,
222
+ xlim_expand,
223
+ xlim_tree,
224
+ hexpand,
225
+ vexpand,
226
+ ggexpand,
227
+ revts,
228
+ scale_x_range,
229
+ coord_cartesian,
230
+ coord_flip,
231
+ coord_polar,
232
+ coord_fixed,
233
+ facet_wrap,
234
+ facet_grid,
235
+ new_scale_fill,
236
+ new_scale_color,
237
+ new_scale_colour,
238
+ scale_color_manual,
239
+ scale_colour_manual,
240
+ scale_fill_manual,
241
+ scale_color_continuous,
242
+ scale_colour_continuous,
243
+ scale_fill_continuous,
244
+ scale_color_gradient,
245
+ scale_colour_gradient,
246
+ scale_fill_gradient,
247
+ scale_color_gradient2,
248
+ scale_fill_gradient2,
249
+ scale_color_viridis_c,
250
+ scale_colour_viridis_c,
251
+ scale_fill_viridis_c,
252
+ scale_color_viridis_d,
253
+ scale_colour_viridis_d,
254
+ scale_fill_viridis_d,
255
+ scale_color_brewer,
256
+ scale_fill_brewer,
257
+ scale_x_continuous,
258
+ scale_y_continuous,
259
+ scale_x_date,
260
+ scale_x_ggtree,
261
+ scale_size,
262
+ scale_size_continuous,
263
+ scale_alpha,
264
+ scale_shape_manual,
265
+ scale_linetype_manual,
266
+ scale_color,
267
+ add_colorbar,
268
+ set_hilight_legend,
269
+ )
270
+
271
+ from .geoms import (
272
+ Layer,
273
+ LayerList,
274
+ geom_tree,
275
+ geom_tree2,
276
+ stat_tree,
277
+ geom_tiplab,
278
+ geom_tiplab2,
279
+ geom_nodelab,
280
+ geom_nodelab2,
281
+ geom_point2,
282
+ geom_point,
283
+ geom_tippoint,
284
+ geom_nodepoint,
285
+ geom_rootpoint,
286
+ geom_text2,
287
+ geom_text,
288
+ geom_label2,
289
+ geom_label,
290
+ geom_segment2,
291
+ geom_segment,
292
+ geom_aline,
293
+ geom_hilight,
294
+ geom_highlight,
295
+ geom_hilight_encircle,
296
+ geom_cladelab,
297
+ geom_cladelabel,
298
+ geom_cladelabel2,
299
+ geom_strip,
300
+ geom_striplab,
301
+ geom_taxalink,
302
+ geom_tanglelink,
303
+ geom_treescale,
304
+ geom_balance,
305
+ geom_range,
306
+ geom_rootedge,
307
+ geom_zoom_clade,
308
+ geom_motif,
309
+ geom_inset,
310
+ geom_bar,
311
+ geom_col,
312
+ geom_tile,
313
+ geom_raster,
314
+ geom_line,
315
+ geom_path,
316
+ geom_area,
317
+ geom_ribbon,
318
+ geom_rect,
319
+ geom_polygon,
320
+ geom_curve,
321
+ geom_vline,
322
+ geom_hline,
323
+ geom_abline,
324
+ geom_boxplot,
325
+ geom_violin,
326
+ geom_density,
327
+ geom_histogram,
328
+ geom_errorbar,
329
+ geom_errorbarh,
330
+ geom_linerange,
331
+ geom_pointrange,
332
+ geom_tree_interactive,
333
+ geom_point_interactive,
334
+ geom_tiplab_interactive,
335
+ geom_tiplab2_interactive,
336
+ geom_nodelab_interactive,
337
+ geom_nodelab2_interactive,
338
+ geom_cladelab_interactive,
339
+ geom_cladelabel_interactive,
340
+ geom_hilight_interactive,
341
+ geom_strip_interactive,
342
+ geom_taxalink_interactive,
343
+ geom_label2_interactive,
344
+ geom_point2_interactive,
345
+ geom_segment2_interactive,
346
+ geom_text2_interactive,
347
+ GeomHilightEncircle,
348
+ GeomInteractiveCurvelink,
349
+ GeomInteractiveHilightEncircle,
350
+ GeomInteractiveHilightRect,
351
+ GeomInteractiveLabelGGtree,
352
+ GeomInteractivePointGGtree,
353
+ GeomInteractiveSegmentGGtree,
354
+ GeomInteractiveTextGGtree,
355
+ StatBalance,
356
+ ggtree_set_interactive,
357
+ ggtree_unset_interactive,
358
+ )
359
+
360
+ from .manipulate import (
361
+ get_taxa_name,
362
+ viewClade,
363
+ zoomClade,
364
+ collapse,
365
+ expand,
366
+ rotate,
367
+ flip,
368
+ scaleClade,
369
+ open_tree,
370
+ rotate_tree,
371
+ layout_ggtree,
372
+ layout_rectangular,
373
+ layout_circular,
374
+ layout_fan,
375
+ layout_inward_circular,
376
+ layout_dendrogram,
377
+ label_pad,
378
+ range_format,
379
+ reroot,
380
+ rescale_tree,
381
+ gzoom,
382
+ identify,
383
+ scale_color_subtree,
384
+ scale_colour_subtree,
385
+ )
386
+
387
+ from .compose import (
388
+ gheatmap,
389
+ get_heatmap_column_position,
390
+ msaplot,
391
+ geom_facet,
392
+ facet_plot,
393
+ facet_data,
394
+ facet_labeller,
395
+ facet_widths,
396
+ nodebar,
397
+ nodepie,
398
+ inset,
399
+ ggdensitree,
400
+ Tanglegram,
401
+ as_tanglegram,
402
+ as_tanglegram_cophylo,
403
+ as_tanglegram_default,
404
+ as_tanglegram_tanglegram,
405
+ ggdoubletree,
406
+ PlotList,
407
+ multiplot,
408
+ plot_list,
409
+ )
410
+
411
+ from .plot import (
412
+ GGTree,
413
+ BuiltPlot,
414
+ BuiltLayout,
415
+ ggplot,
416
+ ggtree,
417
+ ggplot_build,
418
+ is_ggplot,
419
+ ggsave,
420
+ last_plot,
421
+ )
422
+
423
+
424
+ # ---------------------------------------------------------------------------
425
+ # R-namespace dot-Call Compatibility Proxies
426
+ # Allows R-style expressions in Python:
427
+ # read.tree(...), read.beast(...), system.file(...), data.frame(...),
428
+ # set.seed(...), as.polytomy(...), ape.rtree(...), ggplot2.ggplot_build(...)
429
+ # ---------------------------------------------------------------------------
430
+
431
+ class _ReadNamespace:
432
+ tree = staticmethod(read_tree)
433
+ beast = staticmethod(read_beast)
434
+ nhx = staticmethod(read_nhx)
435
+ jplace = staticmethod(read_jplace)
436
+ fasta = staticmethod(read_fasta)
437
+ table = staticmethod(read_table)
438
+ csv = staticmethod(read_csv)
439
+
440
+
441
+ class _WriteNamespace:
442
+ tree = staticmethod(write_tree)
443
+
444
+
445
+ class _SystemNamespace:
446
+ file = staticmethod(system_file)
447
+
448
+
449
+ class _DataNamespace:
450
+ frame = staticmethod(data_frame)
451
+
452
+
453
+ class _SetNamespace:
454
+ seed = staticmethod(set_seed)
455
+
456
+
457
+ class _AsNamespace:
458
+ polytomy = staticmethod(as_polytomy)
459
+ phylo = staticmethod(as_phylo)
460
+ treedata = staticmethod(as_treedata)
461
+ tibble = staticmethod(as_tibble)
462
+ tanglegram = staticmethod(as_tanglegram)
463
+
464
+
465
+ class _IsNamespace:
466
+ na = staticmethod(is_na)
467
+ ggplot = staticmethod(is_ggplot)
468
+ rooted = staticmethod(is_rooted)
469
+
470
+
471
+ class _ApeNamespace:
472
+ rtree = staticmethod(rtree)
473
+ rmtree = staticmethod(rmtree)
474
+ stree = staticmethod(stree)
475
+ read_tree = staticmethod(read_tree)
476
+ write_tree = staticmethod(write_tree)
477
+ read = _ReadNamespace()
478
+ write = _WriteNamespace()
479
+ Ntip = staticmethod(Ntip)
480
+ Nnode = staticmethod(Nnode)
481
+ di2multi = staticmethod(di2multi)
482
+ ladderize = staticmethod(ladderize)
483
+ extract_clade = staticmethod(extract_clade)
484
+ estimate_dates = staticmethod(estimate_dates)
485
+ is_rooted = staticmethod(is_rooted)
486
+ subtrees = staticmethod(subtrees)
487
+
488
+
489
+ class _TreeioNamespace:
490
+ read_tree = staticmethod(read_tree)
491
+ read_beast = staticmethod(read_beast)
492
+ read_nhx = staticmethod(read_nhx)
493
+ read_jplace = staticmethod(read_jplace)
494
+ read_fasta = staticmethod(read_fasta)
495
+ read = _ReadNamespace()
496
+ get_tree = staticmethod(get_tree)
497
+ get_seqs = staticmethod(get_seqs)
498
+ Nnode = staticmethod(Nnode)
499
+ Nnode2 = staticmethod(Nnode2)
500
+ Ntip = staticmethod(Ntip)
501
+ as_phylo = staticmethod(as_phylo)
502
+ as_treedata = staticmethod(as_treedata)
503
+ rescale_tree = staticmethod(rescale_tree)
504
+
505
+
506
+ class _TidytreeNamespace:
507
+ nodeid = staticmethod(nodeid)
508
+ nodelab = staticmethod(nodelab)
509
+ rootnode = staticmethod(rootnode)
510
+ isTip = staticmethod(_tidytree_isTip)
511
+ child = staticmethod(child)
512
+ parent = staticmethod(_tidytree_parent)
513
+ sibling = staticmethod(sibling)
514
+ ancestor = staticmethod(ancestor)
515
+ offspring = staticmethod(offspring)
516
+ MRCA = staticmethod(MRCA)
517
+ groupOTU = staticmethod(groupOTU)
518
+ groupClade = staticmethod(groupClade)
519
+ tree_subset = staticmethod(tree_subset)
520
+ as_tibble = staticmethod(as_tibble)
521
+ as_treedata = staticmethod(as_treedata)
522
+ as_phylo = staticmethod(as_phylo)
523
+
524
+
525
+ class _Ggplot2Namespace:
526
+ ggplot = staticmethod(ggplot)
527
+ aes = staticmethod(aes)
528
+ ggplot_build = staticmethod(ggplot_build)
529
+ is_ggplot = staticmethod(is_ggplot)
530
+ ggsave = staticmethod(ggsave)
531
+ rel = staticmethod(rel)
532
+ unit = staticmethod(unit)
533
+ margin = staticmethod(margin)
534
+ arrow = staticmethod(arrow)
535
+ element_blank = staticmethod(element_blank)
536
+ element_text = staticmethod(element_text)
537
+ element_line = staticmethod(element_line)
538
+ element_rect = staticmethod(element_rect)
539
+ theme = staticmethod(theme)
540
+ theme_bw = staticmethod(theme_bw)
541
+ theme_minimal = staticmethod(theme_minimal)
542
+ theme_void = staticmethod(theme_void)
543
+ theme_classic = staticmethod(theme_classic)
544
+ labs = staticmethod(labs)
545
+ ggtitle = staticmethod(ggtitle)
546
+ xlab = staticmethod(xlab)
547
+ ylab = staticmethod(ylab)
548
+ xlim = staticmethod(xlim)
549
+ ylim = staticmethod(ylim)
550
+ coord_cartesian = staticmethod(coord_cartesian)
551
+ coord_flip = staticmethod(coord_flip)
552
+ coord_polar = staticmethod(coord_polar)
553
+ coord_fixed = staticmethod(coord_fixed)
554
+ facet_wrap = staticmethod(facet_wrap)
555
+ facet_grid = staticmethod(facet_grid)
556
+ fortify = staticmethod(fortify)
557
+
558
+
559
+ read = _ReadNamespace()
560
+ write = _WriteNamespace()
561
+ system = _SystemNamespace()
562
+ data = _DataNamespace()
563
+ set_ = _SetNamespace()
564
+ as_ = _AsNamespace()
565
+ is_ = _IsNamespace()
566
+ ape = _ApeNamespace()
567
+ treeio = _TreeioNamespace()
568
+ tidytree = _TidytreeNamespace()
569
+ ggplot2 = _Ggplot2Namespace()