Hi, I'm interested in developing a tool that would allow easy interaction with the Galaxy API. I started coding and this[1] is what I have so far. [1]https://github.com/cjav/galaxy-api-tools This is a pure "release early, release often" kind of project. In the current state many of the project's goals are missing and current implementation might significantly change. You can however already do something like this: $ galaxy-api-tools import --link --file-type fasta --library "API Imports" --folder R_TEST --description "R_TEST with description." --workflow 2491ee81eec9beee --extension .qual:qual454 --label QUAL:.qual --label FASTA:.fna /local/data/R_TEST/1.fna /local/data/R_TEST/2.fna This will import(only '--link' not copy, copy is the default) these two 454 fasta files with the matching quality files into data library "API Imports" and folder "R_TEST"(it will create both if they don't exists), it will them run a workflow where there are two inputs labeled as FASTA and QUAL assigning the correct file to each, the results will be available in a newly created history. I shamelessly copied/adapted code from '$GALAXY_SOURCE/scripts/api'. I'm releasing this code under BSD-Clause-2 which I think is one of the most open license I could find in the github dropdown menu. Hopefully this license won't have any incompatibility with Galaxy license which seems very open also. I would love to receive comments to help shape this tool. I'm very open to any kind of suggestions. Also, if there is any worry the name of the tool my cause any confusion on the source, please let me know and I'll be happy to change it. Best Carlos
On Mon, Aug 26, 2013 at 12:27 PM, Carlos Borroto <carlos.borroto@gmail.com> wrote:
Hi,
I'm interested in developing a tool that would allow easy interaction with the Galaxy API. I started coding and this[1] is what I have so far.
Second effort session on this project. The first time around I somehow missed Bioblend python library, I made sure this is not the case this time around. Bioblend is making development quite easy and is opening a bunch of possibilities I didn't even know were possible. The project is now also on pypi, all you need to install it is: $ pip install galaxy-api-tools This is a use case fully supported currently. - List all workflows available to you: $ galaxy-api-tools get-workflows [ { u'id': u'f597429621d6eb2b', u'model_class': u'StoredWorkflow', u'name': u'Map and Variant Calling', u'published': False, u'tags': [], u'url': u'/api/workflows/f597429621d6eb2b'}, { u'id': u'f2db41e1fa331b3e', u'model_class': u'StoredWorkflow', u'name': u'Combine and Split', u'published': False, u'tags': [], u'url': u'/api/workflows/f2db41e1fa331b3e'}] - Show workflow details so you can clearly see what to expect and what you need to provide: $ galaxy-api-tools show-workflow name="Combine and Split" { u'id': u'f2db41e1fa331b3e', u'inputs': { u'5': { u'label': u'FASTA', u'value': u''}, u'6': { u'label': u'QUAL', u'value': u''}, u'7': { u'label': u'BARCODE_INDEX', u'value': u''}}, u'model_class': u'StoredWorkflow', u'name': u'Combine and Split', u'published': False, u'steps': { u'5': { u'id': 5, u'input_steps': { }, u'tool_id': None, u'type': u'data_input'}, u'6': { u'id': 6, u'input_steps': { }, u'tool_id': None, u'type': u'data_input'}, u'7': { u'id': 7, u'input_steps': { }, u'tool_id': None, u'type': u'data_input'}, u'8': { u'id': 8, u'input_steps': { u'fasta_file': { u'source_step': 5, u'step_output': u'output'}, u'qual_file': { u'source_step': 6, u'step_output': u'output'}}, u'tool_id': u'fastq_combiner', u'type': u'tool'}, u'9': { u'id': 9, u'input_steps': { u'barcode_index': { u'source_step': 7, u'step_output': u'output'}, u'input_format|inputs_0|input': { u'source_step': 8, u'step_output': u'output_file'}}, u'tool_id': u'ngs-tools_split_by_barcode', u'type': u'tool'}}, u'tags': [], u'url': u'/api/workflows/f2db41e1fa331b3e'} - Upload two pairs of FNA/QUAL files from a 454 run and run the previous workflow for combining them into a FASTQ file and split them by barcode: $ galaxy-api-tools upload --library name="API Imports" --upload-method galaxy_filesystem \ --genome hg19 --folder "Run 20130918" --workflow name="Combine and Split" \ --add-file .qual=qual454=QUAL --workflow-input BARCODE_INDEX=1cd8e2f6b131e891=ldda \ --workflow-param ngs-tools_split_by_barcode=barcodes=RL001,RL002 \ /local/seq_data/R_2013_09_18/1.fna /local/seq_data/R_2013_09_18/2.fna { u'history': u'0c5ffef6d88a1e97', u'outputs': [u'1a5b83933dc4bf08', u'aebaa141e7243ebf']} { u'history': u'911dde3ddb677bcd', u'outputs': [u'07a38ebd55a6989d', u'56fc5a09f8ae2546']} There are a few issues I need to workout. Also, a lot of code refactoring and commenting needs to happen if a seriously want other people to join this effort. Ideally something like this could be built inside Bioblend. I hope someone else finds it useful, Carlos
participants (1)
-
Carlos Borroto