def fill_up_scores_w_val(bed, val = 1):
    """Fill up scores with a value
    
    Parameters:
    1. bed: a Bed object
    2. val: a value to fill with
    """
    #if empty bed, just return None
    try:
        chroms = bed.get_chroms()
    except __HOLE__:
        return
    
    if not chroms: return
    
    for chrom in chroms:
        
        if not bed[chrom].has_key('name'):
            bed[chrom]['name'] = [0] * len(bed[chrom]['start'])
        
        bed[chrom]['score'] = array('d', [1.0]*len(bed[chrom]['start']))
dataset/ETHPy150Open taoliu/taolib/Assoc/inout.py/fill_up_scores_w_val