Skip to main content

PORTIA: Fast and Accurate Inference of Gene Regulatory Networks through Robust Precision Matrix Estimation

Project description

Build status Code analysis

PORTIA

Lightning-fast Gene Regulatory Network (GRN) inference tool.

PORTIA builds on power transforms and covariance matrix inversion to approximate GRNs, and is orders of magnitude faster than other existing tools (as of August 2021).


How to use it

Install the dependencies:

pip3 -r requirements.txt

For using the end-to-end inference algorithm, install dependencies from requirements-etel.txt instead.

Install the package:

python3 setup.py install

In Python, create an empty dataset:

import portia as pt

dataset = pt.GeneExpressionDataset()

Microarray experiments can be added with the GeneExpressionDataset.add method. data must be an iterable (list, NumPy array, etc).

for exp_id, data in enumerate(your_data):
    dataset.add(pt.Experiment(exp_id, data))

Gene knock-out experiments can be encoded using the knockout optional parameter.

dataset.add(pt.Experiment(exp_id, data, knockout=[gene_idx]))

where gene_idx is the (0-based) index of the gene being knocked out. Dual/multiple knock-out experiments are supported, but won't help in the inference process in any way.

Run PORTIA on your dataset:

M_bar = pt.run(dataset, method='fast')

The output M_bar is a matrix, where each element M_bar[i, j] is a score in the range [0, 1] reflecting the confidence about gene i being a regulator for target gene j. A whitelist of putative transcription factors can be specified with the tf_idx argument. tf_idx must be a (0-based) list of gene indices.

M_bar = pt.run(dataset, tf_idx=tf_idx, method='fast')

Finally, rank and store the results in a text file. gene_names is the list of your genes, provided in the correct order.

with open('your_destination/results.txt', 'w') as f:
    for gene_a, gene_b, score in pt.rank_scores(M_bar, gene_names, limit=10000):
        f.write(f'{gene_a}\t{gene_b}\t{score}\n')

Real examples on the DREAM datasets are provided in the scripts/ folder.

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

portia-grn-0.0.2.tar.gz (10.5 kB view details)

Uploaded Source

Built Distributions

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

portia_grn-0.0.2-py3.8.egg (22.6 kB view details)

Uploaded Egg

portia_grn-0.0.2-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

Details for the file portia-grn-0.0.2.tar.gz.

File metadata

  • Download URL: portia-grn-0.0.2.tar.gz
  • Upload date:
  • Size: 10.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/3.10.0 pkginfo/1.8.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.8

File hashes

Hashes for portia-grn-0.0.2.tar.gz
Algorithm Hash digest
SHA256 851e8f0ae3f87c87711c92c72bd022c77f9b6727a34eed4c94e7d431734992e0
MD5 60b2d6240705d9d7797864d93d0d3d18
BLAKE2b-256 526a347d1217a6707ae3a185607e5649023e717bad39721a70188fd2d1a96410

See more details on using hashes here.

File details

Details for the file portia_grn-0.0.2-py3.8.egg.

File metadata

  • Download URL: portia_grn-0.0.2-py3.8.egg
  • Upload date:
  • Size: 22.6 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/3.10.0 pkginfo/1.8.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.8

File hashes

Hashes for portia_grn-0.0.2-py3.8.egg
Algorithm Hash digest
SHA256 c86f50bf97f2c3160f24d9c788a33d445dc708c9aebf2d504f62eba8ffa1f62f
MD5 64a4786c36a968494715a133531bb941
BLAKE2b-256 1d606b0d60eb7e980dfeccb9f15d33ec32962181c602b666f6a594ea99b0298d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: portia_grn-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 11.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/3.10.0 pkginfo/1.8.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.8

File hashes

Hashes for portia_grn-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 51e48bce1d944667a2b13db4c8265f3673bfac596f0c88be01272c16e5970507
MD5 90a11050c88ffeb3567aadf1414cea9f
BLAKE2b-256 d603f2475df9c6ea6b73410ab536f65f5439dece77434d1cda09b228c4df8804

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