e8a8edec508fcf886d5c6329ff0729b1cff845e8,hicexplorer/utilities.py,,exp_obs_matrix_norm,#Any#Any#Any#,287

Before Change


        data_type = type(pSubmatrix.data[0])

        expected = expected_interactions_in_distance_[distance]
        pSubmatrix.data = pSubmatrix.data.astype(np.float32)
        pSubmatrix.data /= expected
        pSubmatrix.data = convertInfsToZeros_ArrayFloat(pSubmatrix.data).astype(data_type)

    return pSubmatrix

After Change



    expected_interactions_in_distance = expected_interactions_norm(pLength_chromosome, pChromosome_count, pSubmatrix)
    
    row_sums = np.array(pSubmatrix.sum(axis=1).T).flatten()
    total_interactions = pSubmatrix.sum()

    row, col = pSubmatrix.nonzero()
    // data = pSubmatrix.data.tolist()
    for i in range(len(row)):
        expected = expected_interactions_in_distance[np.absolute(row[i]-col[i])] 
        expected /= row_sums[row[i]] * row_sums[col[i]] / total_interactions
        pSubmatrix.data[i] /= expected
    return pSubmatrix

def toString(s):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: deeptools/HiCExplorer
Commit Name: e8a8edec508fcf886d5c6329ff0729b1cff845e8
Time: 2018-09-04
Author: wolffj@informatik.uni-freiburg.de
File Name: hicexplorer/utilities.py
Class Name:
Method Name: exp_obs_matrix_norm


Project Name: Bihaqo/t3f
Commit Name: 95b514506001427defabbcc4ba9fba888932b605
Time: 2017-12-26
Author: khrulkov.v@gmail.com
File Name: t3f/initializers.py
Class Name:
Method Name: matrix_zeros


Project Name: Bihaqo/t3f
Commit Name: 95b514506001427defabbcc4ba9fba888932b605
Time: 2017-12-26
Author: khrulkov.v@gmail.com
File Name: t3f/initializers.py
Class Name:
Method Name: matrix_ones