superexacttestpy.tl.supertest

superexacttestpy.tl.supertest(data, n, names=[], degree=-1, lower_tail=True)

Calculate the supertest for a given data set

Parameters:
data : list

The data set to use

n : int

The number of background-size

names : list

The list of names to use

degree : int

The degree of the barcode (if -1, no degree selection)

lower_tail : bool

If True, the probability is P[overlap < m], otherwise, P[overlap >= m], where m is the number of elements shared by all sets.

Returns:

A dataframe with all the information computed by the supertest

Return type:

pd.DataFrame

Example

>>> data = [["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q"],
    ["L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],
    ["H","I","J","K","L","M","N","O","P","Q"]]
>>> supertest(data, n=100,degree=-1,
    names=["First","Second","Third"],
    lower_tail=False)
...    |     | intersection           |   degree |   observed_overlap |   expected_overlap |   fold_enrichment |    p_value | elements                                          |
...    |----:|:-----------------------|---------:|-------------------:|-------------------:|------------------:|-----------:|:--------------------------------------------------|
...    | 001 | Third                  |        1 |                 10 |            nan     |         nan       | nan        | H, I, J, K, L, M, N, O, P, Q                      |
...    | 010 | Second                 |        1 |                 15 |            nan     |         nan       | nan        | L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z       |
...    | 011 | Second & Third         |        2 |                  6 |              1.5   |           4       |   0.999415 | L, M, N, O, P, Q                                  |
...    | 100 | First                  |        1 |                 17 |            nan     |         nan       | nan        | A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q |
...    | 101 | First & Third          |        2 |                 10 |              1.7   |           5.88235 |   1        | H, I, J, K, L, M, N, O, P, Q                      |
...    | 110 | First & Second         |        2 |                  6 |              2.55  |           2.35294 |   0.983943 | L, M, N, O, P, Q                                  |
...    | 111 | First & Second & Third |        3 |                  6 |              0.255 |          23.5294  |   1        | L, M, N, O, P, Q                                  |