Skip to main content

Python implementation of the SuperExactTest algorithm

Project description

superexacttestpy

Tests Documentation

Python implementation of the SuperExactTest algorithm

Getting started

Please refer to the documentation. In particular, the

What is superexacttestpy ?

Superextractestpy is a python reimplementation of the R package SuperExactTest allowing to perform tests on the statistical distribution as well as to visualize multiset intersection.

This algorithm calculates the intersection probability of a large number of genes in a genetic set with linear complexity.

How to use it?

Import the package

import superexacttestpy as stest

For example, we want to make the test on this fictive set:

Set1 = [
    "A",
    "B",
    "C",
    "D",
    "E",
    "F",
    "G",
    "H",
    "I",
    "J",
    "K",
    "L",
    "M",
    "N",
    "O",
    "P",
    "Q",
]
Set2 = ["L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"]
Set3 = ["H", "I", "J", "K", "L", "M", "N", "O", "P", "Q"]

data = [Set1, Set2, Set3]
names = ["Set1", "Set2", "Set3"]

background_size = 1000

If you just want the df with the results, you can use the function stest.tl.supertest()

stest.tl.supertest(data=data, n=background_size, names=names)

The function supertest has some optional arguments:

  • degree: the degree of the intersection you want to compute.
  • lower_tail: Let m be the number of elements shared in the sets : if True, p = P[overlap < m] and if False, p = P[overlap >= m].

If you want to get the df and plot the results, you can use the function stest.pl.plot()

stest.pl.plot(data=data, n=background_size, names=names)

The function plot has some optional arguments:

  • degree: the degree of the intersection you want to compute.
  • sort_by: on what you want to sort the bars "degree" or "p_val"
  • show_count: if True, the number of genes in the intersection is shown.
  • color_p_val: if True, the bars are colored by their p-value.
  • size: tuple of the figsize
  • background_color: the color of the background of the plot.

Side function

Some sides functions are available and will be described in the readthedocs

Installation

You need to have Python 3.8 or newer installed on your system. If you don't have Python installed, we recommend installing Miniconda <https://docs.conda.io/en/latest/miniconda.html>_.

There are several alternative options to install superexacttestpy:

  1. Install the latest development version:
pip install git+https://github.com/ilibarra/superexacttestpy.git@main

Release notes

See the changelog.

Contact

For questions and help requests, you can reach out in the scverse discourse. If you found a bug, please use the issue tracker.

Citation

for cite superexactestpy, please use the following:

@software{superexacttest,
  author = {Ibarra, Mauger-Birocheau}},
  doi = {},
  month = {},
  title = {{superexacttest}},
  url = {https://github.com/theislab/superexacttestpy},
  year = {2022}
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

superexacttestpy-0.0.1.tar.gz (14.4 kB view details)

Uploaded Source

Built Distribution

superexacttestpy-0.0.1-py3-none-any.whl (13.8 kB view details)

Uploaded Python 3

File details

Details for the file superexacttestpy-0.0.1.tar.gz.

File metadata

  • Download URL: superexacttestpy-0.0.1.tar.gz
  • Upload date:
  • Size: 14.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.4

File hashes

Hashes for superexacttestpy-0.0.1.tar.gz
Algorithm Hash digest
SHA256 3ec53458c6f9ee60e17948e70390414a9cbb09f79b2b1ef5bf4105bfd4547325
MD5 4b9205a83f25a7dfd854b7df2288c82e
BLAKE2b-256 2ad18439f3c0a02a702e9914a698d8b55573afa5ea8c36f9b3a5660f5fc69b5e

See more details on using hashes here.

File details

Details for the file superexacttestpy-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for superexacttestpy-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b70f24fee6d54bba6ae5014031756916b97949ce16f046857f098b40dd0d512e
MD5 0da45c101b065d725b12d7955e769633
BLAKE2b-256 ee0bb745983b87d103eaeb273f8e21e0fe2b085405d1596491a9499305296ecc

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page