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")
# Run the analysis
ea.run_analysis(pvalue_cutoff=0.05)
# Obtain results (in the format of a pandas dataframe)
resuklts = ea.results
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:
License
Code released under the GPLv3.
Metadata
Release files for pymean 0.30
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pymean-0.30.tar.gz | 18.3 kB | Without provenance | Details for pymean-0.30.tar.gz |
Release files / pymean-0.30.tar.gz
| Download URL | pymean-0.30.tar.gz |
|---|---|
| Size | 18.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
51fe958ca755bc24c302d01c9437dbc2db5b523092a6c885d83ea48bad517430
|
|
BLAKE2b-256 checksum How to use checksums |
fe7d976c4ab634efa4b1feeccc05136b7b51606961c326ccd96962e82db7966a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Security for pymean 0.30
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.