Galaxy API - Run Workflow with Parameters - API Bioblend

Hi,

I have a problem with Galaxy API.

I have a workflow defined like this:

I am trying to run a workflow using blend4j. Blend4j does not support invoke_workflow, show I am trying to run a workflow using this code:

    String url = "myUrl";
    String apiKey = "myAPI_Key";

    final GalaxyInstance instance = GalaxyInstanceFactory.get(url, apiKey);
    final WorkflowsClient workflowsClient = instance.getWorkflowsClient();

    Workflow matchingWorkflow = null;
    for(Workflow workflow : workflowsClient.getWorkflows()) {
        if(workflow.getId().equals(id)) {
            matchingWorkflow = workflow;
        }
    }

    final WorkflowDetails workflowDetails = workflowsClient.showWorkflow(matchingWorkflow.getId());

    for(final Map.Entry<String, WorkflowStepDefinition> stepDefinitionEntry : workflowDetails.getSteps().entrySet()) {
        System.out.println(stepDefinitionEntry.getKey());
        for(final Map.Entry<String, WorkflowStepDefinition.WorkflowStepOutput> inputSteps : stepDefinitionEntry.getValue().getInputSteps().entrySet()) {
            System.out.println(inputSteps.getKey());
        }
    }



    ArrayList<WorkflowInputDefinition> workflowInputDefinitionArrayList = new ArrayList<>();
    for(final Map.Entry<String, WorkflowInputDefinition> inputEntry : workflowDetails.getInputs().entrySet()) {
        workflowInputDefinitionArrayList.add(inputEntry.getValue());
    }

    final WorkflowInputs inputs = new WorkflowInputs();
    inputs.setWorkflowId(id);
    inputs.setStepParameter(5,"classname", "play");
    inputs.setStepParameter(5,"dataset", "naiveBayes");
    inputs.setStepParameter(5,"columns", "outlook,temperature,humidity,windy");
    inputs.setStepParameter(5,"kfold", 3);
    inputs.setStepParameter(6,"alpha", 0.1);

    final WorkflowOutputs output = workflowsClient.runWorkflow(inputs);
    return ResponseEntity.ok(output);

But I get null GalaxyResponse. Is there any way to run a workflow with step Parameters through blend4J?

If this is not possible, can I run it through python using Bioblend or using API calls?

Thank you very much.

1 Like

Hi @kkech!

Yes, please try using Bioblend or the API.

See:

Iā€™m not sure but will ask our development team for feedback at Gitter. They may reply here or at Gitter, and do feel free to jump into the conversation over there. https://gitter.im/galaxyproject/Lobby?at=5ced8765b76eac527a65359a

Thanks!

Hi @kkech,

At the EBI we wrote something on top of bioblend to execute workflows:

Basically we require the workflow file (json), a parameters file for the workflow (json), inputs file (described in a yaml), a credentials file (yaml with api key) and optionally a set of tools that are allowed to fail (yaml). Then it will do some validation checks, upload the data to the Galaxy instance, upload the workflow, set parameters, send it to run, wait for the results and download the results when all executions are done. I hope it fits your use case. We are starting to use it for some production pipelines at EBI.

1 Like

Hi @pcm32,

Thank you very much for your response. I implement all the calls without bio blend.

Hi @jennaj,

Thank you very much for your response. I implement all the calls without bio blend.