diff --git a/jcvi/graphics/karyotype.py b/jcvi/graphics/karyotype.py index 42bcb634..723628b7 100644 --- a/jcvi/graphics/karyotype.py +++ b/jcvi/graphics/karyotype.py @@ -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])) diff --git a/tests/graphics/test_karyotype.py b/tests/graphics/test_karyotype.py index 15b13e41..ecc91fd9 100644 --- a/tests/graphics/test_karyotype.py +++ b/tests/graphics/test_karyotype.py @@ -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):