Exemple #1
0
    def test_extract_data_normal_run_raw(self, adata: AnnData):
        raw = _extract_data(adata, use_raw=True, layer="Ms")

        assert raw is adata.raw.X
Exemple #2
0
    def test_extract_data_normal_run_layer(self, adata: AnnData):
        ms = _extract_data(adata, layer="Ms", use_raw=False)

        assert ms is adata.layers["Ms"]
Exemple #3
0
    def test_extract_data_normal_run(self, adata: AnnData):
        X = _extract_data(adata, use_raw=False)

        assert X is adata.X
Exemple #4
0
 def test_extract_data_invalid_layer(self, adata: AnnData):
     with pytest.raises(KeyError):
         _extract_data(adata, layer="foo", use_raw=False)
Exemple #5
0
 def test_extract_data_raw_None(self, adata: AnnData):
     adata = AnnData(adata.X, raw=None)
     with pytest.raises(ValueError):
         _extract_data(adata, use_raw=True)
Exemple #6
0
 def test_extract_data_wrong_type(self):
     with pytest.raises(TypeError):
         _extract_data(None)