Skip to main content

The pyMEAN package is designed to facilitate semi-automated enrichment analysis for metabolomic experiments.

Project description

pyMEAN: Metabolomic Enrichment ANalysis in Python

The pyMEAN package is designed to facilitate semi-automated enrichment analysis for metabolomic experiments.

Installation

pyMEAN requires Python 3+ and is unfortunately not compatible with Python 2. If you are still using Python 2, a clever workaround is to install Python 3 and use that instead.

The easiest way of installing pyMEAN is using pip:

pip install pymean

Alternatively, you can use git and pip in unison to get the development branch:

pip install https://github.com/KeironO/pyMEAN

Usage

Here's a starting template to get you started:

# Import pyMEAN module into Python.
from pymean import EnrichmentAnalysis

# A compound list of inchikeys.
compound_list = [
    "WDJHALXBUFZDSR-UHFFFAOYSA-N", # acetoacetic acid
    "UCMIRNVEIXFBKS-UHFFFAOYSA-N", # beta-alanine
    "CVSVTCORWBXHQV-UHFFFAOYSA-N", # creatine
    "FFDGPVCHZBVARC-UHFFFAOYSA-N", # dimethylglycine
    "VZCYOOQTPOCHFL-OWOJBTEDSA-N", # fumaric acid
    "DHMQDGOQFOQNFH-UHFFFAOYSA-N", # glycine
    "FFFHZYDWPBMWHY-UHFFFAOYSA-N", # l-homocysteine
    "XUJNEKJLAYXESH-REOHCLBHSA-N", # l-cysteine
    "COLNVLDHVKWLRT-QMMMGPOBSA-N", # l-phenylalanine
    "BTNMPGBKDVTSJY-UHFFFAOYSA-N" # phenylpyruvic acid
]


# Create an EnrichmentAnalysis object for the analysis of hsa
ea = EnrichmentAnalysis(compound_list, organism="hsa")

# Obtain results
results = ea.run_analysis(pvalue_cutoff=0.005)

If you'd like to plot out your results, take inspiration from the following method:

def plot_enrichment_analysis_results(results: pd.DataFrame, adj_method:str):
    fold_enrichment = np.abs(np.log(results["%s adj. p-value" % (adj_method)]))
    plt.figure()
    plt.title("Metabolite Sets Enrichment Overview")
    plt.barh(results["Pathway Name"], fold_enrichment, height=0.5)
    plt.xlabel("Fold Enrichment")

    plt.yticks(fontsize=6)
    plt.tight_layout()

    plt.show()

plot_enrichment_analysis_results(results, "fdr_bh")

Which will return the following chart:

Plot of results

License

Code released under the GPLv3.

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

pymean-0.2.tar.gz (18.1 kB view details)

Uploaded Source

File details

Details for the file pymean-0.2.tar.gz.

File metadata

  • Download URL: pymean-0.2.tar.gz
  • Upload date:
  • Size: 18.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

File hashes

Hashes for pymean-0.2.tar.gz
Algorithm Hash digest
SHA256 c736ded50175de0d9cbe98cfcc311fc734878598e76b4f3768496422e00e7b48
MD5 27739b81d6fd324f4f6daa9baf54ba1d
BLAKE2b-256 916df7bc3742897bb49f93a4101348a531e8c3e0389d22e403a291f9457780f2

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