|
a |
|
b/tests/diffexp/test_DEResults.py |
|
|
1 |
import unittest |
|
|
2 |
|
|
|
3 |
import pandas as pd |
|
|
4 |
|
|
|
5 |
from inmoose.diffexp import DEResults |
|
|
6 |
|
|
|
7 |
|
|
|
8 |
class Test(unittest.TestCase): |
|
|
9 |
def test_DEResults(self): |
|
|
10 |
df = pd.DataFrame() |
|
|
11 |
with self.assertRaisesRegex( |
|
|
12 |
ValueError, "log2FoldChange missing from results table" |
|
|
13 |
): |
|
|
14 |
res = DEResults(df) |
|
|
15 |
|
|
|
16 |
df["log2FoldChange"] = [1, 2, 3] |
|
|
17 |
with self.assertRaisesRegex(ValueError, "lfcSE missing from results table"): |
|
|
18 |
res = DEResults(df) |
|
|
19 |
|
|
|
20 |
df["lfcSE"] = [0.1, 0.2, 0.3] |
|
|
21 |
with self.assertRaisesRegex(ValueError, "pvalue missing from results table"): |
|
|
22 |
res = DEResults(df) |
|
|
23 |
|
|
|
24 |
df["pvalue"] = [0.01, 0.02, 0.03] |
|
|
25 |
res = DEResults(df) |
|
|
26 |
|
|
|
27 |
_subres = res.loc[:1, :] |