Comments (9)
Using the state_inputs it works.
Thanks a lot!
from bioblend.
Certainly there is no top-down desire to push people toward workflows over tools - like most of the API development it is entirely organic. More people have made use of the workflow API - it has had more eyes, more community development, etc... than the tools client and API. There has been an open Trello card with the feature request for sometime - https://trello.com/c/67HsrgVm - I will try to get to it. In the mean time checking out the API tests for tools might elucidate things slightly - https://bitbucket.org/galaxy/galaxy-central/src/5f89fecb2f0703ce237cc185b2ccbb2bc0fd2658/test/api/test_tools.py?at=default. If you really want to get into the weeds the tool test framework targets the API so it has more details - https://bitbucket.org/galaxy/galaxy-central/src/5f89fecb2f0703ce237cc185b2ccbb2bc0fd2658/test/base/interactor.py?at=default#cl-143.
from bioblend.
Just to be spell things out at a high-level - inputs should just be a dict with the input parameters as keys and the values as values. Parameters nested inside of conditionals should have the form cond_name|input_name
, repeat parameters should likewise be nested but with an index appended to the repeat name repeat_name_0|input_name
, repeat_name_1|input_name
, etc... Values are fairly straight forward except for dataset inputs - these should take the form - {'src': 'hda', 'id': '<encoded_dataset_id>'}
. There are many more details - some that I don't even understand or haven't worked through. Like I said though, I will try to find some time to document these in the next couple weeks.
from bioblend.
Hello,
I'm having some problems with the tool_inputs to run tools, especially setting the dataset.
Here is a simple example with fastq_info:
inputs = {"input_1": "bbd44e69cb8906b550b38de0ec289fcd", 'r': 'true'}
gi.tools.run_tool("b47d6ac96387d407" , gi.tools.show_tool("fastq_info")["id"], tool_inputs=inputs)
I checked the inputs with the show_tool method, and I'm able to change inputs whose argument is not None (like 'r', in the example above). However I cannot set the dataset, or other inputs whose argument is None.
How should I solve this?
Thanks in advance
from bioblend.
@ecunha1996 I guess that this should work for you:
inputs = {"input_1": {src: "hda", id: "bbd44e69cb8906b550b38de0ec289fcd"}, "r": "true"}
from bioblend.
@nsoranzo I tried that but it keeps ignoring the dataset I select. I ran the tool directly in the galaxy portal, and than checked the inputs with the show_job method, and looked like this:
'inputs': {'fastq_1': {'id': 'bbd44e69cb8906b5b717152b0718556f',
'src': 'hda',
'uuid': 'aaf14c77-4631-4406-9b88-bb30bbe6770f'}}
Instead of using "input_1" I tried to use "fastq_1", but the problem remains.
from bioblend.
@ecunha1996 I think show_tool()
is the wrong thing to check. The state_inputs
returned by build()
should be correct. That gives
{"input_option": {"input_type": "single", "fastq_1": {"values": [{"id": "bbd44e69cb8906b5b717152b0718556f", "src": "hda"}]}}, "q": "true", "r": "false"}
I hope that works for you? This should be better documented for sure. :/
from bioblend.
I wrote a sentence in the docs directing users to the build()
method: 984421d
Not sure if that is enough to close this issue?
from bioblend.
Yes, that's a good start, thanks @simonbray !
from bioblend.
Related Issues (20)
- Workflow properties missing in latest release HOT 4
- Add warnings for deprecated parameters and methods HOT 2
- Add collection download HOT 1
- Filtering for gi.jobs.get_jobs() and gi.datasets.get_datasets() HOT 1
- Method to cancel a job
- Add type annotations to BioBlend API HOT 2
- Rebuild docs with sphinx-apidoc
- Add an `invoke()` method to the BioBlend.objects `Workflow` class
- Fix unreliable tests
- Add tests for bioblend.toolshed
- 'GalaxyInstance' raises AttributeError when instantiated with email & password combination HOT 2
- Incorrect PyYAML version for bioblend 0.9.0 - 0.16.0 HOT 1
- Getting abosl HOT 1
- Error when trying to get ids of workflow outputs HOT 13
- partial workflow invocation HOT 9
- Drop cloudlaunch support ? HOT 4
- Add support for parameter "all" in get_histories HOT 2
- Tool search in Toolshed: number total results HOT 6
- File name displayed as Pasted Entry for file uploaded using upload_file_contents HOT 2
- Downloading a file from a shared data library HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bioblend.