def parse_bed(fn):
    """(internal) Parses a BED6+ file.
    """
    regions = []
    with open(fn) as fh:
        for line in fh:
            fields = line.strip().split('\t')
            fields[1:3] = map(int, fields[1:3])
            bed6 = fields[:6]
            if fields[1] < 0:
                continue
            regions.append(bed6)
    return regions
