ga4gh.vrs


Namega4gh.vrs JSON
Version 0.8.5 PyPI version JSON
download
home_pagehttps://github.com/ga4gh/vrs-python
Summary"GA4GH Variation Representation Specification (VRS) reference implementation (https://github.com/ga4gh/vrs-python/)"
upload_time2023-11-09 13:19:41
maintainer
docs_urlNone
authorReece Hart
requires_python>=3.8
license
keywords bioinformatics ga4gh genomics hgvs spdi variation
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # vrs-python

[![PyPI version](https://badge.fury.io/py/ga4gh.vrs.svg)](https://pypi.org/project/ga4gh.vrs)
[![Travis](https://travis-ci.org/ga4gh/vrs-python.svg?branch=master)](https://travis-ci.org/ga4gh/vrs-python)

vrs-python provides Python language support for the [GA4GH Variation
Representation Specification
(VRS)](https://github.com/ga4gh/vrs).

This repository contains several related components:

- **ga4gh.core package** Python language support for certain nascent standards
  in GA4GH. Eventually, this package should be moved to a distinct repo.

- **ga4gh.vrs package** Python language support for VRS.

- **ga4gh.vrs.extras package** Python language support for additional
  functionality, including translating from and to other variant formats and a
  REST service to similar functionality. `ga4gh.vrs.extras` requires access to
  supporting data, as described below.

- **Jupyter notebooks** Demonstrations of the functionality of `ga4gh.vrs` and
  `ga4gh.vrs.extras` in the form of easy-to-read notebooks.

# VRS-Python and VRS Version Correspondence

The ga4gh/vrs-python repo embeds the ga4gh/vrs repo as a git submodule, and
therefore each ga4gh.vrs package on PyPi embeds a particular version of VRS. The
correspondences between the packages may be summarized as:

| vrs-python branch | vrs branch |
| --- | --- |
| [main](https://github.com/ga4gh/vrs-python/tree/main) | [main](https://github.com/ga4gh/vrs/tree/main) |
| [0.6](https://github.com/ga4gh/vrs-python/tree/0.6) | [1.1](https://github.com/ga4gh/vrs/tree/1.1) |
| [0.7](https://github.com/ga4gh/vrs-python/tree/0.7) | [1.2](https://github.com/ga4gh/vrs/tree/1.2) |
| [0.8](https://github.com/ga4gh/vrs-python/tree/0.8) | [1.3](https://github.com/ga4gh/vrs/tree/1.3) |
| [0.9](https://github.com/ga4gh/vrs-python/tree/0.9) | [metaschema-update](https://github.com/ga4gh/vrs/tree/metaschema-update) |

⚠ **Developers: See the development section below for recommendations for using submodules
gracefully (and without causing problems for others!).**

# Installation

## Installing with pip

    pip install 'ga4gh.vrs[extras]'

The `[extras]` argument tells pip to install packages to fulfill the dependencies of the
`ga4gh.vrs.extras` package.

## Installing dependencies for ga4gh.vrs.extras

The `ga4gh.vrs.extras` modules are not part of the VR spec per se. They are
bundled with ga4gh.vrs for development and installation convenience. These
modules depend directly and indirectly on external data sources of sequences,
transcripts, and genome-transcript alignments. This section recommends one way
to install the biocommons tools that provide these data.

    docker volume create --name=uta_vol
    docker volume create --name=seqrepo_vol
    docker-compose up

This should start three containers:

- [seqrepo](https://github.com/biocommons/seqrepo): downloads seqrepo into a
  docker volume and exits
- [seqrepo-rest-service](https://github.com/biocommons/seqrepo-rest-service): a
  REST service on seqrepo (localhost:5000)
- [uta](https://github.com/biocommons/uta): a database of transcripts and
  alignments (localhost:5432)

Check that the containers are running:

    $ docker ps
    CONTAINER ID        IMAGE                                    //  NAMES
    86e872ab0c69        biocommons/seqrepo-rest-service:latest   //  vrs-python_seqrepo-rest-service_1
    a40576b8cf1f        biocommons/uta:uta_20180821              //  vrs-python_uta_1

Depending on your network and host, the _first_ run is likely to take 5-15
minutes in order to download and install data. Subsequent startups should be
nearly instantaneous.

You can test UTA and seqrepo installations like so:

    snafu$ psql -XAt postgres://anonymous@localhost/uta -c 'select count(*) from transcript'
    249909

### It doesn't work!

Here are some things to try.

- Bring up one service at a time. For example, if you haven't download seqrepo
  yet, you might see this:

      snafu$ docker-compose up seqrepo-rest-service
      Starting vrs-python_seqrepo-rest-service_1 ... done
      Attaching to vrs-python_seqrepo-rest-service_1
      seqrepo-rest-service_1  | 2022-07-26 15:59:59 snafu seqrepo_rest_service.__main__[1] INFO Using seqrepo_dir='/usr/local/share/seqrepo/2021-01-29' from command line
      ⋮
      seqrepo-rest-service_1  | OSError: Unable to open SeqRepo directory /usr/local/share/seqrepo/2021-01-29
      vrs-python_seqrepo-rest-service_1 exited with code 1

# Running the Notebooks

Once installed as described above, type

    $ source venv/3.7/bin/activate
    $ jupyter notebook --notebook-dir notebooks/

The following jupyter extensions are recommended but not required

    $ pip install jupyter_contrib_nbextensions
    $ jupyter contrib nbextension install --user
    $ jupyter nbextension enable toc2/main

## Running the Notebooks on the Terra platform

[Terra](https://terra.bio) is a cloud platform for biomedical research developed by the Broad Institute, Microsoft and Verily. The platform includes preconfigured environments that provide user-friendly access to various applications commonly used in bioinformatics, including Jupyter Notebooks.

We have created a public [`VRS-demo-notebooks`](https://app.terra.bio/#workspaces/terra-outreach/VRS-demo-notebooks) workspace in Terra that contains the demo notebooks along with instructions for running them with minimal setup. To get started, see either the [`VRS-demo-notebooks`](https://app.terra.bio/#workspaces/terra-outreach/VRS-demo-notebooks) workspace or the [`Terra.ipynb`](notebooks/Terra.ipynb) notebook in this repository.


# Development

## Submodules!

vrs-python embeds vrs as a submodule. When checking out vrs-python and switching
branches, it is important to make sure that the submodule tracks vrs-python
correctly. The recommended way to do this is `git config --global submodule.recurse true`. **If you don't set submodule.recurse, developers and
reviewers must be extremely careful to not accidentally upgrade or downgrade
schemas with respect to vrs-python.**

Alternatively, see `misc/githooks/`.

## Installing for development

Fork the repo at https://github.com/ga4gh/vrs-python/ .

    $ git clone --recurse-submodules git@github.com:YOUR_GITHUB_ID/vrs-python.git
    $ cd vrs-python
    $ make devready

## Pre-commit

We use [pre-commit](https://pre-commit.com/) to check code style.

Before first commit, run:

    $ pre-commit install

## Testing

This package implements typical unit tests for ga4gh.core and ga4gh.vrs. This
package also implements the compliance tests from vrs (vrs/validation) in the
tests/validation/ directory.

    $ make test

## Developing VRS (the schema) too

If you want to develop the VRS schema in conjunction with vrs-python, the
recommended approach for most users is to fork and clone the `ga4gh/vrs` repo,
then set the `VRS_SCHEMA_DIR` environment variable to use an alternative schema
location.

# Security Note (from the GA4GH Security Team)

A stand-alone security review has been performed on the specification itself.
This implementation is offered as-is, and without any security guarantees. It
will need an independent security review before it can be considered ready for
use in security-critical applications. If you integrate this code into your
application it is AT YOUR OWN RISK AND RESPONSIBILITY to arrange for a security
audit.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/ga4gh/vrs-python",
    "name": "ga4gh.vrs",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "bioinformatics,ga4gh,genomics,hgvs,spdi,variation",
    "author": "Reece Hart",
    "author_email": "reecehart@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/6c/06/552cd5807a052a82d1e95d34b3fdb21b8e741b8c96d0e2b1cd13d3ae798d/ga4gh.vrs-0.8.5.tar.gz",
    "platform": "any",
    "description": "# vrs-python\n\n[![PyPI version](https://badge.fury.io/py/ga4gh.vrs.svg)](https://pypi.org/project/ga4gh.vrs)\n[![Travis](https://travis-ci.org/ga4gh/vrs-python.svg?branch=master)](https://travis-ci.org/ga4gh/vrs-python)\n\nvrs-python provides Python language support for the [GA4GH Variation\nRepresentation Specification\n(VRS)](https://github.com/ga4gh/vrs).\n\nThis repository contains several related components:\n\n- **ga4gh.core package** Python language support for certain nascent standards\n  in GA4GH. Eventually, this package should be moved to a distinct repo.\n\n- **ga4gh.vrs package** Python language support for VRS.\n\n- **ga4gh.vrs.extras package** Python language support for additional\n  functionality, including translating from and to other variant formats and a\n  REST service to similar functionality. `ga4gh.vrs.extras` requires access to\n  supporting data, as described below.\n\n- **Jupyter notebooks** Demonstrations of the functionality of `ga4gh.vrs` and\n  `ga4gh.vrs.extras` in the form of easy-to-read notebooks.\n\n# VRS-Python and VRS Version Correspondence\n\nThe ga4gh/vrs-python repo embeds the ga4gh/vrs repo as a git submodule, and\ntherefore each ga4gh.vrs package on PyPi embeds a particular version of VRS. The\ncorrespondences between the packages may be summarized as:\n\n| vrs-python branch | vrs branch |\n| --- | --- |\n| [main](https://github.com/ga4gh/vrs-python/tree/main) | [main](https://github.com/ga4gh/vrs/tree/main) |\n| [0.6](https://github.com/ga4gh/vrs-python/tree/0.6) | [1.1](https://github.com/ga4gh/vrs/tree/1.1) |\n| [0.7](https://github.com/ga4gh/vrs-python/tree/0.7) | [1.2](https://github.com/ga4gh/vrs/tree/1.2) |\n| [0.8](https://github.com/ga4gh/vrs-python/tree/0.8) | [1.3](https://github.com/ga4gh/vrs/tree/1.3) |\n| [0.9](https://github.com/ga4gh/vrs-python/tree/0.9) | [metaschema-update](https://github.com/ga4gh/vrs/tree/metaschema-update) |\n\n\u26a0 **Developers: See the development section below for recommendations for using submodules\ngracefully (and without causing problems for others!).**\n\n# Installation\n\n## Installing with pip\n\n    pip install 'ga4gh.vrs[extras]'\n\nThe `[extras]` argument tells pip to install packages to fulfill the dependencies of the\n`ga4gh.vrs.extras` package.\n\n## Installing dependencies for ga4gh.vrs.extras\n\nThe `ga4gh.vrs.extras` modules are not part of the VR spec per se. They are\nbundled with ga4gh.vrs for development and installation convenience. These\nmodules depend directly and indirectly on external data sources of sequences,\ntranscripts, and genome-transcript alignments. This section recommends one way\nto install the biocommons tools that provide these data.\n\n    docker volume create --name=uta_vol\n    docker volume create --name=seqrepo_vol\n    docker-compose up\n\nThis should start three containers:\n\n- [seqrepo](https://github.com/biocommons/seqrepo): downloads seqrepo into a\n  docker volume and exits\n- [seqrepo-rest-service](https://github.com/biocommons/seqrepo-rest-service): a\n  REST service on seqrepo (localhost:5000)\n- [uta](https://github.com/biocommons/uta): a database of transcripts and\n  alignments (localhost:5432)\n\nCheck that the containers are running:\n\n    $ docker ps\n    CONTAINER ID        IMAGE                                    //  NAMES\n    86e872ab0c69        biocommons/seqrepo-rest-service:latest   //  vrs-python_seqrepo-rest-service_1\n    a40576b8cf1f        biocommons/uta:uta_20180821              //  vrs-python_uta_1\n\nDepending on your network and host, the _first_ run is likely to take 5-15\nminutes in order to download and install data. Subsequent startups should be\nnearly instantaneous.\n\nYou can test UTA and seqrepo installations like so:\n\n    snafu$ psql -XAt postgres://anonymous@localhost/uta -c 'select count(*) from transcript'\n    249909\n\n### It doesn't work!\n\nHere are some things to try.\n\n- Bring up one service at a time. For example, if you haven't download seqrepo\n  yet, you might see this:\n\n      snafu$ docker-compose up seqrepo-rest-service\n      Starting vrs-python_seqrepo-rest-service_1 ... done\n      Attaching to vrs-python_seqrepo-rest-service_1\n      seqrepo-rest-service_1  | 2022-07-26 15:59:59 snafu seqrepo_rest_service.__main__[1] INFO Using seqrepo_dir='/usr/local/share/seqrepo/2021-01-29' from command line\n      \u22ee\n      seqrepo-rest-service_1  | OSError: Unable to open SeqRepo directory /usr/local/share/seqrepo/2021-01-29\n      vrs-python_seqrepo-rest-service_1 exited with code 1\n\n# Running the Notebooks\n\nOnce installed as described above, type\n\n    $ source venv/3.7/bin/activate\n    $ jupyter notebook --notebook-dir notebooks/\n\nThe following jupyter extensions are recommended but not required\n\n    $ pip install jupyter_contrib_nbextensions\n    $ jupyter contrib nbextension install --user\n    $ jupyter nbextension enable toc2/main\n\n## Running the Notebooks on the Terra platform\n\n[Terra](https://terra.bio) is a cloud platform for biomedical research developed by the Broad Institute, Microsoft and Verily. The platform includes preconfigured environments that provide user-friendly access to various applications commonly used in bioinformatics, including Jupyter Notebooks.\n\nWe have created a public [`VRS-demo-notebooks`](https://app.terra.bio/#workspaces/terra-outreach/VRS-demo-notebooks) workspace in Terra that contains the demo notebooks along with instructions for running them with minimal setup. To get started, see either the [`VRS-demo-notebooks`](https://app.terra.bio/#workspaces/terra-outreach/VRS-demo-notebooks) workspace or the [`Terra.ipynb`](notebooks/Terra.ipynb) notebook in this repository.\n\n\n# Development\n\n## Submodules!\n\nvrs-python embeds vrs as a submodule. When checking out vrs-python and switching\nbranches, it is important to make sure that the submodule tracks vrs-python\ncorrectly. The recommended way to do this is `git config --global submodule.recurse true`. **If you don't set submodule.recurse, developers and\nreviewers must be extremely careful to not accidentally upgrade or downgrade\nschemas with respect to vrs-python.**\n\nAlternatively, see `misc/githooks/`.\n\n## Installing for development\n\nFork the repo at https://github.com/ga4gh/vrs-python/ .\n\n    $ git clone --recurse-submodules git@github.com:YOUR_GITHUB_ID/vrs-python.git\n    $ cd vrs-python\n    $ make devready\n\n## Pre-commit\n\nWe use [pre-commit](https://pre-commit.com/) to check code style.\n\nBefore first commit, run:\n\n    $ pre-commit install\n\n## Testing\n\nThis package implements typical unit tests for ga4gh.core and ga4gh.vrs. This\npackage also implements the compliance tests from vrs (vrs/validation) in the\ntests/validation/ directory.\n\n    $ make test\n\n## Developing VRS (the schema) too\n\nIf you want to develop the VRS schema in conjunction with vrs-python, the\nrecommended approach for most users is to fork and clone the `ga4gh/vrs` repo,\nthen set the `VRS_SCHEMA_DIR` environment variable to use an alternative schema\nlocation.\n\n# Security Note (from the GA4GH Security Team)\n\nA stand-alone security review has been performed on the specification itself.\nThis implementation is offered as-is, and without any security guarantees. It\nwill need an independent security review before it can be considered ready for\nuse in security-critical applications. If you integrate this code into your\napplication it is AT YOUR OWN RISK AND RESPONSIBILITY to arrange for a security\naudit.\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "\"GA4GH Variation Representation Specification (VRS) reference implementation (https://github.com/ga4gh/vrs-python/)\"",
    "version": "0.8.5",
    "project_urls": {
        "Homepage": "https://github.com/ga4gh/vrs-python"
    },
    "split_keywords": [
        "bioinformatics",
        "ga4gh",
        "genomics",
        "hgvs",
        "spdi",
        "variation"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2d06da5aa5030876673374c97f3d00c3ee19fcdaab126443254c68b1fc284c40",
                "md5": "648bd58f03dfe35dc8c60d8c2b972e5d",
                "sha256": "599acae1b6f2b5f0db26346e5e8ddff8aaad5354196a7799d0378a8cfa17c8eb"
            },
            "downloads": -1,
            "filename": "ga4gh.vrs-0.8.5-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "648bd58f03dfe35dc8c60d8c2b972e5d",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": ">=3.8",
            "size": 47996,
            "upload_time": "2023-11-09T13:19:39",
            "upload_time_iso_8601": "2023-11-09T13:19:39.193180Z",
            "url": "https://files.pythonhosted.org/packages/2d/06/da5aa5030876673374c97f3d00c3ee19fcdaab126443254c68b1fc284c40/ga4gh.vrs-0.8.5-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6c06552cd5807a052a82d1e95d34b3fdb21b8e741b8c96d0e2b1cd13d3ae798d",
                "md5": "4e0b1515faf2b8241a9ea67c8a5cc399",
                "sha256": "5b62d45d6779ee093cc698816e97993022b444e8e29ad11c79b9d51b4e66cf54"
            },
            "downloads": -1,
            "filename": "ga4gh.vrs-0.8.5.tar.gz",
            "has_sig": false,
            "md5_digest": "4e0b1515faf2b8241a9ea67c8a5cc399",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 17117117,
            "upload_time": "2023-11-09T13:19:41",
            "upload_time_iso_8601": "2023-11-09T13:19:41.193074Z",
            "url": "https://files.pythonhosted.org/packages/6c/06/552cd5807a052a82d1e95d34b3fdb21b8e741b8c96d0e2b1cd13d3ae798d/ga4gh.vrs-0.8.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-09 13:19:41",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ga4gh",
    "github_project": "vrs-python",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "ga4gh.vrs"
}
        
Elapsed time: 0.25214s