def _str_to_iv(givstr, template_extension=0):
    """Converts a string representation 'chr:start-end' into genomic coordinates."""
    sub = givstr.split(':')
    if len(sub) == 1:
        return sub[0],
    chr_ = sub[0]
    second_split = sub[1].split('-')
    if second_split[0] == '':
        second_split = second_split[1:]
        second_split[0] = '-' + second_split[0]
    if second_split[1] == '':
        raise ValueError('Invalid genomic location string: {}'.format(givstr))
    start = int(second_split[0])
    end = int(second_split[1])
    return chr_, start - template_extension, end + template_extension
