isv


Nameisv JSON
Version 0.3.16 PyPI version JSON
download
home_pagehttps://github.com/tsladecek/isv_package
SummaryAutomated Interpretation of Structural Copy Number Variants
upload_time2023-01-09 11:09:57
maintainerTomas Sladecek
docs_urlNone
authorTomas Sladecek
requires_python>=3.6, <4
license
keywords python machine learning copy number variation
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # ISV package

Python **pip** package for easy prediction of pathogenicity Copy Number Variants (CNVs)

---
## If you mention or use the ISV tool, please cite our article
https://www.nature.com/articles/s41598-021-04505-z

---
## Install
#### Install with `pip install isv`
This will also automatically install all required additional packages. Thus it is recommended to install the package in a separate environment (e.g. virtualenv, conda, ...)

#### Package url: https://pypi.org/project/isv/

#### Module reference available at https://tsladecek.github.io/isv_package/

---
## Modules
##### The package contains a wrapper function:
### `isv.isv(cnvs, proba, shap)`
which automatically annotates and predicts `cnvs` provided in a list, np.array or pandas DataFrame format represented in 4 columns: `chromosome`, `start (grch38)`, `end (grch38)` and `cnv_type`

- The `proba` parameter controls whether probabilities should be calculated
- The `shap` parameter controls whether shap values should be calculated

#### and a Wrapper class (which is recommended):
### `isv.ISV(cnvs)`

with methods:
- ISV.predict(proba)
- ISV.shap(data=None)
  - where the `data` argument is optional
- ISV.waterfall(cnv_index)
  - for creating an interactive waterfall plot for a CNV at index `cnv_index`

---
#### The main subfunctions of the package are:

### 1. `isv.annotate(cnvs)`
- annotates cnvs provided in a list, np.array or pandas DataFrame format represented in 4 columns: `chromosome`, `start (grch38)`, `end (grch38)` and `cnv_type`
- Returns an annotated dataframe which can be used as an input to following two functions

### 2. `isv.predict(annotated_cnvs, proba)`
- returns an array of isv predictions. `annotated_cnvs` represents annotated cnvs returned by the annotate function

### 3. `isv.shap_values(annotated_cnvs)`
- calculates shap values for given CNVs. `annotated_cnvs` represents annotated cnvs returned by the annotate function

#### For example
1. using the simple wrapper
```
from isv import isv


cnvs = [
    ["chr8", 100000, 500000, "DEL"],
    ["chrX", 52000000, 55000000, "DUP"]
] 

results = isv(cnvs, proba=True, shap=True)
```

2. using the ISV class
```
from isv import ISV


cnvs = [
    ["chr8", 100000, 500000, "DEL"],
    ["chrX", 52000000, 55000000, "DUP"]
] 

cnv_isv = ISV(cnvs)
predictions = cnv_isv.predict(proba=True)
shap_vals = cnv_isv.shap()
cnv_isv.waterfall(cnv_index=1)
```

---
## Can be also used as a command line tool. Make sure to:

#### 1. clone the repository (https://github.com/tsladecek/isv_package)
#### 2. install requirements, e.g.

```
virtualenv venv
source venv/bin/activate
pip install -r requirements.txt
```

#### 3. Use ISV!
```
python isv_cmd.py -i <input_cnvs>.bed -o <outputpath> [-p] [-sv]
```
where the input should be a list of CNVs in a bed format, with columns: `chromosome`, `start (grch38)`, `end (grch38)` and `cnv_type`

Results will be saved in a tab separated file at path specified by user

Optionally, use following flags:
- **-p**: whether probabilities should be returned
- **-sv**: whether shap values should be calculated

#### For example

