mmds_rs = np.zeros(n) cmds_rs = np.zeros(n) minimds_rs = np.zeros(n) mogen_rs = np.zeros(n) for i, chrom in enumerate(chroms): bedpath = "hic_data/GM12878_combined_{}_10kb.bed".format(chrom) mmds_structure = dt.structure_from_file( "hic_data/GM12878_combined_{}_10kb_mmds_coords.tsv".format(chrom)) contactMat = dt.matFromBed(bedpath, mmds_structure) mmds_true_mat = at.contactToDist(contactMat) at.makeSymmetric(mmds_true_mat) for j in range(len(mmds_true_mat)): #remove diagonal mmds_true_mat[j, j] = 0 mmds_distMat = misc.distMat(mmds_structure) mmds_rs[i] = misc.pearson(mmds_true_mat, mmds_distMat) cmds_structure = dt.structure_from_file( "hic_data/GM12878_combined_{}_10kb_cmds_coords.tsv".format(chrom)) contactMat = dt.matFromBed(bedpath, cmds_structure) cmds_true_mat = at.contactToDist(contactMat) at.makeSymmetric(cmds_true_mat) for j in range(len(cmds_true_mat)): #remove diagonal cmds_true_mat[j, j] = 0 cmds_distMat = misc.distMat(cmds_structure) cmds_rs[i] = misc.pearson(cmds_true_mat, cmds_distMat) minimds_structure = dt.structure_from_file( "hic_data/GM12878_combined_{}_10kb_minimds_coords.tsv".format(chrom)) contactMat = dt.matFromBed(bedpath, minimds_structure)
import sys sys.path.append("..") import data_tools as dt import array_tools as at import misc bedpath = "hic_data/GM12878_combined_22_100kb.bed" mmds_cluster = dt.clusterFromFile( "hic_data/GM12878_combined_22_100kb_mmds_coords.tsv") contactMat = dt.matFromBed(bedpath, mmds_cluster) mmds_true_mat = at.contactToDist(contactMat) at.makeSymmetric(mmds_true_mat) for j in range(len(mmds_true_mat)): #remove diagonal mmds_true_mat[j, j] = 0 mmds_distMat = misc.distMat(mmds_cluster) mmds_r = misc.pearson(mmds_true_mat, mmds_distMat) cmds_cluster = dt.clusterFromFile( "hic_data/GM12878_combined_22_100kb_cmds_coords.tsv") contactMat = dt.matFromBed(bedpath, cmds_cluster) cmds_true_mat = at.contactToDist(contactMat) at.makeSymmetric(cmds_true_mat) for j in range(len(cmds_true_mat)): #remove diagonal cmds_true_mat[j, j] = 0 cmds_distMat = misc.distMat(cmds_cluster) cmds_r = misc.pearson(cmds_true_mat, cmds_distMat) minimds_cluster = dt.clusterFromFile( "hic_data/GM12878_combined_22_100kb_minimds_coords.tsv") contactMat = dt.matFromBed(bedpath, minimds_cluster)