Skip to content

v1.6.6

  • v1.6.6
  • 846be3c
  • Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
  • Choose a tag to compare

  • v1.6.6
  • 846be3c
  • Choose a tag to compare

  • Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
@tanghaibao tanghaibao tagged this 21 Jun 00:26
* Add --chinese (CJK) figure-label rendering, plus related fixes

Add a global --chinese option (in set_image_options) that renders figure
labels in Chinese: it implies --notex and selects a CJK-capable font
(set_chinese_font / CJK_FONTS, cross-platform). markup() now degrades LaTeX
markup when usetex is off (\textit{} -> mathtext italic, strips *..*, \\,
\noindent) so labels stay readable without LaTeX.

Per-figure Chinese variants are wired through where the textbook figures are
generated: graphics.tree (geoscale era/axis names), graphics.dotplot (title),
graphics.karyotype, graphics.align demo, projects.misc waterlilyGOM,
projects.jcvi synteny, projects.napus fig3.

Also fixes several rendering issues found along the way:
- karyotype: restrict provided `sizes` to each track's seqids, otherwise every
  track inherits the genome-wide total and the per-chromosome gauge/coverage
  axes collapse (e.g. napus fig3 panel A).
- tree: align leaf tips at max_dist on geoscale trees so a rerooted outgroup
  is drawn at the present instead of in the past.
- compara.ks: tolerate Biopython>=1.78 (Bio.Align.Applications removed) and
  resolve PAML/PAL2NAL paths lazily so importing the module no longer prompts.
- graphics.align: integer slice indices in OpticalMapTrack.duplicate.
- projects.napus: modernize annotate() arrowprops (drop removed `frac` kwarg).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QEaqko1qcY3wLLB93giokq

* Style fixes by Black

* Address PR review: markup/coverage latex safety, ks shims, karyotype validation

- coverage: format track labels via the *..* convention so markup() produces
  valid output under both latex (-> \textit) and --notex (-> mathtext italic);
  previously a pre-formatted \textit{} string was latex-escaped and broke.
- markup: render *..* like \textit{} when usetex is off (mathtext italic for
  ASCII, plain for CJK).
- compara.ks: replace the None fallback with minimal Clustalw/Muscle command
  shims (build the command and run the binary) so call sites keep working on
  Biopython >= 1.78 instead of failing with a NoneType TypeError.
- karyotype: when sizes is provided, validate every seqid has a size and fail
  early with a clear message instead of a later KeyError in Track.draw.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QEaqko1qcY3wLLB93giokq

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: tanghaibao <106987+tanghaibao@users.noreply.github.com>
Assets 2
Loading