Skip to content

Commit c5ed5c4

Browse files
use python's built-in 'removeprefix' function
Co-authored-by: James Stevenson <[email protected]>
1 parent ccc70ad commit c5ed5c4

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/anyvlm/utils/types.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,7 @@ def _normalize_chromosome_name(chromosome_name: str) -> str:
5858
:param chromosome_name: The name of the chromosome to normalize, following the rules stated above.
5959
:return: The chromosome name, stripped of it's 'chr' prefix if it was added
6060
"""
61-
# strip the 'chr' prefix if it was included
62-
chromosome_name = (
63-
chromosome_name[3:]
64-
if chromosome_name.lower().startswith("chr")
65-
else chromosome_name
66-
).upper()
61+
chromosome_name = chromosome_name.upper().removeprefix("CHR")
6762

6863
if is_valid_chromosome_name(chromosome_name):
6964
return chromosome_name

0 commit comments

Comments
 (0)