Smartview (web graphics)

Server

Keep the data of trees and present a REST api to talk to the world.

REST call examples:

GET /trees Get all trees GET /trees/{id} Get the tree information identified by “id” POST /trees Create a new tree PUT /trees/{id} Update the tree information identified by “id” DELETE /trees/{id} Delete tree by “id”

class GlobalStuff[source]
class TreeData(tree: ete4.core.tree.Tree = None, name: str = None, style: ete4.smartview.renderer.treestyle.TreeStyle = None, nodestyles: dict = None, include_props: list = None, exclude_props: list = None, layouts: list = None, timer: float = None, ultrametric: bool = False, initialized: bool = False, selected: dict = None, active: <function namedtuple at 0x7ff78a942a20> = None, searches: dict = None)[source]
__init__(tree: Tree = None, name: str = None, style: TreeStyle = None, nodestyles: dict = None, include_props: list = None, exclude_props: list = None, layouts: list = None, timer: float = None, ultrametric: bool = False, initialized: bool = False, selected: dict = None, active: namedtuple = None, searches: dict = None) None
active: namedtuple = None
exclude_props: list = None
include_props: list = None
initialized: bool = False
layouts: list = None
name: str = None
nodestyles: dict = None
searches: dict = None
selected: dict = None
style: TreeStyle = None
timer: float = None
tree: Tree = None
ultrametric: bool = False
activate_clade(tree_id)[source]
activate_node(tree_id)[source]
add_tree(data)[source]

Add tree with given data and return its id

add_trees_from_request()[source]

Add trees to app.trees and return a dict of {name: id}.

callback(tree_id)[source]
change_selection_name(tid, args)[source]
copy_style(tree_style)[source]
deactivate_clade(tree_id)[source]
deactivate_node(tree_id)[source]
del_tree(tid)[source]

Delete a tree and everywhere where it appears referenced

find_node(tree, args)[source]
get_active_clade(node, active)[source]
get_active_clades(results, parents)[source]

Return the appropriate node search function according to the command

get_drawer(tree_id, args)[source]

Return the drawer initialized as specified in the args

Return a function of a node that evaluates the given expression

get_layouts(layouts=None)[source]
get_layouts_from_getters()[source]

Return a dict {name: [layout1, …]} for all layout submodules.

get_newick(tree_id, max_mb)[source]

Return the newick representation of the given tree

get_next_available_port(host='localhost', port_min=5000, port_max=6000)[source]

Return the next available port where we can put a server socket.

get_nodes_info(nodes, props)[source]
get_parents(results, count_leaves=False)[source]

Return a set of parents given a set of results

get_parser(internal)[source]

Return parser given the internal nodes main property interpretation.

get_search_function(text)[source]

Return a function of a node that returns True for the searched nodes

get_selection_info(tree_data, args)[source]

Get selection info from their nodes

get_selections(tree_id)[source]
get_stats(tree_id, pname)[source]

Return some statistics about the given property pname

get_tid(tree_id)[source]

Return the tree id and the subtree id, with the appropriate types.

Return a function of a node that sees if it matches the given pattern

get_trees_from_file(filename, fileobject=None)[source]

Return list of {‘name’: …, ‘newick’: …} extracted from file.

get_trees_from_form()[source]

Return list of dicts with tree info read from a form in the request.

get_trees_from_nexus_or_newick(btext, name_newick)[source]

Return list of {‘name’: …, ‘newick’: …} extracted from btext.

initialize(tree=None, layouts=None, include_props=None, exclude_props=None, safe_mode=False, compress=False)[source]

Initialize the global object app.

initialize_tree_style(tree_data)[source]
json_error(error)[source]
load_tree(tree_id)[source]

Add tree to app.trees and initialize it if not there, and return it

load_tree_from_newick(tid, nw)[source]

Load tree into memory from newick

maintenance(app, check_interval=60, max_time=1800)[source]

Perform maintenance tasks every check_interval seconds.

make_name()[source]

Return a unique tree name like ‘tree-<number>’.

nice_html(content, title='Tree Explorer')[source]
open_browser_window(host, port)[source]

Try to open a browser window in a different process.

prune_by_selection(tid, args)[source]

Prune tree by keeping selections identified by their names

remove_active(tree_data, idx)[source]
remove_active_clade(node, active)[source]

Remove search

remove_selection(tid, args)[source]

Remove selection

req_json()[source]

Return what request.json would return, but gracefully aborting.

retrieve_layouts(layouts)[source]
retrieve_tree_data(tid)[source]

Retrieve and return tree data from file.

It retrieves all that from a previously saved pickle file in /tmp.

