results(res, test=None, fdr=None)
Extract spiDE’s test results (R results); see SpiDEResults.results.
Parameters
| res |
SpiDEResults |
The results of test_spide or spide. |
required |
| test |
('condition', 'pooled', 'both') |
Which test’s rows (default: the condition test if there is one, else pooled). |
"condition" |
| fdr |
float |
Keep only the rows in a BH family with q <= fdr. |
None |
Returns
|
pandas.DataFrame |
One row per (gene, index, niche, test), ordered by p-value (missing last). |
See Also
SpiDEResults.results : The method this calls. test_spide : Produces the results.
Examples
from spidepy import build_niches, fit_spide, results, test_spide
from spidepy.datasets import toy_spide
fit = fit_spide(build_niches(toy_spide(), sigma=30), condition="condition", verbose=False)
res = test_spide(fit)
tb = results(res, test="pooled")
tb.shape
results(res, fdr=0.05)[["gene", "index", "niche", "test"]].values.tolist()
[['G1', 'A', 'B', 'condition']]