Skip to main content

A Python package for biological network generation and analysis.

Project description

ppinet - A Python package for biological network generation and analysis

Installing

To build and install from source, run

python setup.py install

You can also install from pip with

pip install ppinet

Overview

ppinet generates a network from a list of genes/proteins. It provides both an easy-to-use object-oriented Python API and a command-line interface (CLI) for generating a biological network and post-analysis.

ppinet features include:

Generates a biological network from STRING database
Calculates network metrics and enrichment
Execute a louvain community detection
Find important genes in network based on shortest-path analysis and betweenness centrality

Command-line interface

ppinet can be executed from the command line using the ppinet command. It takes a gene list file, output folder name and organism taxid (based on STRING) as input and outputs a several analysis of the biological network generated.

usage: ppinet [-h] --input_file INPUT_FILE --organism ORGANISM --output_folder OUTPUT_FOLDER [--genes GENES]

optional arguments:
  -h, --help            show this help message and exit
  --input_file INPUT_FILE
                        File containing a gene list.
  --organism ORGANISM   STRING taxonomy ID. Ex: 9606
  --output_folder OUTPUT_FOLDER
                        Output folder
  --genes GENES         Interesting genes for Shortest-path analysis..

example: python3 ppinet.py --input_file gene_list.txt --output ppinet_output --organism 9606

In the output_folder, ppinet generates the following outputs:

  1. species.txt : a file containg all STRING taxonomy IDs. If you provide a invalid taxid, we advised to inspect this file.
  2. degree_distribution.pdf : a PDF file containing the degree distribution of the biological network
  3. network.png : a snapshot of the biological network
  4. network_bc.png : a snapshot of the biological network based on betweenness centrality
  5. nodes_network2cyto.txt : all nodes and your attributes for Cytoscape analysis
  6. edges_network2cyto.txt : all edges and your attributes for Cytoscape analysis
  7. reports_ppinet.txt : general metrics of the biological network
  8. enrichment.txt : enrichment analysis of the biological network

if the --genes argument is taken as input, three extra files will be generated:

  1. louvain_clustering.png : louvain community detection of the network
  2. enrichment_shortestpath.txt : a file containing the enrichment analysis of all genes present in all shorthest-path from interesting genes
  3. shortestpath_BC.txt : a file containing all interesting genes and its betweenness centrality (bc). As higher the value of bc as more important the gene of interest becomes.

Python library usage

ppinet generates a folder in currently folder with output_folder name.

To use as a Python library

import ppinet

# arguments of ppinet
input_data = '/opt/data/input_genes.txt'
genes = '/opt/data/genes.txt'
output_folder_name = 'ppinet_output'

#generates a conversion
string_genes = ppinet.initial(input_data,output_folder_name,4932)

#generates the network metrics and return the g graph
g = ppinet.network_metrics(string_genes,output_folder_name,4932)

# generates a louvain community plot
ppinet.cl(g,output_folder_name)

# shorthest-path analysis from interesting genes
ppinet.sp(g,output_folder_name,4932,genes)

Examples

A data folder contains a list with 300 genes of S. cerevisiae (input.txt file) and a list with 9 interesting genes (genes.txt file)

  • Example of a biological network from the list of 300 genes
ppinet --input_file data/input.txt --organism 4932 --output_file yeast_output
  • Example of output containing a list of genes of interest
ppinet --input_file data/input.txt --organism 4932 --output_file yeast_output --genes data/genes.txt

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

ppinet-0.1.0.tar.gz (18.2 kB view details)

Uploaded Source

Built Distribution

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

ppinet-0.1.0-py3-none-any.whl (20.3 kB view details)

Uploaded Python 3

File details

Details for the file ppinet-0.1.0.tar.gz.

File metadata

  • Download URL: ppinet-0.1.0.tar.gz
  • Upload date:
  • Size: 18.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.6.0.post20210108 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.7.10

File hashes

Hashes for ppinet-0.1.0.tar.gz
Algorithm Hash digest
SHA256 10b07cfd010886dd7784eaf39ae77e5d45830fc1590294514402e66885983df5
MD5 ba3b2284f38e5ce4f881881ba0ecf366
BLAKE2b-256 fe53a2908069b1b4810ad6799bbe88f0ed709c71ec1c22c8b6c85c3a15353895

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ppinet-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 20.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.6.0.post20210108 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.7.10

File hashes

Hashes for ppinet-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3acc963deef57f4d63f08aa4c208f49ce1d9a5a73670a478aa78a9b8ab5da613
MD5 2f5942b39d249ca47a8ebb980a31131a
BLAKE2b-256 9d9236d388f08c28fab176fceb3491c1a4e3310bfa3ef0db20d26b2f5cd8057a

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