def get_locus_info(locus):
""" Returns chrom, start and stop from locus string.
Enforces standardization of how locus is represented.
chrom:start_stop (start and stop should be ints or 'None')
"""
chrom, start_stop = locus.split(':')
if chrom == 'None':
chrom = None
start, stop = re.split("\.\.|-", start_stop)
if start == 'None':
start = None
else:
start = int(float(start))
if stop == 'None':
stop = None
else:
stop = int(float(stop))
return (str(chrom), start, stop)
评论列表
文章目录