run_smartview(tree=None, name=None, layouts=[], include_props=None, exclude_props=None, safe_mode=False, host='localhost', port=None, quiet=True, compress=False, keep_server=False, open_browser=True)[source]
safer_eval(code, context)[source]

Return a safer version of eval(code, context)

search_to_selection(tid, args)[source]

Store search as selection

sort(tree_id, node_id, key_text, reverse)[source]

Sort the (sub)tree corresponding to tree_id and node_id

store_active(tree_data, idx, args)[source]

Store the results and parents of a search and return their numbers

store_selection(tree_id, args)[source]

Store the results and parents of a selection and return their numbers

touch_and_get(tree_id)[source]

Load tree, update its timer, and return the tree data object and subtree.

unselect_node(tree_id, args)[source]
update_app_available_layouts()[source]
update_layouts(active_layouts, tid)[source]

Update app layouts based on front end status

update_node_props(node, args)[source]
update_node_style(node, args)[source]
update_selection(tree_data, name, results, parents)[source]

Renderer

Drawer

Classes and functions for drawing a tree.

class Active(results, parents)
parents

Alias for field number 1

results

Alias for field number 0

class Drawer(tree, viewport=None, panel=0, zoom=(1, 1), limits=None, collapsed_ids=None, active=None, selected=None, searches=None, layouts=None, tree_style=None, include_props=None, exclude_props=None)[source]

Base class (needs subclassing with extra functions to draw)

COLLAPSE_SIZE = 6
MIN_SIZE = 1
NPANELS = 1
TYPE = 'base'
__init__(tree, viewport=None, panel=0, zoom=(1, 1), limits=None, collapsed_ids=None, active=None, selected=None, searches=None, layouts=None, tree_style=None, include_props=None, exclude_props=None)[source]
draw()[source]

Yield graphic elements to draw the tree

draw_aligned_headers()[source]
draw_collapsed(collapsed_node, active_children=(0, 0), selected_children=[])[source]

Yield graphic elements to draw the list of nodes in self.collapsed

draw_content(node, point, active_children=(0, 0), selected_children=[])[source]

Yield the node content’s graphic elements

draw_node(node, point, bdx, bdy, bdy0, bdy1, active_children=(0, 0), selected_children=[])[source]

Yield graphic elements to draw the contents of the node

flush_outline(minimum_dx=0)[source]

Return box outlining the collapsed nodes and reset the current outline

get_active_children()[source]
get_collapsed_node()[source]

Get node that will be rendered as a collapsed node. Either the only node collapsed or the parent of all collapsed nodes.

get_outline()[source]

Yield the outline representation.

get_popup_props(node)[source]

Return dictionary of web-safe node properties (to use in a popup).

get_selected_children()[source]
is_fully_collapsed(collapsed_node)[source]

Returns true if collapsed_node is utterly collapsed, i.e. has no branch width

on_first_visit(point, it, graphics)[source]

Update list of graphics to draw and return new position

on_last_visit(point, it, graphics)[source]

Update list of graphics to draw and return new position

class DrawerAlignCircFaces(tree, viewport=None, panel=0, zoom=(1, 1), limits=None, collapsed_ids=None, active=None, selected=None, searches=None, layouts=None, tree_style=None, include_props=None, exclude_props=None)[source]
NPANELS = 2
class DrawerAlignRectFaces(tree, viewport=None, panel=0, zoom=(1, 1), limits=None, collapsed_ids=None, active=None, selected=None, searches=None, layouts=None, tree_style=None, include_props=None, exclude_props=None)[source]
NPANELS = 4
class DrawerCirc(tree, viewport=None, panel=0, zoom=(1, 1), limits=None, collapsed_ids=None, active=None, selected=None, searches=None, layouts=None, tree_style=None, include_props=None, exclude_props=None)[source]

Minimal functional drawer for a circular representation

TYPE = 'circ'
__init__(tree, viewport=None, panel=0, zoom=(1, 1), limits=None, collapsed_ids=None, active=None, selected=None, searches=None, layouts=None, tree_style=None, include_props=None, exclude_props=None)[source]
content_size(node)[source]

Return the size of the node’s content

draw_childrenline(p1, p2, style)[source]

Yield an arc spanning children that starts at p1 and ends at p2

draw_collapsed(collapsed_node, active_children=(0, 0), selected_children=[])[source]

Yield graphic elements to draw the list of nodes in self.collapsed

draw_lengthline(p1, p2, parent_of, style)[source]

Yield a line representing a length

draw_nodebox(node, node_id, box, searched_by, style=None)[source]
draw_nodedot(center, max_size, active_node, style)[source]
flush_outline(minimum_dr=0)[source]

Return box outlining the collapsed nodes

