Python package for building, comparing, annotating, manipulating and visualising trees. It provides a comprehensive API and a collection of command line tools, including utilities to work with the NCBI taxonomy tree.
If more than one TreeLayouts in differnt columns, alignment will be misaligned with the scale face under the format 'seq' and 'compactseq' during zooming in.
Here is example, normal situation(only one treelayout)
(alignment aligned with the position 1817 when zoom in alined panel, perfect)
example when more one treelayout,
(now column 1 is Rectangular face, column 2 is alignment face)
(alignment fails to align with the position 1817 when zoom in alined panel and cannot be recovered)
Issue tracked down:
ete4/smartview/renderer/faces.py line 1401
posw = self.poswidth * self.w_scale
viewport_start = vx0 - self.viewport_margin / zx
viewport_end = vx1 + self.viewport_margin / zx
sm_x = max(viewport_start - x0, 0)
sm_start = round(sm_x / posw)
w = self.seqlength * posw
sm_x0 = x0 if drawer.TYPE == "rect" else 0
sm_end = self.seqlength - round(max(sm_x0 + w - viewport_end, 0) / posw)
if too_small or self.seq_format == "[]":
for start, end in self.blocks:
if end >= sm_start and start <= sm_end:
bstart = max(sm_start, start)
bend = min(sm_end, end)
bx = x0 + bstart * posw
by, bh = get_height(bx, y)
box = Box(bx, by, (bend + 1 - bstart) * posw, bh)
yield [ "pixi-block", box ]
else:
seq = self.get_seq(sm_start, sm_end)
sm_x = sm_x if drawer.TYPE == 'rect' else x0
y, h = get_height(sm_x, y)
sm_box = Box(sm_x+sm_x0, y, posw * len(seq), h)
if self.seq_format == 'compactseq' or posw * zx < self._min_fsize:
aa_type = "notext"
else:
aa_type = "text"
yield [ f'pixi-aa_{aa_type}', sm_box, seq ]
if sm_box start with sm_x is correct only there is no other layouts in previous aligned panel.
Solution:
line 1424
sm_box = Box(sm_x, y, posw * len(seq), h)
should be
sm_box = Box(sm_x+sm_x0, y, posw * len(seq), h)
If more than one TreeLayouts in differnt columns, alignment will be misaligned with the scale face under the format 'seq' and 'compactseq' during zooming in.
Here is example, normal situation(only one treelayout)
(alignment aligned with the position 1817 when zoom in alined panel, perfect)
example when more one treelayout,
(now column 1 is Rectangular face, column 2 is alignment face)
Issue tracked down: ete4/smartview/renderer/faces.py line 1401
if sm_box start with sm_x is correct only there is no other layouts in previous aligned panel.
Solution: line 1424
sm_box = Box(sm_x, y, posw * len(seq), h)
should besm_box = Box(sm_x+sm_x0, y, posw * len(seq), h)