Skip to content

Commit

Permalink
Be smarter about chrZ (#703, thanks @manighanipoor) (#704)
Browse files Browse the repository at this point in the history
  • Loading branch information
tanghaibao authored Sep 6, 2024
1 parent 9b9dd69 commit eeb327b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions jcvi/graphics/karyotype.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ def make_circle_name(sid, rev):

in_reverse = sid in rev
sid = sid.rsplit("_", 1)[-1]
sid = sid.replace("chr", "").replace("Chr", "")
si = re.findall(r"\d+", sid)
if si:
si = str(int(si[0]))
Expand Down
2 changes: 2 additions & 0 deletions tests/graphics/test_karyotype.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
("chr01", {}, "1"),
("Ttru_Chr1", {}, "1"),
("pseudochromosome_1", {}, "1"),
("chrZ", {}, "Z"),
("ChrX", {"ChrX"}, "X-"),
],
)
def test_make_circle_name(sid, rev, expected):
Expand Down

0 comments on commit eeb327b

Please sign in to comment.