def combine(beds, beds_sorted=False, postmerge=True):
    beds = copy.deepcopy(beds)
    for i,v in enumerate(beds):
        if type(v) == str:
            beds[i] = pbt.BedTool(v)
        if not beds_sorted:
            beds[i] = beds[i].sort()
    out = reduce(lambda x,y : x.cat(y, postmerge=False), beds)
    out = out.sort()
    if postmerge:
        out = out.merge()
    return out