Coder Social home page Coder Social logo

Comments (10)

simleo avatar simleo commented on July 21, 2024

Hello,

to run a workflow with custom parameters, use the params keyword argument. For an example, see the API docs.

Note that if you're using a recent versions of Galaxy you can also express the params dictionary in a more compact form, e.g.:

{'blastn': {'evalue': '1e-06'}}

instead of:

{'blastn': {'param': 'evalue', 'value': '1e-06'}}

from bioblend.

tombair avatar tombair commented on July 21, 2024

I am not having trouble running a workflow with parameters, that is well documented. Workflow parameters are different you set a variable and use that throughout the workflow, change file names,set sample groups all based on a variable set up using ${variable_name} and accessed throughout the workflow using the same. Maybe I am missing something obvious in your description but I cannot refer to a tool like 'blastn' because it is many tools that use the variable.

from bioblend.

jmchilton avatar jmchilton commented on July 21, 2024

Yes - it looks like the bioblend documentation for replacement_params is incorrect. It should just be dictionary from strings to strings and will be used for output name substitutions the way you are describing. Can you try it and let me know if it works? If it does I will be happy to update the documentation.

from bioblend.

tombair avatar tombair commented on July 21, 2024

I tried doing something like this:
rep_params = {'SAMPLE_ID':sampleName}
rwf = workflowClient.run_workflow(workflow['id'],datamap,history_id=history['id'],import_inputs_to_history=True,replacement_params=rep_params)
as well as:
rep_params = {'${SAMPLE_ID}':sampleName}
both without success.

Any ideas? I have a test case set up and can try things very easily, just don't know what else to try.

Thanks

from bioblend.

jmchilton avatar jmchilton commented on July 21, 2024

Reviewing the code the first version rep_params = {'SAMPLE_ID':sampleName} seems to be the intention. There could well be a bug - I don't think we have any test coverage for this API feature (either in Galaxy's API tests or bioblend's).

If you want to help debug the problem - I would start placing a debug statement like log.debug("Have replacement_dict %s" % self.replacement_dict) in Galaxy's lib/galaxy/workflows/run.py file in the _handle_post_job_actions method and then trying to run the workflow in both the UI and through bioblend (with replacement_params specified) and seeing what the difference is.

That would tell you if it was a problem with the format of the input or if the pieces are just not being wired together correctly.

None of this is your responsibility obviously - I will get to it eventually - but I already have a long TODO list regarding the workflow API :).

from bioblend.

simleo avatar simleo commented on July 21, 2024

Sorry, I should have read your question more carefully. Last time I checked, to replace ${foo} with bar you had to specify replacement_params={'foo': 'bar'}. I've never found the time to set up a test case for this though.

from bioblend.

tombair avatar tombair commented on July 21, 2024

we will add the line to run.py and let you know

Thanks

Tom

from bioblend.

tombair avatar tombair commented on July 21, 2024

Thanks for the clues:
We were unable to find the run.py file on our current version (75efcf774765+ (June 2, 2014)), so we installed a new version on a vm (ea41bb1ebc6b+ (August 12, 2013)) and the format of {'workflow_parameter_name';'string you wish to replace with} assigned to replacement_params does pass the variable in and it works great.

So in summary if you have a ${variable} in your workflow you can assign a string to that variable by using the replacement_params argument to run_worflow using the form {'variable': 'string'}

from bioblend.

jmchilton avatar jmchilton commented on July 21, 2024

Great - thanks for the update. Updated the documentation for replacement_params to clarify the intent. We should start including information on when various API endpoints and features are added at some point - but I don't know how to find the time to do that right now.

from bioblend.

simleo avatar simleo commented on July 21, 2024

Extended docs for replacement_params with an even more explicit example and a reference to this thread. These docs were actually already available, but only in the OO API.

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.