def parseRegionBed(regionfile, regionDictIn):
    """ 
    Read through the supplied bed file and add the rows to the input region dictionary before returning it. Appends to the input dict, rather than overwriting it.
    """
    regionDict = regionDictIn
    for line in open(str(regionfile), 'r'):
        col = line.strip().split('\t')
        chrom = col[0]
        start = col[1]
        end = col[2]
        if len(col) > 3:
            name = col[3]
        else:
            name = str(chrom) + ':' + str(start) + '-' + str(end)
        regionDict[chrom].add((start, end, name))
    return regionDict
