Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use natsorted in graphics.chromosome (thanks @cutykaka, #588) #589

Merged
merged 1 commit into from
Aug 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion jcvi/graphics/chromosome.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import sys
from itertools import groupby
from math import ceil
from natsort import natsorted
from typing import Tuple

import numpy as np
Expand Down Expand Up @@ -586,7 +587,7 @@ def draw_chromosomes(
ratio = r / max_chr_len # canvas / base

# first the chromosomes
for a, (chr, clen) in enumerate(sorted(chr_lens.items())):
for a, (chr, clen) in enumerate(natsorted(chr_lens.items())):
xx = xstart + a * xinterval + 0.5 * xwidth
root.text(xx, ystart + 0.01, str(get_number(chr)), ha="center")
if centromeres:
Expand Down