Example #1
0
 def test_get_limma_stats_raises_for_invalid_subsets(self):
     df = pd.DataFrame([[5, 10, 15, 20]],
                       index=['foo'],
                       columns=[0, 1, 2, 3])
     subsets = [[0, 1]]
     with pytest.raises(ValueError) as e:
         array_stats.get_limma_stats(df=df, subsets=subsets)
         assert 'requires at least two' in e
Example #2
0
 def test_get_limma_stats_returns_correct_for_2_groups(self):
     df = pd.DataFrame([[5, 10, 15, 20]],
                       index=['foo'],
                       columns=[0, 1, 2, 3])
     subsets = [[0, 1], [2, 3]]
     stats = array_stats.get_limma_stats(df=df, subsets=subsets)
     assert all(
         stat in list(stats) for stat in
         ['feature', 'logFC', 'AveExpr', 't', 'P.Value', 'adj.P.Val', 'B'])
Example #3
0
 def test_get_limma_stats_raises_for_invalid_df(self):
     df = pd.DataFrame([], index=['foo'], columns=[])
     subsets = [[0], [0]]
     with pytest.raises(ValueError) as e:
         array_stats.get_limma_stats(df=df, subsets=subsets)
         assert 'dimension 1x2 or more' in e