def Update_coo_lists_site(current_file, data, row, col, valid_chroms,
    frag_index, dangling=False):
    """Takes file and assigns reads to restriction sites based on direction. 
    Returns the list that is then used to create the sparse matrix"""
    with open(current_file, 'r') as pairs:
        for line in pairs:
            info = line.split()
            frag_1 = info[8]
            frag_2 = info[9]
            chr_1 = info[1]
            chr_2 = info[4]
            dir_1 = info[3]
            dir_2 = info[6]
            if chr_1 in valid_chroms and chr_2 in valid_chroms:
                index_frag_1 = frag_index[frag_1]
                index_frag_2 = frag_index[frag_2]
                if dangling:
                    if dir_1 == '-':
                        index_frag_1 += 1
                    if dir_2 == '-':
                        index_frag_2 += 1
                else:
                    if dir_1 == '+':
                        index_frag_1 += 1
                    if dir_2 == '+':
                        index_frag_2 += 1
                data.append(1)
                data.append(1)
                row.append(index_frag_1)
                col.append(index_frag_2)
                row.append(index_frag_2)
                col.append(index_frag_1)
    return data, row, col
