cocoatree.visualization.add_heatmap_to_tree

cocoatree.visualization.add_heatmap_to_tree(tree_style, tree_ete3, xcor_id, xcor_seq, matrix_type='identity', column_start=0, width=20, colormap='inferno')[source]

Add heatmap to ETE3’s tree style

Parameters

tree_style : ETE3’s tree_style object

tree_ete3ete3’s tree object,

as imported by io.load_tree_ete3()

xcor_idlist of XCoR sequence identifiers, as imported by io.load_msa()

the ids must match with the tree’s leaves id

xcor_seqcorresponding list of XCoR sequences to display,

as imported by io.load_msa()

matrix_typestr, default=’identity’

whether to compute pairwise matrix identity (‘identity’), similarity (‘similarity’), or normalized similarity (‘norm_similarity’)

column_startint, optional, default0

the column on which to start plotting

widthint, optional, default20

the width of each square of the heatmap. If width == 20, the heatmap will be squared.

colormapstr, optional, default: “inferno”

any Matplotlib’s colormap

Returns

tree_style : TreeStyle class from ete3

column_endint, the number of columns after the tree. If you want to

plot anything else alongside the tree, the column number should be equal to this value.