Skip to main content

pyEnGNet: optimized reconstruction of gene co-expression networks using multi-GPU

Project description

pyEnGNet: optimized reconstruction of gene co-expression networks using multi-GPU

Deployment & Documentation & Stats

PyPI version Documentation Status GitHub stars GitHub forks License

Abstract here

pyengnet is featured for:

  • Unified APIs, detailed documentation, and interactive examples available to the community.

  • Complete coverage for reconstruction of massive gene co-expression networks.

  • Optimized models to generate results in the shortest possible time.

  • Optimization of a High-Performance Computing (HPC) and Big Data ecosystem, using cuda and multiprocess.

API Demo:

import os
from pyengnet.File import File
from pyengnet.Engnet import Engnet

if __name__ == "__main__":

   # Load dataset
   dataset = File.load(path=os.getcwd()+"/datasets/Spellman.csv", separator=",", nmi_th=0.6, spearman_th=0.7, kendall_th=0.7, readded_th=0.7, hub_th = 3)

   # Run pyEnGNet on CPUs
   graphFiltered, infoGraphFiltered, graphComplete, infoGraphComplete = Engnet.process(dataset, saveComplete = True)

   # Run pyEnGNet on GPU devices
   # graphFiltered, infoGraphFiltered, graphComplete, infoGraphComplete = Engnet.process(dataset, saveComplete = True, numGpus = 2, computeCapability = 61)

   # Save gene co-expression networks and additional information
   File.saveFile(path='/home/principalpc/Escritorio/graphComplete.csv',graph=infoGraphComplete) # Full network
   File.saveFile(path='/home/principalpc/Escritorio/graphFiltered.csv',graph=infoGraphFiltered) # Filtered network

   # Print gene co-expression networks
   File.showGraph(graph=graphComplete,title='Complete graph') # Full network
   File.showGraph(graph=graphFiltered,title="Filtered graph") # Filtered network

Citing pyEnGNet:

pyEnGNet paper is published in (under review). If you use pyEnGNet in a scientific publication, we would appreciate citations to the following paper:

Under review

or:

Under review

Key Links and Resources:


Installation

It is recommended to use pip for installation. Please make sure the latest version is installed, as pyengnet is updated frequently:

pip install pyengnet            # normal install
pip install --upgrade pyengnet  # or update if needed
pip install --pre pyengnet      # or include pre-release version for new features

Alternatively, you could clone and run setup.py file:

git clone https://github.com/aureliolfdez/pyEnGNet.git
pip install .

Required Dependencies:

  • Python>=3.10

  • numpy>=1.24.0

  • tqdm>=4.64.0

  • multiprocess>=0.70.14

  • pandas>=1.5.3

  • matplotlib>=3.6.3

  • networkx>=3.0

  • scipy>=1.10.0

API Reference

I/O Management

  • pyengnet.File: Class used to manage file I/O operations and data visualization.

  • pyengnet.File.load(): Load dataset from a txt or csv file.

  • pyengnet.File.saveFile(): Save network to file (can be used to store full and/or pruned networks)

  • pyengnet.File.showGraph(): Display a specific network


Ensemble

  • pyengnet.Engnet: Class in charge of controlling the execution of the EnGNet algorithm.

  • pyengnet.Engnet.process(): Function that runs the EngNet algorithm. Depending on the parameters of this function, the algorithm will be executed in parallel with CPU processors or GPU devices.

  • pyengnet.Kendall: Kendall measurement is coded in a parallel ecosystem with CPUs.

  • pyengnet.NMI: NMI measurement is coded in a parallel ecosystem with CPUs.

  • pyengnet.Spearman: Spearman measurement is coded in a parallel ecosystem with CPUs.

  • pyengnet.src.correlations: Execution of Kendall, NMI, and Spearman measures under a parallel multi-GPU ecosystem (CUDA). In addition, it detects those pairs of genes that exceed the threshold for major voting.

Examples by Tasks

All implemented modes are associated with examples, check “pyEnGNet examples” for more information.


Run on CPU