```
python isv_cmd.py -i examples/loss_gain_cnvs.bed -o examples/loss_gain_cnvs_out.bed -p -sv
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/tsladecek/isv_package",
    "name": "isv",
    "maintainer": "Tomas Sladecek",
    "docs_url": null,
    "requires_python": ">=3.6, <4",
    "maintainer_email": "",
    "keywords": "python,machine learning,copy number variation",
    "author": "Tomas Sladecek",
    "author_email": "tomas.sladecek@geneton.sk",
    "download_url": "https://files.pythonhosted.org/packages/84/6f/4e5fef5532e259eeb1949693053cca0c819df9e1ccd0332c7838fd0f7b19/isv-0.3.16.tar.gz",
    "platform": null,
    "description": "# ISV package\n\nPython **pip** package for easy prediction of pathogenicity Copy Number Variants (CNVs)\n\n---\n## If you mention or use the ISV tool, please cite our article\nhttps://www.nature.com/articles/s41598-021-04505-z\n\n---\n## Install\n#### Install with `pip install isv`\nThis will also automatically install all required additional packages. Thus it is recommended to install the package in a separate environment (e.g. virtualenv, conda, ...)\n\n#### Package url: https://pypi.org/project/isv/\n\n#### Module reference available at https://tsladecek.github.io/isv_package/\n\n---\n## Modules\n##### The package contains a wrapper function:\n### `isv.isv(cnvs, proba, shap)`\nwhich automatically annotates and predicts `cnvs` provided in a list, np.array or pandas DataFrame format represented in 4 columns: `chromosome`, `start (grch38)`, `end (grch38)` and `cnv_type`\n\n- The `proba` parameter controls whether probabilities should be calculated\n- The `shap` parameter controls whether shap values should be calculated\n\n#### and a Wrapper class (which is recommended):\n### `isv.ISV(cnvs)`\n\nwith methods:\n- ISV.predict(proba)\n- ISV.shap(data=None)\n  - where the `data` argument is optional\n- ISV.waterfall(cnv_index)\n  - for creating an interactive waterfall plot for a CNV at index `cnv_index`\n\n---\n#### The main subfunctions of the package are:\n\n### 1. `isv.annotate(cnvs)`\n- annotates cnvs provided in a list, np.array or pandas DataFrame format represented in 4 columns: `chromosome`, `start (grch38)`, `end (grch38)` and `cnv_type`\n- Returns an annotated dataframe which can be used as an input to following two functions\n\n### 2. `isv.predict(annotated_cnvs, proba)`\n- returns an array of isv predictions. `annotated_cnvs` represents annotated cnvs returned by the annotate function\n\n### 3. `isv.shap_values(annotated_cnvs)`\n- calculates shap values for given CNVs. `annotated_cnvs` represents annotated cnvs returned by the annotate function\n\n#### For example\n1. using the simple wrapper\n```\nfrom isv import isv\n\n\ncnvs = [\n    [\"chr8\", 100000, 500000, \"DEL\"],\n    [\"chrX\", 52000000, 55000000, \"DUP\"]\n] \n\nresults = isv(cnvs, proba=True, shap=True)\n```\n\n2. using the ISV class\n```\nfrom isv import ISV\n\n\ncnvs = [\n    [\"chr8\", 100000, 500000, \"DEL\"],\n    [\"chrX\", 52000000, 55000000, \"DUP\"]\n] \n\ncnv_isv = ISV(cnvs)\npredictions = cnv_isv.predict(proba=True)\nshap_vals = cnv_isv.shap()\ncnv_isv.waterfall(cnv_index=1)\n```\n\n---\n## Can be also used as a command line tool. Make sure to:\n\n#### 1. clone the repository (https://github.com/tsladecek/isv_package)\n#### 2. install requirements, e.g.\n\n```\nvirtualenv venv\nsource venv/bin/activate\npip install -r requirements.txt\n```\n\n#### 3. Use ISV!\n```\npython isv_cmd.py -i <input_cnvs>.bed -o <outputpath> [-p] [-sv]\n```\nwhere the input should be a list of CNVs in a bed format, with columns: `chromosome`, `start (grch38)`, `end (grch38)` and `cnv_type`\n\nResults will be saved in a tab separated file at path specified by user\n\nOptionally, use following flags:\n- **-p**: whether probabilities should be returned\n- **-sv**: whether shap values should be calculated\n\n#### For example\n\n```\npython isv_cmd.py -i examples/loss_gain_cnvs.bed -o examples/loss_gain_cnvs_out.bed -p -sv\n```\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Automated Interpretation of Structural Copy Number Variants",
    "version": "0.3.16",
    "split_keywords": [
        "python",
        "machine learning",
        "copy number variation"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1d6df5547135889498b98d8c8f0c9a43735b2aadb10cb39d7c1ca9e854874214",
                "md5": "f01f31e844188500e10c5a866f082266",
                "sha256": "46cf61eca940282cc8ac0e9202aa0defe478b78a356c930460a3839e968e4e58"
            },
            "downloads": -1,
            "filename": "isv-0.3.16-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f01f31e844188500e10c5a866f082266",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6, <4",
            "size": 5698344,
            "upload_time": "2023-01-09T11:09:56",
            "upload_time_iso_8601": "2023-01-09T11:09:56.298748Z",
            "url": "https://files.pythonhosted.org/packages/1d/6d/f5547135889498b98d8c8f0c9a43735b2aadb10cb39d7c1ca9e854874214/isv-0.3.16-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "846f4e5fef5532e259eeb1949693053cca0c819df9e1ccd0332c7838fd0f7b19",
                "md5": "fe945e3f9cb7b83d42e168ab4065dfd9",
                "sha256": "df4116e5b4a6ab2d313125bcfe6dcbaf7f56a42fb1f11e83c50417900f7d098f"
            },
            "downloads": -1,
            "filename": "isv-0.3.16.tar.gz",
            "has_sig": false,
            "md5_digest": "fe945e3f9cb7b83d42e168ab4065dfd9",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6, <4",
            "size": 5694732,
            "upload_time": "2023-01-09T11:09:57",
            "upload_time_iso_8601": "2023-01-09T11:09:57.993599Z",
            "url": "https://files.pythonhosted.org/packages/84/6f/4e5fef5532e259eeb1949693053cca0c819df9e1ccd0332c7838fd0f7b19/isv-0.3.16.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-01-09 11:09:57",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "tsladecek",
    "github_project": "isv_package",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "isv"
}
        
Elapsed time: 0.05119s