interva


Nameinterva JSON
Version 1.0.0 PyPI version JSON
download
home_pageNone
SummaryPython implementation of the InterVA Algorithm.
upload_time2024-04-17 17:28:46
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseGPLv3
keywords verbal autopsy
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # interva

[![image](https://img.shields.io/pypi/pyversions/interva)](https://pypi.org/project/interva/)
[![pytest](https://github.com/verbal-autopsy-software/interva/actions/workflows/python-package.yml/badge.svg)](https://github.com/verbal-autopsy-software/interva/actions)

Python implementation of the InterVA (version 5) algorithm for assigning causes of death to verbal autopsy data.  This package replicates the R
version [InterVA5](https://github.com/verbal-autopsy-software/InterVA5).


## Importing package and installing dependencies

To install all package dependencies, run:  

```python
pip install interva
```

To import this package's functions:  

```python
from interva.interva5 import InterVA5
```
## Example data

To access example data from the package:  

```python
from interva.interva5 import get_example_input
va_data = get_example_input()
```

```python
va_data
       ID i004a i004b i019a i019b i022a  ... i454o i455o i456o i457o i458o i459o
0      d1     .     .     y     .     y  ...     n     n     n     n     n     n
1      d2     .     .     .     y     y  ...     n     n     n     n     n     n
2      d3     .     .     y     .     .  ...     n     n     n     n     n     n
3      d4     .     .     .     y     .  ...     n     n     n     n     n     n
4      d5     .     .     y     .     .  ...     n     n     n     n     n     n
..    ...   ...   ...   ...   ...   ...  ...   ...   ...   ...   ...   ...   ...
195  d196     .     .     .     y     .  ...     n     n     n     n     n     n
196  d197     .     .     y     .     y  ...     n     n     n     n     n     n
197  d198     .     .     y     .     y  ...     n     n     n     n     n     n
198  d199     .     .     .     y     y  ...     n     n     n     n     n     n
199  d200     .     .     .     y     y  ...     n     n     n     n     n     n

[200 rows x 354 columns]
```
  
## Creating and running an InterVA5 object

To initialize an InterVA5 object (results will be written to `VA_outpt/VA5_results.csv`):

```python
iv5out = InterVA5(va_data, hiv="h", malaria="l", write=True, directory="VA_output", filename="VA5_result", output="extended", append=False, return_checked_data=True)
```
  
To run the InterVA5 algorithm on the InterVA5 object:  

```python
iv5out.run()
```

```python
Using Probbase version: probbase v19 20210720
..........10% completed
..........20% completed
..........30% completed
..........40% completed
..........50% completed
..........60% completed
..........70% completed
..........80% completed
..........90% completed
..........100% completed
100% completed
```

Get cause-specific mortality fractions (CSMFs) for the top 8 causes:

```python
iv5out.get_csmf(top=8)
```

```python
HIV/AIDS related death               0.194408
Undetermined                         0.136583
Digestive neoplasms                  0.083285
Other and unspecified infect dis     0.063096
Renal failure                        0.061253
Reproductive neoplasms MF            0.053655
Other and unspecified cardiac dis    0.047557
Stroke                               0.045583
dtype: float64
```

getters for InterVA5 parameters:  

```python
iv5out.get_hiv()
iv5out.get_malaria()
iv5out.get_ids()
```

```python
HIV parameter is h
Malaria parameter is l
ids
0        d1
1        d2
2        d3
3        d4
4        d5
       ...
195    d196
196    d197
197    d198
198    d199
199    d200
Name: ID, Length: 200, dtype: object
```

To change the parameters, use setters and re-run.   

```python
iv5out.set_hiv("v")
iv5out.set_malaria("v")
iv5out.run()
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "interva",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "openVA Team <help@openva.net>",
    "keywords": "verbal autopsy",
    "author": null,
    "author_email": "Sherry Zhao <zhao.3248@buckeyemail.osu.edu>, Jason Thomas <jarathomas@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/52/2c/f27e85683e5076db0b4f6f2e64409bbcb6a8b0165ab717c3765c3ff5d281/interva-1.0.0.tar.gz",
    "platform": null,
    "description": "# interva\n\n[![image](https://img.shields.io/pypi/pyversions/interva)](https://pypi.org/project/interva/)\n[![pytest](https://github.com/verbal-autopsy-software/interva/actions/workflows/python-package.yml/badge.svg)](https://github.com/verbal-autopsy-software/interva/actions)\n\nPython implementation of the InterVA (version 5) algorithm for assigning causes of death to verbal autopsy data.  This package replicates the R\nversion [InterVA5](https://github.com/verbal-autopsy-software/InterVA5).\n\n\n## Importing package and installing dependencies\n\nTo install all package dependencies, run:  \n\n```python\npip install interva\n```\n\nTo import this package's functions:  \n\n```python\nfrom interva.interva5 import InterVA5\n```\n## Example data\n\nTo access example data from the package:  \n\n```python\nfrom interva.interva5 import get_example_input\nva_data = get_example_input()\n```\n\n```python\nva_data\n       ID i004a i004b i019a i019b i022a  ... i454o i455o i456o i457o i458o i459o\n0      d1     .     .     y     .     y  ...     n     n     n     n     n     n\n1      d2     .     .     .     y     y  ...     n     n     n     n     n     n\n2      d3     .     .     y     .     .  ...     n     n     n     n     n     n\n3      d4     .     .     .     y     .  ...     n     n     n     n     n     n\n4      d5     .     .     y     .     .  ...     n     n     n     n     n     n\n..    ...   ...   ...   ...   ...   ...  ...   ...   ...   ...   ...   ...   ...\n195  d196     .     .     .     y     .  ...     n     n     n     n     n     n\n196  d197     .     .     y     .     y  ...     n     n     n     n     n     n\n197  d198     .     .     y     .     y  ...     n     n     n     n     n     n\n198  d199     .     .     .     y     y  ...     n     n     n     n     n     n\n199  d200     .     .     .     y     y  ...     n     n     n     n     n     n\n\n[200 rows x 354 columns]\n```\n  \n## Creating and running an InterVA5 object\n\nTo initialize an InterVA5 object (results will be written to `VA_outpt/VA5_results.csv`):\n\n```python\niv5out = InterVA5(va_data, hiv=\"h\", malaria=\"l\", write=True, directory=\"VA_output\", filename=\"VA5_result\", output=\"extended\", append=False, return_checked_data=True)\n```\n  \nTo run the InterVA5 algorithm on the InterVA5 object:  \n\n```python\niv5out.run()\n```\n\n```python\nUsing Probbase version: probbase v19 20210720\n..........10% completed\n..........20% completed\n..........30% completed\n..........40% completed\n..........50% completed\n..........60% completed\n..........70% completed\n..........80% completed\n..........90% completed\n..........100% completed\n100% completed\n```\n\nGet cause-specific mortality fractions (CSMFs) for the top 8 causes:\n\n```python\niv5out.get_csmf(top=8)\n```\n\n```python\nHIV/AIDS related death               0.194408\nUndetermined                         0.136583\nDigestive neoplasms                  0.083285\nOther and unspecified infect dis     0.063096\nRenal failure                        0.061253\nReproductive neoplasms MF            0.053655\nOther and unspecified cardiac dis    0.047557\nStroke                               0.045583\ndtype: float64\n```\n\ngetters for InterVA5 parameters:  \n\n```python\niv5out.get_hiv()\niv5out.get_malaria()\niv5out.get_ids()\n```\n\n```python\nHIV parameter is h\nMalaria parameter is l\nids\n0        d1\n1        d2\n2        d3\n3        d4\n4        d5\n       ...\n195    d196\n196    d197\n197    d198\n198    d199\n199    d200\nName: ID, Length: 200, dtype: object\n```\n\nTo change the parameters, use setters and re-run.   \n\n```python\niv5out.set_hiv(\"v\")\niv5out.set_malaria(\"v\")\niv5out.run()\n```\n",
    "bugtrack_url": null,
    "license": "GPLv3",
    "summary": "Python implementation of the InterVA Algorithm.",
    "version": "1.0.0",
    "project_urls": {
        "Bug Tracker": "https://github.com/verbal-autopsy-software/interva/issues",
        "Homepage": "https://github.com/verbal-autopsy-software/interva"
    },
    "split_keywords": [
        "verbal",
        "autopsy"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "91b4f6d43d3e09ca106f2b3137805847bd6f5808d78d72ee4047511490d2c50a",
                "md5": "5f0ed9f082a358480367b38bfc27e543",
                "sha256": "47008e6c0225f60f387e788097f0fe8f28ff4b4669d6cf7874f30b30536cbef9"
            },
            "downloads": -1,
            "filename": "interva-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "5f0ed9f082a358480367b38bfc27e543",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 182990,
            "upload_time": "2024-04-17T17:28:44",
            "upload_time_iso_8601": "2024-04-17T17:28:44.266234Z",
            "url": "https://files.pythonhosted.org/packages/91/b4/f6d43d3e09ca106f2b3137805847bd6f5808d78d72ee4047511490d2c50a/interva-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "522cf27e85683e5076db0b4f6f2e64409bbcb6a8b0165ab717c3765c3ff5d281",
                "md5": "5059b959498f3792cf2421f9e3f05f89",
                "sha256": "365f4df958ce61a52b2146a5c8b2a874ac2d7972caa6b08e2311ebcff3378494"
            },
            "downloads": -1,
            "filename": "interva-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "5059b959498f3792cf2421f9e3f05f89",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 178683,
            "upload_time": "2024-04-17T17:28:46",
            "upload_time_iso_8601": "2024-04-17T17:28:46.156187Z",
            "url": "https://files.pythonhosted.org/packages/52/2c/f27e85683e5076db0b4f6f2e64409bbcb6a8b0165ab717c3765c3ff5d281/interva-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-17 17:28:46",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "verbal-autopsy-software",
    "github_project": "interva",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "interva"
}
        
Elapsed time: 0.28912s