def test_get_overlapping_no_overlap(self): t1 = Table(np.array([[0, 1, 3], [1, 1, 2]]), ['O1', 'O2'], ['S1', 'S2', 'S3']) t2 = Table(np.array([[0, 2, 6], [2, 2, 4]]), ['O3', 'O4'], ['S4', 'S5', 'S6']) # samples obs = _get_overlapping([t1, t2], 'sample') self.assertEqual(set(), obs) # features obs = _get_overlapping([t1, t2], 'observation') self.assertEqual(set(), obs)
def test_get_overlapping_no_overlap(self): t1 = Table(np.array([[0, 1, 3], [1, 1, 2]]), ['O1', 'O2'], ['S1', 'S2', 'S3']) t2 = Table(np.array([[0, 2, 6], [2, 2, 4]]), ['O3', 'O4'], ['S4', 'S5', 'S6']) # samples obs = _get_overlapping([t1, t2], 'sample') self.assertEqual(set(), obs) # features obs = _get_overlapping([t1, t2], 'observation') self.assertEqual(set(), obs)
def test_get_overlapping_multiple(self): t1 = Table(np.array([[0, 1, 3], [1, 1, 2]]), ['O1', 'O2'], ['S1', 'S2', 'S3']) t2 = Table(np.array([[0, 2, 6], [2, 2, 4]]), ['O1', 'O3'], ['S1', 'S5', 'S6']) t3 = Table(np.array([[3, 3, 1], [0, 2, 1]]), ['O1', 'O2'], ['S1', 'S3', 'S6']) # samples obs = _get_overlapping([t1, t2, t3], 'sample') self.assertEqual({'S1', 'S3', 'S6'}, obs) # features obs = _get_overlapping([t1, t2, t3], 'observation') self.assertEqual({'O1', 'O2'}, obs)
def test_get_overlapping_multiple(self): t1 = Table(np.array([[0, 1, 3], [1, 1, 2]]), ['O1', 'O2'], ['S1', 'S2', 'S3']) t2 = Table(np.array([[0, 2, 6], [2, 2, 4]]), ['O1', 'O3'], ['S1', 'S5', 'S6']) t3 = Table(np.array([[3, 3, 1], [0, 2, 1]]), ['O1', 'O2'], ['S1', 'S3', 'S6']) # samples obs = _get_overlapping([t1, t2, t3], 'sample') self.assertEqual({'S1', 'S3', 'S6'}, obs) # features obs = _get_overlapping([t1, t2, t3], 'observation') self.assertEqual({'O1', 'O2'}, obs)