The OpenCGA Python Client provides a user-friendly API to work with OpenCGA through the REST Web Services. Python client is called pyOpenCGA, some of the main features include:
- full RESTful web service API implemented, all endpoints are supported including new alignment or clinical functionality
- data is returned in a new QueryResponse object which contains metadata and the results, some handy methods and iterators implemented
- it uses the OpenCGA client-configuration.yml file and the stored session
- several Jupyter Notebooks iimplemented
pyOpenCGA has been implemented and contributed by Pablo Marin and David Gomez and it is based on the previous pyCGA library implemented by Antonio Rueda and Daniel Perez from Genomics England.
You can find some examples in the Tutorials section at Using the Python client.
Python client requires at least Python 3.x, although most of the code is fully compatible with Python 2.7. You can install pyOpenCGA either from PyPI repository or from the source code.
You can find stable releases of pyOpenCGA at https://pypi.org/project/pyopencga/, installing is as simple as:
Python client source code can be found in OpenCGA GitHub repository at https://github.com/opencb/opencga/tree/develop/opencga-client/src/main/python/pyOpenCGA. To install any stable of development version of pyOpenCGA we will first need to clone the right branch of OpenCGA repository and install the library using the setup.py file.
Developers only need to create an instance of the ConfigClient class passing it as an argument to the OpenCGAClient. They can optionally pass the user and password or a valid token to start doing calls as an authenticated user. The only role of the OpenCGAClient class is to work as a factory of the actual clients.
OpenCGAClient class works as a factory containing all the different clients necessary to call to any REST web service.
As described in RESTful Web Services#RESTResponse, most of the web services return a QueryResponse object containing a list of QueryResults. This structure has been maintained in the Python library and everytime a call to any WS is done, the response is automatically encapsulated into a custom QueryResponse class that automatically stores all the different values returned and defines a few public methods to help users navigating through the data.
The QueryResponse methods developed are:
The client implements at least one function for each available resource (user, project, study, etc.). Currently, the following functions are available:
Table of Contents:
- No labels