get_box(element)[source]
in_viewport(box, pos=None)[source]
is_small(box)[source]
node_size(node)[source]

Return the size of a node (its content and its children)

class DrawerCircFaces(tree, viewport=None, panel=0, zoom=(1, 1), limits=None, collapsed_ids=None, active=None, selected=None, searches=None, layouts=None, tree_style=None, include_props=None, exclude_props=None)[source]
draw_collapsed(collapsed_node, active_children=(0, 0), selected_children=[])[source]

Yield graphic elements to draw the list of nodes in self.collapsed

draw_node(node, point, bdr, bda, bda0, bda1, active_children=(0, 0), selected_children=[])[source]

Yield graphic elements to draw the contents of the node

class DrawerRect(tree, viewport=None, panel=0, zoom=(1, 1), limits=None, collapsed_ids=None, active=None, selected=None, searches=None, layouts=None, tree_style=None, include_props=None, exclude_props=None)[source]

Minimal functional drawer for a rectangular representation

TYPE = 'rect'
content_size(node)[source]

Return the size of the node’s content

draw_childrenline(p1, p2, style)[source]

Yield a line spanning children that starts at p1 and ends at p2

draw_collapsed(collapsed_node, active_children=(0, 0), selected_children=[])[source]

Yield graphic elements to draw the list of nodes in self.collapsed

draw_lengthline(p1, p2, parent_of, style)[source]

Yield a line representing a length

draw_nodebox(node, node_id, box, searched_by, style=None)[source]
draw_nodedot(center, max_size, active_node, style)[source]

Yield circle or square on node based on node.sm_style

get_box(element)[source]
in_viewport(box, pos=None)[source]
is_small(box)[source]
node_size(node)[source]

Return the size of a node (its content and its children)

class DrawerRectFaces(tree, viewport=None, panel=0, zoom=(1, 1), limits=None, collapsed_ids=None, active=None, selected=None, searches=None, layouts=None, tree_style=None, include_props=None, exclude_props=None)[source]
draw_collapsed(collapsed_node, active_children=(0, 0), selected_children=[])[source]

Yield graphic elements to draw the list of nodes in self.collapsed

draw_node(node, point, bdx, bdy, bdy0, bdy1, active_children=(0, 0), selected_children=[])[source]

Yield graphic elements to draw the contents of the node

class Size(dx, dy)
dx

Alias for field number 0

dy

Alias for field number 1

class TreeActive(nodes, clades)
clades

Alias for field number 1

nodes

Alias for field number 0

dist(node)[source]

Return the distance of a node, with default values if not set.

drawn_size(elements, get_box, min_x=None)[source]

Return the size of a box containing all the elements

get_asec(element, zoom=(0, 0))[source]

Return the annular sector that contains the given graphic element

get_drawers()[source]
get_empty_active()[source]
get_rect(element, zoom=(0, 0))[source]

Return the rectangle that contains the given graphic element

make_box(point, size)[source]
safe_string(prop)[source]
stack(box1, box2)[source]

Return the box resulting from stacking the given boxes.

Draw helpers

class Box(x, y, dx, dy)
dx

Alias for field number 2

dy

Alias for field number 3

x

Alias for field number 0

y

Alias for field number 1

class Padding(x, y)
x

Alias for field number 0

y

Alias for field number 1

cartesian(point)[source]
circumasec(rect)[source]

Return the annular sector that circumscribes the given rectangle

circumrect(asec)[source]

Return the rectangle that circumscribes the given annular sector

clip_angles(a1, a2)[source]

Return the angles such that a1 to a2 extend at maximum from -pi to pi

draw_arc(p1, p2, large=False, arc_type='', style=None)[source]
draw_array(box, a, tooltip=None)[source]
draw_arrow(box, tip, orientation='right', arrow_type='', style=None, tooltip=None)[source]

Create arrow provided a bounding box

draw_circle(center, radius, circle_type='', style=None, tooltip=None)[source]
draw_ellipse(center, rx, ry, ellipse_type='', style=None, tooltip=None)[source]
draw_html(box, html, html_type='', style=None)[source]
draw_img(box, img, img_type='', style=None)[source]
draw_line(p1, p2, line_type='', parent_of=None, style=None)[source]
draw_nodebox(box, name='', properties=None, node_id=None, searched_by=None, style=None)[source]
draw_outline(box, style=None)[source]
draw_rect(box, rect_type, style=None, tooltip=None)[source]
draw_rhombus(box, rhombus_type='', style=None, tooltip=None)[source]

Create rhombus provided a bounding box

