Comments (10)
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.
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.
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.
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.
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.
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.
we will add the line to run.py and let you know
Thanks
Tom
from bioblend.
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.
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.
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)
- 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
- Extend bioblend to support the new notification API HOT 3
- Bioblend reporting workflow as failed while workflow is running or completed successfully. HOT 6
- workflows.refactor_workflows fails on subworkflows HOT 14
- Allow Session Cookies in Requests HOT 1
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.