From 9196d8751ae3b1764ddcfc8e2c56a933130fabdd Mon Sep 17 00:00:00 2001 From: Kevin Wang Date: Sat, 28 Dec 2024 11:24:10 -0600 Subject: [PATCH] Add test coverage for lineage channel indices --- tests/test_data.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/test_data.py b/tests/test_data.py index 2764822..3fdb5e5 100644 --- a/tests/test_data.py +++ b/tests/test_data.py @@ -359,7 +359,21 @@ def test_subset_channels(self): assert exprs.n_channels == 2 assert exprs.lineage_channels is not None assert exprs.lineage_channels.shape[0] == 2 + assert np.all(np.equal(exprs._lineage_channels_indices, np.array([0, 1]))) assert not np.isin("Channel0", exprs.lineage_channels) + + + def test_subset_channels_lineage_indices(self): + exprs_matrix: np.ndarray = np.random.rand(100, 10) + channels: np.ndarray = np.arange(10).astype(str) + exprs = PyCytoData(exprs_matrix, channels=channels) + exprs.subset(channels=["1", "2"]) + assert exprs.n_cells == 100 + assert exprs.n_channels == 2 + assert exprs.lineage_channels is None + assert exprs._lineage_channels_indices.shape[0] == 2 + assert np.all(np.equal(exprs._lineage_channels_indices, np.array([0, 1]))) + assert not np.isin("0", exprs.lineage_channels) def test_subset_cell_types(self):