Question: blend4j - Running a galaxy tool ?
1
gravatar for lindfors.erno
4.1 years ago by
Germany
lindfors.erno30 wrote:

Hi all,

How can I run a galaxy tool by using the blend4j package (http://jmchilton.github.io/blend4j/apidocs/) ?

I have successfully managed to do it from Python command line (http://bioblend.readthedocs.org/en/latest/api_docs/galaxy/all.html) by using the following command:
toolClient.run_tool(history_id=history['id'], tool_id=TOOL_ID, tool_inputs=params)

However I have not identified any corresponding method in com.github.jmchilton.blend4j.galaxy.ToolsClient (http://jmchilton.github.io/blend4j/apidocs/com/github/jmchilton/blend4j/galaxy/ToolsClient.html).

I am pretty sure this functionality is somewhere in the blend4j package.

Thanks,
Erno Lindfors

blend4j galaxy • 881 views
ADD COMMENTlink modified 4.1 years ago • written 4.1 years ago by lindfors.erno30
3
gravatar for jmchilton
4.1 years ago by
jmchilton1.1k
United States
jmchilton1.1k wrote:

Blend4j is always lagging behind bioblend - it just doesn't have as many people actively using it. So the newest version of blend4j in Maven central has an incredibly limited ability to run tools - like it cannot even specify input files I don't think.

I have created a branch of blend4j with some improvements that allow a simple example of running a tool such as randomlines to work. If you want to checkout, compile, and install that branch a simple example call would be something like:

    final History history = TestHelpers.createTestHistoryObject(instance, "randomlineshistorytest");
    final String inputId = TestHelpers.populateTestDataset(instance, history.getId(), "1\n2\n3\n");

    final Map<String, Object> parameters = new HashMap<String, Object>();
    final Map<String, String> inputDict = new HashMap<String, String>();
    inputDict.put("src", "hda");
    inputDict.put("id", inputId);
    parameters.put("input", inputDict);
    parameters.put("num_lines", "1");
    final ToolInputs toolInputs = new ToolInputs("random_lines1", parameters);
    client.create(history, toolInputs);

It is pretty low-level to use and doesn't produce parsed result data structures, etc... so I am not sure it is terribly useful yet even with the changes in that branch. I have created an issue on Github to address these short-comings.

Sorry I don't have better news.

ADD COMMENTlink written 4.1 years ago by jmchilton1.1k
0
gravatar for lindfors.erno
4.1 years ago by
Germany
lindfors.erno30 wrote:

Thanks again for your prompt help!
I have been looking into your improved blend4j package.
However as you anticipated I feel maybe it is a bit too unstable for my purpose, so I think for the moment I will just call python directly from Java (a bit dirty but should work), and perhaps will switch to blend4j when a more stable package is available.

Thanks,
Erno Lindfors

ADD COMMENTlink written 4.1 years ago by lindfors.erno30
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 179 users visited in the last hour