draw_slice(center, r, a, da, slice_type='', style=None, tooltip=None)[source]
draw_text(box, text, text_type='', rotation=0, anchor=None, style=None)[source]
draw_triangle(box, tip, triangle_type='', style=None, tooltip=None)[source]

Returns array with all the information needed to draw a triangle in front end. :box: bounds triangle :tip: defines tip orientation ‘top’, ‘left’ or ‘right’. :triangle_type: will label triangle in front end (class)

first_value(tree, prop)[source]

Return the value of the requested property for the first node that has it

get_line_type(style)[source]
get_xs(box)[source]
get_ys(box)[source]
intersects_angles(rect, asec)[source]

Return True if any part of rect is contained within the angles of the asec

intersects_box(b1, b2)[source]

Return True if the boxes b1 and b2 (of the same kind) intersect

intersects_segment(s1, s2)[source]

Return True if the segments s1 and s2 intersect

split_thru_negative_xaxis(rect)[source]

Return a list of rectangles resulting from cutting the given one

summary(nodes, prop='name')[source]

Return a list of names summarizing the given list of nodes

Faces

class AlignLinkFace(stroke_color='gray', stroke_width=0.5, line_type=1, opacity=0.8)[source]
__init__(stroke_color='gray', stroke_width=0.5, line_type=1, opacity=0.8)[source]

Line types: 0 solid, 1 dotted, 2 dashed

compute_bounding_box(drawer, point, size, dx_to_closest_child, bdx, bdy, bdy0, bdy1, pos, row, n_row, n_col, dx_before, dy_before)[source]
draw(drawer)[source]
fits()[source]

Return True if Face fits in computed box. Method overriden by inheriting classes.

get_box()[source]
class AlignmentFace(seq, seqtype='aa', gap_format='line', seq_format='[]', width=None, height=None, fgcolor='black', bgcolor='#bcc3d0', gapcolor='gray', gap_linewidth=0.2, max_fsize=12, ftype='sans-serif', padding_x=0, padding_y=0)[source]
__init__(seq, seqtype='aa', gap_format='line', seq_format='[]', width=None, height=None, fgcolor='black', bgcolor='#bcc3d0', gapcolor='gray', gap_linewidth=0.2, max_fsize=12, ftype='sans-serif', padding_x=0, padding_y=0)[source]
build_blocks()[source]
compute_bounding_box(drawer, point, size, dx_to_closest_child, bdx, bdy, bdy0, bdy1, pos, row, n_row, n_col, dx_before, dy_before)[source]
draw(drawer)[source]
get_seq(start, end)[source]

Retrieves sequence given start, end

class ArrowFace(width, height, orientation='right', color='gray', stroke_color='gray', stroke_width='1.5px', tooltip=None, text=None, fgcolor='black', min_fsize=6, max_fsize=15, ftype='sans-serif', name='', padding_x=0, padding_y=0)[source]
__init__(width, height, orientation='right', color='gray', stroke_color='gray', stroke_width='1.5px', tooltip=None, text=None, fgcolor='black', min_fsize=6, max_fsize=15, ftype='sans-serif', name='', padding_x=0, padding_y=0)[source]
draw(drawer)[source]
property orientation
class AttrFace(attr, formatter=None, name=None, color='black', min_fsize=6, max_fsize=15, ftype='sans-serif', padding_x=0, padding_y=0)[source]
__init__(attr, formatter=None, name=None, color='black', min_fsize=6, max_fsize=15, ftype='sans-serif', padding_x=0, padding_y=0)[source]
get_content()[source]
class CircleFace(radius, color, name='', tooltip=None, padding_x=0, padding_y=0)[source]
__init__(radius, color, name='', tooltip=None, padding_x=0, padding_y=0)[source]
compute_bounding_box(drawer, point, size, dx_to_closest_child, bdx, bdy, bdy0, bdy1, pos, row, n_row, n_col, dx_before, dy_before)[source]
draw(drawer)[source]
class Face(name='', padding_x=0, padding_y=0)[source]

Base class for faces.

Ete uses “faces” to show some piece of information from a node in a tree (as text or graphics of many kinds).

__init__(name='', padding_x=0, padding_y=0)[source]
compute_bounding_box(drawer, point, size, dx_to_closest_child, bdx, bdy, bdy0, bdy1, pos, row, n_row, n_col, dx_before, dy_before)[source]
compute_fsize(dx, dy, zx, zy, max_fsize=None)[source]
fits()[source]

Return True if Face fits in computed box. Method overriden by inheriting classes.

