def test_no_collapse_real_data(self): positions = pd.read_csv("testFiles/testAssignRegions.csv") arms = HT.get_arms_hg19() cooler_file = cooler.Cooler( "testFiles/test3_realdata.mcool::resolutions/50000") expected = HT.get_expected(cooler_file, arms) result = HT.do_pileup_obs_exp(cooler_file, expected, positions, proc=1, collapse=False) expected = np.load( "testFiles/real_data_obsexp_pileup_not_collapsed.npy") self.assertTrue(np.allclose(result, expected, equal_nan=True))
def test_collapse(self): """Tests pileup of synthetic Hi-C data, with collapsing results.""" position_frame = pd.read_csv("testFiles/posPileups.csv") arms = pd.DataFrame({ "chrom": "chrSyn", "start": 0, "end": 4990000 }, index=[0]) assigned = HT.assign_regions(50000, 10000, position_frame["chrom"], position_frame["pos"], arms) cooler_file = cooler.Cooler( "testFiles/test2.mcool::/resolutions/10000") exp_f = HT.get_expected(cooler_file, arms, ignore_diagonals=0) result = HT.do_pileup_obs_exp(cooler_file, exp_f, assigned, proc=1, collapse=True) expected = np.load("testFiles/test_pileups_obsExp_collapse.npy") self.assertTrue(np.allclose(result, expected))