superexacttestpy.tl.cpsets

superexacttestpy.tl.cpsets(x, data, n, lower_tail=True, logp=False, p_val_sim=False, number_sim=100000)

Compute the distribution function of the multiset intersection test. With the possibility to simulate a p-value

Parameters:
x : int

Number of elements x

data : list

List of the sublist of gene

n : bool

Length of total background

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.

logp : bool

The result should be with a log scale

number_sim : int

Number of simulations

Returns:

p – Probability

Return type:

float

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"]]
>>> cpsets(2,data,
    1000, True,False)
... 9.707720779507648e-16