Skip to main content

Gene ontology enrichment analysis using protein expression.

Project description

gopher

Gene ontology enrichment analysis using protein expression.

Gopher uses a Mann-Whitney U Test to look for enriched gene ontology terms that are present when proteins are ranked by a quantitative value, such as the difference between two conditions or the abundance of the protein.

Installation

Gopher can be pip installed directly from GitHub:

pip install git+https://github.com/TalusBio/gopher.git

Usage

Gopher can be used within Python. Currently, Gopher is pretty slow---we recommend making use of the go_subset argument to limit the number of GO terms considered by Gopher. Here is an example:

# Import packages
import gopher
import matplotlib.pyplot as plt
import seaborn as sns

# Only test a few cellular compartment GO terms:
terms = [
    "nucleus",
    "nuclear chromosome",
    "nucleoplasm",
    "euchromatin",
    "heterochromatin",
    "protein-DNA complex",
    "transcription regulator complex",
    "inner mitochondrial membrane protein complex",
    "mitochondrial nucleoid",
    "cell surface",
    "ER to Golgi transport vesicle membrane",
    "organelle membrane",
    "lysosome",
    "cytoplasm",
]

# Read data from an EncyclopeDIA output:
proteins = gopher.read_encyclopedia("RESULTS-quant.elib.proteins.txt")

# Peform the GO enrichment analysis:
results = gopher.test_enrichment(
    proteins=proteins,
    aspect="cc",
    go_subset=terms,
    progress=True,
)

# Format for plotting:
long_df = results.melt(
    ["GO Accession", "GO Name", "GO Aspect"], 
    var_name="Run", 
    value_name="pvalue",
)
long_df["neglogpval"] = -np.log10(long_df["pvalue"])

# Create a plot:
plt.figure(figsize=(8, 3))
sns.barplot(data=long_df, x="GO Name", y="neglogpval", hue="Run")
plt.ylabel("$-\log_{10}$ p-value")
plt.xticks(rotation=90)
plt.tight_layout()
plt.show()

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

gopher-enrich-0.1.0.tar.gz (163.7 kB view details)

Uploaded Source

Built Distribution

gopher_enrich-0.1.0-py3-none-any.whl (22.7 kB view details)

Uploaded Python 3

File details

Details for the file gopher-enrich-0.1.0.tar.gz.

File metadata

  • Download URL: gopher-enrich-0.1.0.tar.gz
  • Upload date:
  • Size: 163.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for gopher-enrich-0.1.0.tar.gz
Algorithm Hash digest
SHA256 05b47999fa40a817667cdbefc5d14c8651ed6e40bc4c9b489a4c39832e3cd7d9
MD5 792745cb09cbde184ae2fd0ce6672058
BLAKE2b-256 3d9068a422f64dd7ff79aaed055243a64b3c723cbc05d2e0f6b07a32a81ab3ea

See more details on using hashes here.

File details

Details for the file gopher_enrich-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for gopher_enrich-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cc1f0df25c1d1c2791730b7eab3bd8440faacbaf77a18e89a395654b04607182
MD5 baacc1afa10915db7a037f154a0dd4ff
BLAKE2b-256 a97509685d8992bca18b7fe740cad239d30d7c7624a7473c19019190520da097

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