get_box()[source]
get_content()[source]
in_aligned_viewport(segment)[source]
class HTMLFace(html, width, height, name='', padding_x=0, padding_y=0)[source]
__init__(html, width, height, name='', padding_x=0, padding_y=0)[source]
draw(drawer)[source]
class ImgFace(img_path, width, height, name='', padding_x=0, padding_y=0)[source]
__init__(img_path, width, height, name='', padding_x=0, padding_y=0)[source]
draw(drawer)[source]
class LegendFace(colormap, title, min_fsize=6, max_fsize=15, ftype='sans-serif', padding_x=0, padding_y=0)[source]
__init__(colormap, title, min_fsize=6, max_fsize=15, ftype='sans-serif', padding_x=0, padding_y=0)[source]
draw(drawer)[source]
class OutlineFace(stroke_color=None, stroke_width=None, color=None, opacity=0.3, collapsing_height=5, padding_x=0, padding_y=0)[source]
__init__(stroke_color=None, stroke_width=None, color=None, opacity=0.3, collapsing_height=5, padding_x=0, padding_y=0)[source]
compute_bounding_box(drawer, point, size, dx_to_closest_child, bdx, bdy, bdy0, bdy1, pos, row, n_row, n_col, dx_before, dy_before)[source]
draw(drawer)[source]
fits()[source]

Return True if Face fits in computed box. Method overriden by inheriting classes.

get_box()[source]
class PieChartFace(radius, data, name='', padding_x=0, padding_y=0, tooltip=None)[source]
__init__(radius, data, name='', padding_x=0, padding_y=0, tooltip=None)[source]
compute_pie(data)[source]
draw(drawer)[source]
class RectFace(width, height, color='gray', opacity=0.7, text=None, fgcolor='black', min_fsize=6, max_fsize=15, ftype='sans-serif', tooltip=None, name='', padding_x=0, padding_y=0, stroke_color=None, stroke_width=0)[source]
__init__(width, height, color='gray', opacity=0.7, text=None, fgcolor='black', min_fsize=6, max_fsize=15, ftype='sans-serif', tooltip=None, name='', padding_x=0, padding_y=0, stroke_color=None, stroke_width=0)[source]
compute_bounding_box(drawer, point, size, dx_to_closest_child, bdx, bdy, bdy0, bdy1, pos, row, n_row, n_col, dx_before, dy_before)[source]
draw(drawer)[source]
class ScaleFace(name='', width=None, color='black', scale_range=(0, 0), tick_width=80, line_width=1, formatter='%.0f', min_fsize=6, max_fsize=12, ftype='sans-serif', padding_x=0, padding_y=0)[source]
__init__(name='', width=None, color='black', scale_range=(0, 0), tick_width=80, line_width=1, formatter='%.0f', min_fsize=6, max_fsize=12, ftype='sans-serif', padding_x=0, padding_y=0)[source]
compute_bounding_box(drawer, point, size, dx_to_closest_child, bdx, bdy, bdy0, bdy1, pos, row, n_row, n_col, dx_before, dy_before)[source]
draw(drawer)[source]
class SelectedCircleFace(name, radius=15, padding_x=0, padding_y=0)[source]
__init__(name, radius=15, padding_x=0, padding_y=0)[source]
class SelectedFace(name)[source]
__init__(name)[source]
class SelectedRectFace(name, width=15, height=15, text=None, padding_x=1, padding_y=0)[source]
__init__(name, width=15, height=15, text=None, padding_x=1, padding_y=0)[source]
class SeqFace(seq, seqtype='aa', poswidth=15, draw_text=True, max_fsize=15, ftype='sans-serif', padding_x=0, padding_y=0)[source]
__init__(seq, seqtype='aa', poswidth=15, draw_text=True, max_fsize=15, ftype='sans-serif', padding_x=0, padding_y=0)[source]
compute_bounding_box(drawer, point, size, dx_to_closest_child, bdx, bdy, bdy0, bdy1, pos, row, n_row, n_col, dx_before, dy_before)[source]
draw(drawer)[source]
class SeqMotifFace(seq=None, motifs=None, seqtype='aa', gap_format='line', seq_format='[]', width=None, height=None, fgcolor='black', bgcolor='#bcc3d0', gapcolor='gray', gap_linewidth=0.2, max_fsize=12, ftype='sans-serif', padding_x=0, padding_y=0)[source]
__init__(seq=None, motifs=None, seqtype='aa', gap_format='line', seq_format='[]', width=None, height=None, fgcolor='black', bgcolor='#bcc3d0', gapcolor='gray', gap_linewidth=0.2, max_fsize=12, ftype='sans-serif', padding_x=0, padding_y=0)[source]
build_regions()[source]

Build and sort sequence regions: seq representation and motifs

