harissa


Nameharissa JSON
Version 3.0.11 PyPI version JSON
download
home_page
SummaryTools for mechanistic gene network inference from single-cell data
upload_time2024-02-09 05:25:49
maintainer
docs_urlNone
author
requires_python>=3.8
licenseBSD 3-Clause License Copyright (c) 2021, Ulysse Herbach All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
keywords stochastic gene expression gene regulatory networks single-cell transcriptomics
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Harissa (legacy version)
========================

.. image:: https://img.shields.io/pypi/v/harissa
   :alt: PyPI - Version
   :target: https://pypi.org/project/harissa/

.. image:: https://img.shields.io/github/actions/workflow/status/harissa-framework/harissa/github-pages.yml?label=documentation
   :alt: GitHub Pages status
   :target: https://harissa-framework.github.io/harissa/

This is a Python package for both simulation and inference of gene 
regulatory networks from single-cell data. Its name comes from 
‘HARtree approximation for Inference along with a Stochastic Simulation Algorithm.’ 
It was implemented in the context of a 
`mechanistic approach <https://doi.org/10.1186/s12918-017-0487-0>`_ 
to gene regulatory network inference from single-cell data, 
based upon an underlying stochastic dynamical model driven by the 
`transcriptional bursting <https://en.wikipedia.org/wiki/Transcriptional_bursting>`_ 
phenomenon.

*Main functionalities:*

1. Network inference interpreted as calibration of a dynamical model;
2. Data simulation (typically scRNA-seq) from the same dynamical model.

*Other available tools:*

* Basic GRN visualization (directed graphs with positive or negative edge weights);
* Binarization of scRNA-seq data (using gene-specific thresholds derived from the calibrated dynamical model).

The current version of Harissa has benefited from improvements introduced 
within `Cardamom <https://github.com/eliasventre/cardamom>`_, 
which can be seen as an alternative method for the inference part. 
The two inference methods remain complementary at this stage 
and may be merged into the same package in the future. 
They were both evaluated in a 
`recent benchmark <https://doi.org/10.1371/journal.pcbi.1010962>`_.

Installation
------------

Harissa can be installed using `pip <https://packaging.python.org/en/latest/tutorials/installing-packages/>`_:

.. code-block:: bash

  pip install harissa

This command will also check for all required dependencies (see below) 
and install them if necessary. 
If the installation is successful, all scripts in the 
`tests <https://github.com/ulysseherbach/harissa/tree/main/tests>`_ 
folder should run smoothly 
(note that :code:`network4.py` must be run before :code:`test_binarize.py`).

Basic usage
-----------

.. code-block:: python

  from harissa import NetworkModel
  model = NetworkModel()

  # Inference
  model.fit(data)

  # Simulation
  sim = model.simulate(time)
    
Here :code:`data` should be a two-dimensional array of single-cell gene expression counts, 
where each row represents a cell and each column represents a gene, 
except for the first column, which contains experimental time points. 
A toy example is:

.. code-block:: python
    
  import numpy as np

  data = np.array([
      #t g1 g2 g3
      [0, 4, 1, 0], # Cell 1
      [0, 5, 0, 1], # Cell 2
      [1, 1, 2, 4], # Cell 3
      [1, 2, 0, 8], # Cell 4
      [1, 0, 0, 3], # Cell 5
  ])

The :code:`time` argument for simulations is either a single time or a list of time points. 
For example, a single-cell trajectory (not available from scRNA-seq) 
from *t* = 0h to *t* = 10h can be simulated using:

.. code-block:: python

  time = np.linspace(0, 10, 1000)

The :code:`sim` output stores mRNA and protein levels as attributes 
:code:`sim.m` and :code:`sim.p`, 
respectively (each row is a time point and each column is a gene).

About the data
--------------

The inference algorithm specifically exploits time-course data,
where single-cell profiling is performed at a number of time points after a stimulus 
(see `this paper <https://doi.org/10.1371/journal.pcbi.1010962>`_ 
for an example with real data).
Each group of cells collected at the same experimental time *t* :sub:`k` 
forms a *snapshot* of the biological heterogeneity at time *t* :sub:`k`. 
Due to the destructive nature of the measurement process, 
successive snapshots are made of different cells. 
Such data is therefore different from so-called ‘pseudotime’ trajectories, 
which attempt to reorder cells according to some smoothness hypotheses.

Tutorial
--------

Please see the `notebooks <https://github.com/ulysseherbach/harissa/tree/main/notebooks>`_ 
for introductory examples, or the 
`tests <https://github.com/ulysseherbach/harissa/tree/main/tests>`_ folder for basic usage scripts. 
To get an idea of the main features, you can start by running the notebooks in order:

