Giter Club home page Giter Club logo

tribe-client's Introduction

Tribe-Client

Tribe-client is a portable Python app to connect your bioinformatics server or tool to the 'Tribe' web service (located at https://tribe.greenelab.com).

This package allows web servers created using Django to connect directly to Tribe and make use of its resources. Users of the client web server or tool can access their Tribe resources via Tribe OAuth2 authentication.

Requirements

If you are using tribe-client in a web server that uses Django, we recommend you use Django version 1.8 or newer.

Download and Install

Tribe-client is registered as "tribe-client" in PyPI and is pip installable:

pip install tribe-client

Quick Start with Django

  1. Add tribe_client to your INSTALLED_APPS setting:

2. Include the tribe-client URLconf in your project's URLconf (usually urls.py):

3. Register your client server at https://tribe.greenelab.com/oauth2/applications/. Make sure to:

  1. Be logged-in using your Tribe account
  2. Select "Confidential" under Client type and
  3. Select "Authorization Code" under Authorization grant type
  4. Enter your client server's address plus "/tribe_client/get_token" in the Redirect uris box. If your client server's current address is http://example.com, enter http://example.com/tribe_client/get_token

Note

Currently, Tribe supports the following Authorization grant types:

  • Authorization code
  • Resource owner password-based

and does not support the following:

  • Implicit
  • Client credentials

4. Write down the Client ID in the TRIBE_ID setting and the Client secret in the TRIBE_SECRET setting in your settings.py file like so:

5. The TRIBE_REDIRECT_URI setting should be the address of the client server plus "/tribe_client/get_token".

6. Define in your settings the scope that your client server should have for Tribe resources. The two options are: 'read' and 'write'.The default is 'read'. Note: The 'write' scope includes the 'read' scope access.

7. (Optional) If you want to use tribe_client's templates, make sure you have a base template (which gets extended by your other templates and contains the {% block content %} {% endblock %} statements) that the tribe_client templates can extend, and specify its name in your settings. The name of this setting is TRIBE_CLIENT_BASE_TEMPLATE. By default, tribe_client will look for a template called base.html.

8. (Optional) If you want to use tribe_client's built-in login templates and urls, make a link that takes the user to the connect_to_tribe url in your website. This url will show users the built-in Tribe login page. Below is an example of this type of link in the webpage's navbar:

9. (Optional) If you want to redirect your users to somewhere other than the /tribe_client/display_genesets url after they have logged in, you can define this in the TRIBE_LOGIN_REDIRECT setting in your settings.py file. Note: If you are not using the tribe-client built-in templates (see above), you will need to define this setting so your users have somewhere to go after they log in.

10. (Optional) If you want to redirect your users to somewhere other than the /tribe_client url after they log out, you can define this in the TRIBE_LOGOUT_REDIRECT setting in your settings.py file. Note: If you are not using the tribe-client built-in templates (see above), you will need to define this setting so your users have somewhere to go after they log out.

11. (Optional) If you want to download and pickle gene sets/collections from Tribe by using the tribe_client_pickle_public_genesets management command, you must customize the following setting in settings.py:

and run the following management command:

python manage.py tribe_client_pickle_public_genesets

This will download and pickle all the public Tribe collections for every organism in your database. This is handy in case you want to do many gene set enrichment analyses across thousands of gene sets saved in Tribe, or any other task that would require making frequent, large, time-consuming requests for gene sets.

A Closer Look

Under the hood, tribe-client has functions that:

1) Get an access token (via the OAuth2 protocol) that allows users to access and create resources in Tribe.

2) Retrieves public and private collections (and their versions) and displays them on the client server using views and templates included in the package.

3) Allows users to create new collections and versions remotely, from the client server.

tribe-client's People

Contributors

rzelayafavila avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

tribe-client's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.