compute_bounding_box(drawer, point, size, dx_to_closest_child, bdx, bdy, bdy0, bdy1, pos, row, n_row, n_col, dx_before, dy_before)[source]
draw(drawer)[source]
fits()[source]

Return True if Face fits in computed box. Method overriden by inheriting classes.

class StackedBarFace(width, height, data=None, name='', opacity=0.7, min_fsize=6, max_fsize=15, ftype='sans-serif', padding_x=0, padding_y=0, tooltip=None)[source]

Face to show a series of stacked bars.

__init__(width, height, data=None, name='', opacity=0.7, min_fsize=6, max_fsize=15, ftype='sans-serif', padding_x=0, padding_y=0, tooltip=None)[source]

Initialize the face.

Parameters:

data – List of tuples, like [(whatever, value, color), …].

draw(drawer)[source]
class TextFace(text, name='', color='black', min_fsize=6, max_fsize=15, ftype='sans-serif', padding_x=0, padding_y=0, width=None, rotation=None)[source]
__init__(text, name='', color='black', min_fsize=6, max_fsize=15, ftype='sans-serif', padding_x=0, padding_y=0, width=None, rotation=None)[source]
compute_bounding_box(drawer, point, size, dx_to_closest_child, bdx, bdy, bdy0, bdy1, pos, row, n_row, n_col, dx_before, dy_before)[source]
draw(drawer)[source]
fits()[source]

Return True if Face fits in computed box. Method overriden by inheriting classes.

Face positions

class AlignedGrid(facecontainer=None)

Grid that also allows to store the horizontal size of each column (dxs).

The idea is to use it for headers and footers in the aligned panel.

__init__(*args, **kwargs)
class Grid

Grid (dict that for each column assigns a list of items).

The idea is to use it with faces, like this:

d[col] == [face1, face2, …] # faces stacked in the column col

add_face(self, face, int column=0)

Add the given face to the specified column.

make_faces()

Return a named tuple that for each position can store a grid of faces.

NodeStyle

class NodeStyle(*args, **kargs)[source]

Dictionary with all valid node graphical attributes.

__init__(*args, **kargs)[source]

For all possible parameters, see NODE_STYLE_DEFAULT. Some descriptions:

Parameters:
  • draw_descendants (True) – Mark an internal node as a leaf.

  • hz_line_width (0) – Horizontal line width in pixels. If 0 it is automatic (normally 1 pixel).

  • vt_line_width (0) – Vertical line width in pixels. If 0 it is automatic (normally 1 pixel).

init()[source]

TreeLayout

class TreeLayout(name, ts=None, ns=None, aligned_faces=False, active=True, legend=True)[source]
__init__(name, ts=None, ns=None, aligned_faces=False, active=True, legend=True)[source]
set_node_style(node)[source]
set_tree_style(tree, style)[source]
cased_name(txt)[source]

TreeStyle

class TreeStyle[source]
__init__()[source]
property active_face
property active_face_pos
add_legend(title, variable='discrete', colormap={}, value_range=None, color_range=None)[source]
property aligned_panel_header
get_legend()[source]
property selected_face
property selected_face_pos

Layouts

context

class LayoutGenomicContext(name='Genomic context', nside=2, conservation_threshold=0, width=70, height=15, collapse_size=1, gene_name='name', tooltip_props=[], stroke_color='gray', stroke_width='1.5px', anchor_stroke_color='black', anchor_stroke_width='3px', non_conserved_color='#d0d0d0', collapse_conservation=0.2, collapse_by_conservation=True)[source]
__init__(name='Genomic context', nside=2, conservation_threshold=0, width=70, height=15, collapse_size=1, gene_name='name', tooltip_props=[], stroke_color='gray', stroke_width='1.5px', anchor_stroke_color='black', anchor_stroke_width='3px', non_conserved_color='#d0d0d0', collapse_conservation=0.2, collapse_by_conservation=True)[source]
get_context(node)[source]
get_tooltip(gene)[source]
set_node_style(node)[source]
set_tree_style(tree, style)[source]

default