- `Notebook 1 <https://github.com/ulysseherbach/harissa/blob/main/notebooks/notebook1.ipynb>`_: 
  simulate a basic repressilator network with 3 genes;
- `Notebook 2 <https://github.com/ulysseherbach/harissa/blob/main/notebooks/notebook2.ipynb>`_: 
  perform network inference from a small dataset with 4 genes;
- `Notebook 3 <https://github.com/ulysseherbach/harissa/blob/main/notebooks/notebook3.ipynb>`_: 
  compare two branching pathways with 4 genes from both ‘single-cell’ and ‘bulk’ viewpoints.

Dependencies
------------

The package depends on standard scientific libraries 
:code:`numpy` and :code:`scipy`. 
Optionally, it can load :code:`numba` 
for accelerating the inference procedure (used by default) 
and the simulation procedure (not used by default). 
It also depends optionally on :code:`matplotlib` 
and :code:`networkx` for network visualization.

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "harissa",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "stochastic gene expression,gene regulatory networks,single-cell transcriptomics",
    "author": "",
    "author_email": "Ulysse Herbach <ulysse.herbach@inria.fr>",
    "download_url": "https://files.pythonhosted.org/packages/0d/e9/8dc7aaa17ecef2a3c0ab7e9cdd83b0c0f63bc531f4089510eaf9d8022fee/harissa-3.0.11.tar.gz",
    "platform": "any",
    "description": "Harissa (legacy version)\n========================\n\n.. image:: https://img.shields.io/pypi/v/harissa\n   :alt: PyPI - Version\n   :target: https://pypi.org/project/harissa/\n\n.. image:: https://img.shields.io/github/actions/workflow/status/harissa-framework/harissa/github-pages.yml?label=documentation\n   :alt: GitHub Pages status\n   :target: https://harissa-framework.github.io/harissa/\n\nThis is a Python package for both simulation and inference of gene \nregulatory networks from single-cell data. Its name comes from \n\u2018HARtree approximation for Inference along with a Stochastic Simulation Algorithm.\u2019 \nIt was implemented in the context of a \n`mechanistic approach <https://doi.org/10.1186/s12918-017-0487-0>`_ \nto gene regulatory network inference from single-cell data, \nbased upon an underlying stochastic dynamical model driven by the \n`transcriptional bursting <https://en.wikipedia.org/wiki/Transcriptional_bursting>`_ \nphenomenon.\n\n*Main functionalities:*\n\n1. Network inference interpreted as calibration of a dynamical model;\n2. Data simulation (typically scRNA-seq) from the same dynamical model.\n\n*Other available tools:*\n\n* Basic GRN visualization (directed graphs with positive or negative edge weights);\n* Binarization of scRNA-seq data (using gene-specific thresholds derived from the calibrated dynamical model).\n\nThe current version of Harissa has benefited from improvements introduced \nwithin `Cardamom <https://github.com/eliasventre/cardamom>`_, \nwhich can be seen as an alternative method for the inference part. \nThe two inference methods remain complementary at this stage \nand may be merged into the same package in the future. \nThey were both evaluated in a \n`recent benchmark <https://doi.org/10.1371/journal.pcbi.1010962>`_.\n\nInstallation\n------------\n\nHarissa can be installed using `pip <https://packaging.python.org/en/latest/tutorials/installing-packages/>`_:\n\n.. code-block:: bash\n\n  pip install harissa\n\nThis command will also check for all required dependencies (see below) \nand install them if necessary. \nIf the installation is successful, all scripts in the \n`tests <https://github.com/ulysseherbach/harissa/tree/main/tests>`_ \nfolder should run smoothly \n(note that :code:`network4.py` must be run before :code:`test_binarize.py`).\n\nBasic usage\n-----------\n\n.. code-block:: python\n\n  from harissa import NetworkModel\n  model = NetworkModel()\n\n  # Inference\n  model.fit(data)\n\n  # Simulation\n  sim = model.simulate(time)\n    \nHere :code:`data` should be a two-dimensional array of single-cell gene expression counts, \nwhere each row represents a cell and each column represents a gene, \nexcept for the first column, which contains experimental time points. \nA toy example is:\n\n.. code-block:: python\n    \n  import numpy as np\n\n  data = np.array([\n      #t g1 g2 g3\n      [0, 4, 1, 0], # Cell 1\n      [0, 5, 0, 1], # Cell 2\n      [1, 1, 2, 4], # Cell 3\n      [1, 2, 0, 8], # Cell 4\n      [1, 0, 0, 3], # Cell 5\n  ])\n\nThe :code:`time` argument for simulations is either a single time or a list of time points. \nFor example, a single-cell trajectory (not available from scRNA-seq) \nfrom *t* = 0h to *t* = 10h can be simulated using:\n\n.. code-block:: python\n\n  time = np.linspace(0, 10, 1000)\n\nThe :code:`sim` output stores mRNA and protein levels as attributes \n:code:`sim.m` and :code:`sim.p`, \nrespectively (each row is a time point and each column is a gene).\n\nAbout the data\n--------------\n\nThe inference algorithm specifically exploits time-course data,\nwhere single-cell profiling is performed at a number of time points after a stimulus \n(see `this paper <https://doi.org/10.1371/journal.pcbi.1010962>`_ \nfor an example with real data).\nEach group of cells collected at the same experimental time *t* :sub:`k` \nforms a *snapshot* of the biological heterogeneity at time *t* :sub:`k`. \nDue to the destructive nature of the measurement process, \nsuccessive snapshots are made of different cells. \nSuch data is therefore different from so-called \u2018pseudotime\u2019 trajectories, \nwhich attempt to reorder cells according to some smoothness hypotheses.\n\nTutorial\n--------\n\nPlease see the `notebooks <https://github.com/ulysseherbach/harissa/tree/main/notebooks>`_ \nfor introductory examples, or the \n`tests <https://github.com/ulysseherbach/harissa/tree/main/tests>`_ folder for basic usage scripts. \nTo get an idea of the main features, you can start by running the notebooks in order:\n\n- `Notebook 1 <https://github.com/ulysseherbach/harissa/blob/main/notebooks/notebook1.ipynb>`_: \n  simulate a basic repressilator network with 3 genes;\n- `Notebook 2 <https://github.com/ulysseherbach/harissa/blob/main/notebooks/notebook2.ipynb>`_: \n  perform network inference from a small dataset with 4 genes;\n- `Notebook 3 <https://github.com/ulysseherbach/harissa/blob/main/notebooks/notebook3.ipynb>`_: \n  compare two branching pathways with 4 genes from both \u2018single-cell\u2019 and \u2018bulk\u2019 viewpoints.\n\nDependencies\n------------\n\nThe package depends on standard scientific libraries \n:code:`numpy` and :code:`scipy`. \nOptionally, it can load :code:`numba` \nfor accelerating the inference procedure (used by default) \nand the simulation procedure (not used by default). \nIt also depends optionally on :code:`matplotlib` \nand :code:`networkx` for network visualization.\n",
    "bugtrack_url": null,
    "license": "BSD 3-Clause License  Copyright (c) 2021, Ulysse Herbach All rights reserved.  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.  3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ",
    "summary": "Tools for mechanistic gene network inference from single-cell data",
    "version": "3.0.11",
    "project_urls": {
        "Documentation": "https://harissa-framework.github.io/harissa",
        "Legacy Repository": "https://github.com/ulysseherbach/harissa",
        "Repository": "https://github.com/harissa-framework/harissa"
    },
    "split_keywords": [
        "stochastic gene expression",
        "gene regulatory networks",
        "single-cell transcriptomics"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "beee26ad2f0ecbe86cbc27dcbb4ee507fba3e49c10594a4699c95594d9afd7a6",
                "md5": "5d0194ab1756575712373c72b84a377b",
                "sha256": "7197f6b44b868d59322a3c18f7048ceb4725a5bb8dc275549a8f4d90a4b98489"
            },
            "downloads": -1,
            "filename": "harissa-3.0.11-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "5d0194ab1756575712373c72b84a377b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 24935,
            "upload_time": "2024-02-09T05:25:47",
            "upload_time_iso_8601": "2024-02-09T05:25:47.671568Z",
            "url": "https://files.pythonhosted.org/packages/be/ee/26ad2f0ecbe86cbc27dcbb4ee507fba3e49c10594a4699c95594d9afd7a6/harissa-3.0.11-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0de98dc7aaa17ecef2a3c0ab7e9cdd83b0c0f63bc531f4089510eaf9d8022fee",
                "md5": "06fe545d564631f768e540b80ddad210",
                "sha256": "174734fdac505f5e486fb7105426d4852d64ccddea6c6ef24edf806e554fd31c"
            },
            "downloads": -1,
            "filename": "harissa-3.0.11.tar.gz",
            "has_sig": false,
            "md5_digest": "06fe545d564631f768e540b80ddad210",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 311326,
            "upload_time": "2024-02-09T05:25:49",
            "upload_time_iso_8601": "2024-02-09T05:25:49.928792Z",
            "url": "https://files.pythonhosted.org/packages/0d/e9/8dc7aaa17ecef2a3c0ab7e9cdd83b0c0f63bc531f4089510eaf9d8022fee/harissa-3.0.11.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-09 05:25:49",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ulysseherbach",
    "github_project": "harissa",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "harissa"
}
        
Elapsed time: 0.17239s