Git Product home page Git Product logo

Comments (9)

ecunha1996 avatar ecunha1996 commented on July 17, 2024 1

Using the state_inputs it works.
Thanks a lot!

from bioblend.

jmchilton avatar jmchilton commented on July 17, 2024

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.

jmchilton avatar jmchilton commented on July 17, 2024

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.

ecunha1996 avatar ecunha1996 commented on July 17, 2024

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.

nsoranzo avatar nsoranzo commented on July 17, 2024

@ecunha1996 I guess that this should work for you:

inputs = {"input_1": {src: "hda", id: "bbd44e69cb8906b550b38de0ec289fcd"}, "r": "true"}

from bioblend.

ecunha1996 avatar ecunha1996 commented on July 17, 2024

@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.

simonbray avatar simonbray commented on July 17, 2024

@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.

simonbray avatar simonbray commented on July 17, 2024

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.

nsoranzo avatar nsoranzo commented on July 17, 2024

Yes, that's a good start, thanks @simonbray !

from bioblend.

Related Issues (20)

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.