class LayoutBranchLength(name='Branch length', pos='branch_top', formatter='%0.5s', color='#8d8d8d', ftype='sans-serif', min_fsize=6, max_fsize=15, padding_x=2, padding_y=0)[source]
__init__(name='Branch length', pos='branch_top', formatter='%0.5s', color='#8d8d8d', ftype='sans-serif', min_fsize=6, max_fsize=15, padding_x=2, padding_y=0)[source]
class LayoutBranchSupport(name='Branch support', pos='branch_bottom', formatter='%0.4s', color='#fa8072', ftype='sans-serif', min_fsize=6, max_fsize=15, padding_x=2, padding_y=0)[source]
__init__(name='Branch support', pos='branch_bottom', formatter='%0.4s', color='#fa8072', ftype='sans-serif', min_fsize=6, max_fsize=15, padding_x=2, padding_y=0)[source]
class LayoutLeafName(name='Leaf name', pos='branch_right', color='black', ftype='sans-serif', min_fsize=4, max_fsize=15, padding_x=5, padding_y=0)[source]
__init__(name='Leaf name', pos='branch_right', color='black', ftype='sans-serif', min_fsize=4, max_fsize=15, padding_x=5, padding_y=0)[source]
set_node_style(node)[source]
class LayoutNumberLeaves(name='Number of leaves', pos='branch_right', collapsed_only=True, formatter='(%s)', color='black', min_fsize=4, max_fsize=15, ftype='sans-serif', padding_x=5, padding_y=0)[source]
__init__(name='Number of leaves', pos='branch_right', collapsed_only=True, formatter='(%s)', color='black', min_fsize=4, max_fsize=15, ftype='sans-serif', padding_x=5, padding_y=0)[source]
set_node_style(node)[source]
class LayoutOutline(name=None, stroke_color='black', stroke_width=0.5, color='lightgray', opacity=0.3, collapsing_height=5)[source]
__init__(name=None, stroke_color='black', stroke_width=0.5, color='lightgray', opacity=0.3, collapsing_height=5)[source]
set_node_style(node)[source]

domain

class LayoutPfamDomains(prop='pfam', name='Pfam domains', column=20, *args, **kwargs)
__init__(prop='pfam', name='Pfam domains', column=20, *args, **kwargs)
class LayoutSmartDomains(prop='smart', name='Smart domains', column=21, *args, **kwargs)
__init__(prop='smart', name='Smart domains', column=21, *args, **kwargs)

eggnog6

class LayoutBestName(prop='best_name', name='Best name', pos='aligned', column=3, color='black', *args, **kwargs)
__init__(prop='best_name', name='Best name', pos='aligned', column=3, color='black', *args, **kwargs)
class LayoutBigg(prop='bigg', name='BIGG', pos='aligned', column=8, color='gray', *args, **kwargs)
__init__(prop='bigg', name='BIGG', pos='aligned', column=8, color='gray', *args, **kwargs)
class LayoutCard(prop='card', name='CARD', pos='aligned', column=6, color='gray', *args, **kwargs)
__init__(prop='card', name='CARD', pos='aligned', column=6, color='gray', *args, **kwargs)
class LayoutCazy(prop='cazy', name='Cazy', pos='aligned', column=5, color='gray', *args, **kwargs)
__init__(prop='cazy', name='Cazy', pos='aligned', column=5, color='gray', *args, **kwargs)
class LayoutEvolEvents(name='Evolutionary events', prop='evol_event', speciation_color='blue', duplication_color='red', legend=True)[source]
__init__(name='Evolutionary events', prop='evol_event', speciation_color='blue', duplication_color='red', legend=True)[source]
set_node_style(node)[source]
set_tree_style(tree, tree_style)[source]
class LayoutKeggEnzyme(prop='kegg_enzyme', name='KEGG enzyme', pos='aligned', column=12, color='gray', *args, **kwargs)
__init__(prop='kegg_enzyme', name='KEGG enzyme', pos='aligned', column=12, color='gray', *args, **kwargs)
class LayoutKeggModule(prop='kegg_module', name='KEGG module', pos='aligned', column=11, color='gray', *args, **kwargs)
__init__(prop='kegg_module', name='KEGG module', pos='aligned', column=11, color='gray', *args, **kwargs)
class LayoutKeggNumber(prop='kegg_number', name='KEGG number', pos='aligned', column=9, color='gray', *args, **kwargs)
__init__(prop='kegg_number', name='KEGG number', pos='aligned', column=9, color='gray', *args, **kwargs)
class LayoutKeggPathway(prop='kegg_pathway', name='KEGG pathway', pos='aligned', column=10, color='gray', *args, **kwargs)
__init__(prop='kegg_pathway', name='KEGG pathway', pos='aligned', column=10, color='gray', *args, **kwargs)
class LayoutLastCommonAncestor(name='Last common ancestor', rect_width=15, column=1000)[source]
Node properties needed
taxid:

color

sci_name:

text shown

