Skip to main content

Apollo API library

Project description

https://travis-ci.org/galaxy-genome-annotation/python-apollo.svg?branch=master Documentation Status

Apollo is a Python library for interacting with Apollo. Arrow is its companion CLI tool.

for the record … arrow makes working with Apollo SOOO much easier — Nathan Dunn, Apollo Developer

Installation

pip install apollo

Examples

Example code to create a new organism and add yourself in the permission list:

from apollo import ApolloInstance
wa = ApolloInstance('https://fqdn/apollo', 'jane.doe@fqdn.edu', 'password')

orgs = wa.organisms.add_organism(
    "Yeast",
    "/path/to/jbrowse/data",
    genus='Saccharomyces',
    species='cerevisiae',
    public=False
)

# Give Apollo a second to process the uploaded organism.
time.sleep(1)

# Then add yourself to permission list
data = wa.users.update_organism_permissions(
    "jane.doe@fqdn.edu",
    "Yeast",
    write=True,
    export=True,
    read=True,
)

If you have already created an Arrow config file (with command arrow init), you can also get an ApolloInstance without writing credentials explicitely:

from arrow.apollo import get_apollo_instance
wa = get_apollo_instance()

Or with the Arrow client:

$ arrow groups create_group university
{
    "publicGroup": false,
    "class": "org.bbop.apollo.UserGroup",
    "name": "university",
    "users": null,
    "id": 558319
}
# THEN
$ arrow users get_users | \
    jq '.[] | select(.username | contains("@tamu.edu")) | .username' | \
    xargs -n1 arrow users add_to_group university
# OR
$ arrow users get_users | \
    jq '.[] | select(.username | contains("@tamu.edu")) | .username' | \
    paste -s -d',' | \
    xargs arrow group update_membership 558319 --users

History

  • 4.2.2
    • Drastically speed up load_gff3

    • load_gff3 now uses the Apollo add_transcript method if it is a gene or mRNA type

    • Added support for all of the current Apollo coding and non-coding types

    • Drop support for Python 2.7

  • 4.2.1
    • Fix getting groups by name

    • Add tests for group api

  • 4.2
    • Improve user update method

    • Add tests for user api

  • 4.1
    • Fix loading attributes from gff3

    • Better handling of genome sequence update, with or without the no_reload_sequences option

  • 4.0.1
    • Fix missing file in pypi package, no code change

  • 4.0
    • Added support for remote creation/update/deletion of organisms/tracks

    • Added support for adding GFF3 in the annotation track

    • Added tests

  • 3.1
    • Added user activate/inactivate

    • Added get_creator for user, group and organisms

    • Added omitEmptyOrganisms to get_users

    • Added support for group admins

    • Added support for bulk group creation/deletion

    • Repaired GFF3/Fasta downloading

  • 3.0.4
  • 3.0.3
    • findAllOrganisms works correctly, client side filtering no longer necessary.

  • 3.0.2
    • Patch a bug discovered in io.write, thanks Morgan!

  • 3.0
    • “Arrow” CLI utility

    • More pythonic API and many workarounds for Apollo bugs or oddities

    • Complete package restructure

    • Nearly all functions renamed

  • 2.0
    • Galaxy Functions

    • TTL Cache to work around Galaxy’s behaviour

    • Status and Canned* Clients from @abretaud

  • 1.0
    • Initial release

Development

The content of docs and arrow directories is automatically generated from the code in the apollo directory. To regenerate it, install the latest version of the code, then run:

make rebuild

License

Available under the MIT License

Support

This material is based upon work supported by the National Science Foundation under Grant Number (Award 1565146)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

apollo-4.2.2.tar.gz (41.0 kB view details)

Uploaded Source

Built Distributions

apollo-4.2.2-py3.8.egg (237.6 kB view details)

Uploaded Source

apollo-4.2.2-py3.7.egg (236.3 kB view details)

Uploaded Source

File details

Details for the file apollo-4.2.2.tar.gz.

File metadata

  • Download URL: apollo-4.2.2.tar.gz
  • Upload date:
  • Size: 41.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.6.7

File hashes

Hashes for apollo-4.2.2.tar.gz
Algorithm Hash digest
SHA256 3eaf1e2203a3fde246d8a0f5e59d937fed8954d9ff9b4c84ee1799ab0bbfc77a
MD5 4492f3436a53f827727b4d921a8871a1
BLAKE2b-256 93e8d81754286228d3fe0e849514f2e74c8329aacfe216727446be7ca14e9fab

See more details on using hashes here.

File details

Details for the file apollo-4.2.2-py3.8.egg.

File metadata

  • Download URL: apollo-4.2.2-py3.8.egg
  • Upload date:
  • Size: 237.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.8.1

File hashes

Hashes for apollo-4.2.2-py3.8.egg
Algorithm Hash digest
SHA256 59d83bc3c0ee315ad5022dbea83e4fd1b7d195ccb7324f61638919fa888eb526
MD5 02f5c7c71873c84809a9f13b5d5536b3
BLAKE2b-256 0e9cf372c7b2d9c44196645c9af7d5db7b6b75a5fff552affe9f2723c28d2ce8

See more details on using hashes here.

File details

Details for the file apollo-4.2.2-py3.7.egg.

File metadata

  • Download URL: apollo-4.2.2-py3.7.egg
  • Upload date:
  • Size: 236.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.8.1

File hashes

Hashes for apollo-4.2.2-py3.7.egg
Algorithm Hash digest
SHA256 815c6930a14be5daa6032a145251ec80b4b57830bd345be28b0de3d0c8b2a61f
MD5 6ef34edc572d0e1a48ca2814e57024ae
BLAKE2b-256 638aed098ec1285127f89096a30c26094a58a6cb8322c8ed86aaf8e5a581a35e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page