Skip to content
This repository was archived by the owner on Oct 28, 2022. It is now read-only.

Files

Latest commit

 

History

History

python

http://genomicsandhealth.org/files/logo_ga.png

GA4GH Schemas Python

This is the GA4GH schemas compiled as Protocol Buffers descriptors. It can be used to describe and serialize genomics data using a standard interchange format.

You can install the schemas using pip install ga4gh-schemas.

import ga4gh.schemas.ga4gh.variants_pb2 as variants
my_variant = variants.Variant(
    reference_name="1",
    start=1832,
    end=1833,
    reference_bases="A",
    alternate_bases=["C"])

Full documentation is available at read-the-docs.org.

  • To read more about how the GA4GH API uses Protocol Buffers, see here.

Development

First, checkout out the source tree, create a new virtual environment, and activate. Then you'll install the development requirements and process the *.proto into compiled Python bindings.

This requires having protoc >3.0.0 installed. You can find source and binary releases here.

git clone git@github.com:ga4gh/ga4gh-schemas.git
cd schemas
virtualenv env
source env/bin/activate
pip install -r python/dev-requirements.txt
python setup.py develop
cd python
python -m nose tests

The generated protocol buffers bindings are not checked into the source tree, but are generated by the developer when making changes. To regenerate the bindings you can run python setup.py develop, which will process the schemas into the compiled python classes.

You can then make modifications to the files in src/main/proto and rerun the compilation using the same method. If successful, it will overwrite any bindings2016-11-02 currently in the directory. If you are making and deleting new proto files, you may end up with compiled bindings in your directory that you aren't using. These are ignored by git and if not imported, will not affect your code.

Making releases

When releasing the package to PyPi, the release manager should guarantee the protocol version in setup.py matches the protocol version being released.

Since PyPi and the source code may provide different minor versions, release notes for the PyPi package are maintained here.

Release Notes

0.6.0a9.post2 2016-1-20

  • Set the release version (#790).

0.6.0a9.post1 2016-1

  • Remove protoc from install path (#781).

0.6.0a9 2016-1

  • "BioSample" refactored to "Biosample" (#697).
  • Calls list supports if no genotype is reported (#735).
  • Introduces a new versioning scheme to match ga4gh/ga4gh-schemas protocol version.
  • Improve setup process (#751, #746).

0.0.8 2016-11-02

  • Initial release from dcolligan/ga4gh-schemas