__init__(name='Last common ancestor', rect_width=15, column=1000)[source]
get_color(node)[source]
set_node_style(node)[source]
class LayoutPdb(prop='pdb', name='PDB', pos='aligned', column=7, color='gray', *args, **kwargs)
__init__(prop='pdb', name='PDB', pos='aligned', column=7, color='gray', *args, **kwargs)
class LayoutPfamDomains(prop='pfam', name='Pfam domains', column=20, *args, **kwargs)
__init__(prop='pfam', name='Pfam domains', column=20, *args, **kwargs)
class LayoutProteinName(prop='prot_name', name='Protein name', pos='aligned', column=4, color='gray', *args, **kwargs)
__init__(prop='prot_name', name='Protein name', pos='aligned', column=4, color='gray', *args, **kwargs)
class LayoutScientificName(prop='sci_name', name='Scientific name', pos='branch_right', column=2, color='black', *args, **kwargs)
__init__(prop='sci_name', name='Scientific name', pos='branch_right', column=2, color='black', *args, **kwargs)
class LayoutSmartDomains(prop='smart', name='Smart domains', column=21, *args, **kwargs)
__init__(prop='smart', name='Smart domains', column=21, *args, **kwargs)

etecompare

class LayoutEteDiffDistance(name='ETE diff distance', diff_node_color='#a50000', diff_node_size=4)[source]
__init__(name='ETE diff distance', diff_node_color='#a50000', diff_node_size=4)[source]
set_node_style(node)[source]

evocell

class LayoutHumanOGs(name='Human OGs', human_orth_prop='human_orth', column=5, color='#6b92d6')[source]
__init__(name='Human OGs', human_orth_prop='human_orth', column=5, color='#6b92d6')[source]
set_node_style(node)[source]
class LayoutUCSC(name='UCSC', column=6, nodecolor='#800000', nodesize=5, textcolor='#c43b5d')[source]
__init__(name='UCSC', column=6, nodecolor='#800000', nodesize=5, textcolor='#c43b5d')[source]
set_node_style(node)[source]
class LayoutUCSCtrans(name='UCSC Trans', ucsc_trans_prop='ucsc_trans', column=4, color='#6b92d6')[source]
__init__(name='UCSC Trans', ucsc_trans_prop='ucsc_trans', column=4, color='#6b92d6')[source]
set_node_style(node)[source]

evol_events

class LayoutEvolEvents(name='Evolutionary events', prop='evol_event', speciation_color='blue', duplication_color='red', legend=True)[source]
__init__(name='Evolutionary events', prop='evol_event', speciation_color='blue', duplication_color='red', legend=True)[source]
set_node_style(node)[source]
set_tree_style(tree, tree_style)[source]

ncbi_taxonomy

class LayoutLastCommonAncestor(name='Last common ancestor', rect_width=15, column=1000)[source]
Node properties needed
taxid:

color

sci_name:

text shown

__init__(name='Last common ancestor', rect_width=15, column=1000)[source]
get_color(node)[source]
set_node_style(node)[source]

phylocloud_egg5

get_layout_evoltype()[source]
get_layout_gnames()[source]
get_layout_lca_rects()[source]
get_layout_ogs_egg5()[source]
get_layout_sciname()[source]

seq

class LayoutAlignment(name='Alignment', alignment=None, format='seq', width=700, height=15, column=0, range=None, summarize_inner_nodes=False)[source]
__init__(name='Alignment', alignment=None, format='seq', width=700, height=15, column=0, range=None, summarize_inner_nodes=False)[source]
get_seq(node)[source]
set_node_style(node)[source]
set_tree_style(tree, tree_style)[source]

spongilla

class LayoutAutoName(name='Auto name', text_color='grey')[source]
__init__(name='Auto name', text_color='grey')[source]
set_node_style(node)[source]
class LayoutCuratedName(name='Preferred name', text_color='black')[source]
__init__(name='Preferred name', text_color='black')[source]
set_node_style(node)[source]
class LayoutEukOgs(name='OGs euk', text_color='grey')[source]
__init__(name='OGs euk', text_color='grey')[source]
set_node_style(node)[source]
class LayoutPreferredName(name='Preferred name', text_color='#fb3640')[source]
__init__(name='Preferred name', text_color='#fb3640')[source]
set_node_style(node)[source]
class LayoutSciName(name='Scientific name')[source]
__init__(name='Scientific name')[source]
set_node_style(node)[source]
class LayoutSeeds(name='Seeds', text_color='grey')[source]
__init__(name='Seeds', text_color='grey')[source]
set_node_style(node)[source]

staple

class LayoutBarplot(name=None, width=200, size_prop=None, color_prop=None, position='aligned', column=0, color_gradient=None, color='red', colors=None, padding_x=10, scale=True, legend=True, active=True)[source]
__init__(name=None, width=200, size_prop=None, color_prop=None, position='aligned', column=0, color_gradient=None, color='red', colors=None, padding_x=10, scale=True, legend=True, active=True)[source]
set_node_style(node)[source]
set_tree_style(tree, tree_style)[source]