“tests/test_integration/test_cpu.py” demonstrates the basic API for the generation of co-expression gene networks using CPUs.

  1. Load gene co-expression dataset from input file

    from pyengnet.File import File
    
    dataset = File.load(path=os.getcwd()+"/datasets/Spellman.csv", separator=",", nmi_th=0.6, spearman_th=0.7, kendall_th=0.7, readded_th=0.7, hub_th = 3)
  2. Run pyEnGNet based on CPUs.

    from pyengnet.Engnet import Engnet
    
    graphFiltered, infoGraphFiltered, graphComplete, infoGraphComplete = Engnet.process(dataset, saveComplete = True)
  3. Save gene co-expression networks output (optional)

    from pyengnet.File import File
    
    File.saveFile(path='/home/user/Desktop/graphComplete.csv',graph=infoGraphComplete)
    File.saveFile(path='/home/user/Desktop/graphFiltered.csv',graph=infoGraphFiltered)
  4. Print gene co-expression networks output (optional)

    from pyengnet.File import File
    
    File.showGraph(graph=graphComplete,title='Complete graph')
    File.showGraph(graph=graphFiltered,title="Filtered graph")

Run on GPU devices

“tests/test_integration/test_gpu.py” demonstrates the basic API for the generation of co-expression gene networks using GPU devices.

  1. Load gene co-expression dataset from input file

    from pyengnet.File import File
    
    dataset = File.load(path=os.getcwd()+"/datasets/Spellman.csv", separator=",", nmi_th=0.6, spearman_th=0.7, kendall_th=0.7, readded_th=0.7, hub_th = 3)
  2. Run pyEnGNet based on CPUs.

    from pyengnet.Engnet import Engnet
    
    graphFiltered, infoGraphFiltered, graphComplete, infoGraphComplete = Engnet.process(dataset, saveComplete = True, numGpus = 2, computeCapability = 61)
  3. Save gene co-expression networks output (optional)

    from pyengnet.File import File
    
    File.saveFile(path='/home/user/Desktop/graphComplete.csv',graph=infoGraphComplete)
    File.saveFile(path='/home/user/Desktop/graphFiltered.csv',graph=infoGraphFiltered)
  4. Print gene co-expression networks output (optional)

    from pyengnet.File import File
    
    File.showGraph(graph=graphComplete,title='Complete graph')
    File.showGraph(graph=graphFiltered,title="Filtered graph")

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

pyengnet-0.0.2.tar.gz (24.5 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pyengnet-0.0.2-py3.9.egg (25.9 kB view details)

Uploaded Egg

pyengnet-0.0.2-py3-none-any.whl (25.1 kB view details)

Uploaded Python 3

File details

Details for the file pyengnet-0.0.2.tar.gz.

File metadata

  • Download URL: pyengnet-0.0.2.tar.gz
  • Upload date:
  • Size: 24.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for pyengnet-0.0.2.tar.gz
Algorithm Hash digest
SHA256 9bc5a4f594b5ca9a8dd7cd87c51fd8cda52d1b1f81505c64af430389884055e8
MD5 5e97409453f860388a34ec270148fca0
BLAKE2b-256 0ee1209dd0d79104aa61ace2df35a8c37ba89e385405a46550d2f29ed9008483

See more details on using hashes here.

File details

Details for the file pyengnet-0.0.2-py3.9.egg.

File metadata

  • Download URL: pyengnet-0.0.2-py3.9.egg
  • Upload date:
  • Size: 25.9 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for pyengnet-0.0.2-py3.9.egg
Algorithm Hash digest
SHA256 2628fc81d7b5fccdf099634edc893b480d69f102772ff3e2901c66309e4641fa
MD5 28452de33568087e80942851846c843d
BLAKE2b-256 53e822e5b4019e5bab4ce592b38f749bca5a582a60183d814efb344c055169e4

See more details on using hashes here.

File details

Details for the file pyengnet-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: pyengnet-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 25.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for pyengnet-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 43f9ec0a77929918454b725adfb3be1150aa3dfcfc3dd5202e6f34296bbb32dd
MD5 3e4a72657ae47b552c1c01b283b7bb5b
BLAKE2b-256 6be5c899bb35bfeaea9a149f3eb5f4d0ab96cef16d6c11eec5fd38028ff31cf5

See more details on using hashes here.

Supported by

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