Skip to main content

Traverses directories to create Galaxy libraries

Project description

galaxy-library-maker

This set of scripts facilitate the create of Galaxy libraries from files filesystem that the Galaxy process has access to (currently this is the only mechanism supported, more could be added).

Installation

Currently, a git clone + local pip install is required. We will add this to pypi soon.

  • Clone this repo and cd inside.
  • Create a python3 virtual environment:
python3 -m venv myVenvName
source myVenvName/bin/activate
pip install --upgrade pip
pip install wheel
  • Install this package
pip install .

Requirements for running

Galaxy API key

You need to obtain a Galaxy API Key on the instance where you want the files loaded as Galaxy Libraries. To obtain an API key, in the main Galaxy screen, go to User -> Preferences, and there click on Manage API key. Copy the key text (or press Create a new key if there is none).

YAML authentication file for Galaxy

You will need a YAML auth file for Galaxy, following the formatting from parsec:

__default: instance_a

instance_a:
    key: "94c9894706fd97b36dbd1acdaa88b749"
    url: "http://localhost:8080/"

instance_b:
    key: "kajshdkajsdhaksjh3ek3jeh327ycei"
    url: "http://my.galaxy.ins/"

Paste the Galaxy key and the appropiate URL (where you access Galaxy). You can have more than one instance in the same YAML if desired (although will be only connection to one at once).

Library definition YAML file

Libraries to be added to Galaxy are defined for this package in a YAML that follows this schema:

---
- library: 'My data project 1'
  desc: 'Descriptio about my data project'
  synopsis: 'A lot of expression data'
  base_dir: /path/to/files/on/a/filesystem/that/galaxy/can/see/and/read
  recursive: true
  extensions:
    - txt: txt
    - gtf: gtf
- library: 'Another project'
  desc: 'Desc about another project'
  synopsis: 'More cool data'
  base_dir: /other/path
  recursive: true
  extensions:
    - _sce.rds: rdata.sce
    - _tab.txt: tabular

You can have as many libraries on the same YAML, each one will become a separate library in Galaxy, where all files that respond to the extensions listed in extensions will be made available, in the same directory structure starting from the base_dir.

How do I know which datatypes are available in my Galaxy instance to use in the extensions part?

Galaxy datatypes are instance dependant and as such you need to know which datatypes are available in your instance. To do this, you can execute the get-datatypes.py script:

get-datatypes.py -C creds.yaml -G instance_a

Running

Assuming the above examples are available in creds.yaml and libs_def.yaml, and that the Galaxy instance where those directories are available is instance_a (and that the virtualenv is activated):

load-into-galaxy-library.py -C creds.yaml -G instance_a -l libs_def.yaml

Testing the package

Make sure that you have docker installed and that you can execute it without sudo, then run:

bash run_tests_with_containers.sh

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

galaxy-library-maker-0.0.1.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

galaxy_library_maker-0.0.1-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file galaxy-library-maker-0.0.1.tar.gz.

File metadata

  • Download URL: galaxy-library-maker-0.0.1.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/51.1.2 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2

File hashes

Hashes for galaxy-library-maker-0.0.1.tar.gz
Algorithm Hash digest
SHA256 09d9c75956b45b3c3a566e9f20c324cdaeba0ae7e2189bc7cf1b122b0408aef8
MD5 802955a864c0eeedab35e1c4af27498d
BLAKE2b-256 6fcfb5d33474447ef81979ea09a4a9bd4880714e55efb7a95dbecd5e043717a1

See more details on using hashes here.

File details

Details for the file galaxy_library_maker-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: galaxy_library_maker-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/51.1.2 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2

File hashes

Hashes for galaxy_library_maker-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bda571296773bdca5f5e6b36e4da0d639da8ccb3cafb1642b2f9ecd8e50c50cf
MD5 e152a7c42b62cbf0d265a9ae8359927f
BLAKE2b-256 40568cf95f16a205cb86d0fa2764edd06909ca440251b74c0eb2e8e3410e2a4e

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