Re: [galaxy-dev] blend4j

2013-03-03 Thread John Chilton
Can you reproduce this on the main or test galaxy server @ Penn and
make the workflow public?

-John


On Fri, Mar 1, 2013 at 11:21 AM, Marc Logghe  wrote:
>
>
>
>
> From: galaxy-dev-boun...@lists.bx.psu.edu
> [mailto:galaxy-dev-boun...@lists.bx.psu.edu] On Behalf Of Marc Logghe
> Sent: Thursday, February 28, 2013 10:25 PM
> To: galaxy-dev@lists.bx.psu.edu
> Subject: [galaxy-dev] blend4j
>
>
>
> Hi all,
>
> Is this the correct forum to post blend4j issues ? Apologies if this is not
> the case.
>
>
>
> I was trying to run a custom workflow via blend4j, according to
> https://github.com/jmchilton/blend4j
>
> In my hands, the call to workflowDetails.getInputs() returns an empty Map. I
> believe the corresponding REST request looks like:
>
> /galaxy/api/workflows/?key=
>
> In the JSON response, the ‘inputs’ attribute is empty indeed ({"url":
> "/galaxy/api/workflows/f09437b8822035f7", "inputs": {}, …).
>
> I do not understand why this is the case because 2 steps require inputs to
> be set at runtime. Via the Galaxy web interface those required parameters
> can be set and the workflow is running smoothly.
>
> Or has the term ‘inputs’ nothing to do with ‘parameters’ ?
>
>
>
> Please allow me to come back to this. I now realize that the workflow needs
> 2 inputs (instead of parameters). As far as I understand, for the moment it
> is not possible to pass parameter values via the REST API without tempering
> with the JSON strings themselves.
>
> But dataset inputs should be supported. In my case, step 1 and step 2 need
> the same dataset as input.
>
> According to this snippet taken from the blend4j page (shown below), the
> workflow should provide you with the input ids (here workflowInput1Id and
> workflowInput2Id).
>
> The issue is I don’t have a clue what these input ids are, since in my hands
> workflowDetails.getInputs() returns an empty collection. Do you need to add
> metadata/attributes to the workflow in order to have these input IDs
> returned ?
>
>
>
>
>
> final WorkflowDetails workflowDetails =
> workflowsClient.showWorkflow(matchingWorkflow.getId());
>
> String workflowInput1Id = null;
>
> String workflowInput2Id = null;
>
> for(final Map.Entry inputEntry :
> workflowDetails.getInputs().entrySet()) {
>
>   final String label = inputEntry.getValue().getLabel();
>
>   if(label.equals("WorkflowInput1")) {
>
> workflowInput1Id = inputEntry.getKey();
>
>   }
>
>   if(label.equals("WorkflowInput2")) {
>
> workflowInput2Id = inputEntry.getKey();
>
>   }
>
> }
>
>
>
> final WorkflowInputs inputs = new WorkflowInputs();
>
> inputs.setDestination(new
> WorkflowInputs.ExistingHistory(matchingHistory.getId()));
>
> inputs.setWorkflowId(matchingWorkflow.getId());
>
> inputs.setInput(workflowInput1Id, new
> WorkflowInputs.WorkflowInput(input1Id, WorkflowInputs.InputSourceType.HDA));
>
> inputs.setInput(workflowInput2Id, new
> WorkflowInputs.WorkflowInput(input2Id, WorkflowInputs.InputSourceType.HDA));
>
> final WorkflowOutputs output = workflowsClient.runWorkflow(inputs);
>
> System.out.println("Running workflow in history " +
> output.getHistoryId());
>
> for(String outputId : output.getOutputIds()) {
>
>   System.out.println("  Workflow writing to output id " + outputId);
>
> }
>
>
>
> Regards,
>
> Marc
>
> 
> THIS E-MAIL MESSAGE IS INTENDED ONLY FOR THE USE OF THE INDIVIDUAL OR ENTITY
> TO WHICH IT IS ADDRESSED AND MAY CONTAIN INFORMATION THAT IS PRIVILEGED,
> CONFIDENTIAL AND EXEMPT FROM DISCLOSURE.
> If the reader of this E-mail message is not the intended recipient, you are
> hereby notified that any dissemination, distribution or copying of this
> communication is strictly prohibited. If you have received this
> communication in error, please notify us immediately at abl...@ablynx.com.
> Thank you for your co-operation.
> "NANOBODY" and "NANOCLONE" are registered trademarks of Ablynx N.V.
> 
>
> ___
> Please keep all replies on the list by using "reply all"
> in your mail client.  To manage your subscriptions to this
> and other Galaxy lists, please use the interface at:
>
>   http://lists.bx.psu.edu/

___
Please keep all replies on the list by using "reply all"
in your mail client.  To manage your subscriptions to this
and other Galaxy lists, please use the interface at:

  http://lists.bx.psu.edu/


Re: [galaxy-dev] blend4j

2013-03-01 Thread Marc Logghe


From: galaxy-dev-boun...@lists.bx.psu.edu 
[mailto:galaxy-dev-boun...@lists.bx.psu.edu] On Behalf Of Marc Logghe
Sent: Thursday, February 28, 2013 10:25 PM
To: galaxy-dev@lists.bx.psu.edu
Subject: [galaxy-dev] blend4j

Hi all,
Is this the correct forum to post blend4j issues ? Apologies if this is not the 
case.

I was trying to run a custom workflow via blend4j, according to 
https://github.com/jmchilton/blend4j
In my hands, the call to workflowDetails.getInputs() returns an empty Map. I 
believe the corresponding REST request looks like:
/galaxy/api/workflows/?key=
In the JSON response, the 'inputs' attribute is empty indeed ({"url": 
"/galaxy/api/workflows/f09437b8822035f7", "inputs": {}, ...).
I do not understand why this is the case because 2 steps require inputs to be 
set at runtime. Via the Galaxy web interface those required parameters can be 
set and the workflow is running smoothly.
Or has the term 'inputs' nothing to do with 'parameters' ?

Please allow me to come back to this. I now realize that the workflow needs 2 
inputs (instead of parameters). As far as I understand, for the moment it is 
not possible to pass parameter values via the REST API without tempering with 
the JSON strings themselves.
But dataset inputs should be supported. In my case, step 1 and step 2 need the 
same dataset as input.
According to this snippet taken from the blend4j page (shown below), the 
workflow should provide you with the input ids (here workflowInput1Id and  
workflowInput2Id).
The issue is I don't have a clue what these input ids are, since in my hands 
workflowDetails.getInputs() returns an empty collection. Do you need to add 
metadata/attributes to the workflow in order to have these input IDs returned ?


final WorkflowDetails workflowDetails = 
workflowsClient.showWorkflow(matchingWorkflow.getId());
String workflowInput1Id = null;
String workflowInput2Id = null;
for(final Map.Entry inputEntry : 
workflowDetails.getInputs().entrySet()) {
  final String label = inputEntry.getValue().getLabel();
  if(label.equals("WorkflowInput1")) {
workflowInput1Id = inputEntry.getKey();
  }
  if(label.equals("WorkflowInput2")) {
workflowInput2Id = inputEntry.getKey();
  }
}

final WorkflowInputs inputs = new WorkflowInputs();
inputs.setDestination(new 
WorkflowInputs.ExistingHistory(matchingHistory.getId()));
inputs.setWorkflowId(matchingWorkflow.getId());
inputs.setInput(workflowInput1Id, new 
WorkflowInputs.WorkflowInput(input1Id, WorkflowInputs.InputSourceType.HDA));
inputs.setInput(workflowInput2Id, new 
WorkflowInputs.WorkflowInput(input2Id, WorkflowInputs.InputSourceType.HDA));
final WorkflowOutputs output = workflowsClient.runWorkflow(inputs);
System.out.println("Running workflow in history " + output.getHistoryId());
for(String outputId : output.getOutputIds()) {
  System.out.println("  Workflow writing to output id " + outputId);
}

Regards,
Marc

THIS E-MAIL MESSAGE IS INTENDED ONLY FOR THE USE OF THE INDIVIDUAL OR ENTITY TO 
WHICH IT IS ADDRESSED AND MAY CONTAIN INFORMATION THAT IS PRIVILEGED, 
CONFIDENTIAL AND EXEMPT FROM DISCLOSURE. 
If the reader of this E-mail message is not the intended recipient, you are 
hereby notified that any dissemination, distribution or copying of this 
communication is strictly prohibited. If you have received this communication 
in error, please notify us immediately at abl...@ablynx.com. Thank you for your 
co-operation. 
"NANOBODY" and "NANOCLONE" are registered trademarks of Ablynx N.V. 

___
Please keep all replies on the list by using "reply all"
in your mail client.  To manage your subscriptions to this
and other Galaxy lists, please use the interface at:

  http://lists.bx.psu.edu/

Re: [galaxy-dev] blend4j

2013-02-28 Thread Marc Logghe


-Original Message-
From: jmchil...@gmail.com [mailto:jmchil...@gmail.com] On Behalf Of John Chilton
Sent: Thursday, February 28, 2013 11:27 PM
To: Marc Logghe
Cc: galaxy-dev@lists.bx.psu.edu
Subject: Re: [galaxy-dev] blend4j

This is not a blend4j issue, it is more of a Galaxy API issue. I think
it is essentially a known problem that you cannot specify runtime
parameters for workflow, only data inputs. Here the relevant piece of
Galaxy code:

inputs = {}
for step in latest_workflow.steps:
if step.type == 'data_input':
inputs[step.id] = {'label':step.tool_inputs['name'], 'value':""}
else:
pass
# Eventually, allow regular tool parameters to be
inserted and modified at runtime.
# p = step.get_required_parameters()

I think the meantime, the work around is not define these are workflow
parameters but instead hard code some values, and then pull down,
rewrite, and reupload a new workflow for each execution:

WorkflowsClient client = galaxyInstance.getWorkflowsClient();
String workflowJson = client.exportWorkflow(originalWorkflowId);
// modify workflow json
Workflow importedWorkflow = client.importWorkflow(workflowJson);
String importedWorkflowId = importedWorkflow.getId();

It is not pretty obviously. They are pretty good about responding to
API pull requests so if you have the time to fix the Galaxy code
itself I think everyone would appreciate that fix.

-John


Hi John
Thanks for the quick answer; I'll give it a try.
Regarding the fix: you need to give me some time, started with a python 
tutorial only 2 days ago ;-)

Regards,
Marc

THIS E-MAIL MESSAGE IS INTENDED ONLY FOR THE USE OF THE INDIVIDUAL OR ENTITY TO 
WHICH IT IS ADDRESSED AND MAY CONTAIN INFORMATION THAT IS PRIVILEGED, 
CONFIDENTIAL AND EXEMPT FROM DISCLOSURE. 
If the reader of this E-mail message is not the intended recipient, you are 
hereby notified that any dissemination, distribution or copying of this 
communication is strictly prohibited. If you have received this communication 
in error, please notify us immediately at abl...@ablynx.com. Thank you for your 
co-operation. 
"NANOBODY" and "NANOCLONE" are registered trademarks of Ablynx N.V. 



___
Please keep all replies on the list by using "reply all"
in your mail client.  To manage your subscriptions to this
and other Galaxy lists, please use the interface at:

  http://lists.bx.psu.edu/


Re: [galaxy-dev] blend4j

2013-02-28 Thread John Chilton
This is not a blend4j issue, it is more of a Galaxy API issue. I think
it is essentially a known problem that you cannot specify runtime
parameters for workflow, only data inputs. Here the relevant piece of
Galaxy code:

inputs = {}
for step in latest_workflow.steps:
if step.type == 'data_input':
inputs[step.id] = {'label':step.tool_inputs['name'], 'value':""}
else:
pass
# Eventually, allow regular tool parameters to be
inserted and modified at runtime.
# p = step.get_required_parameters()

I think the meantime, the work around is not define these are workflow
parameters but instead hard code some values, and then pull down,
rewrite, and reupload a new workflow for each execution:

WorkflowsClient client = galaxyInstance.getWorkflowsClient();
String workflowJson = client.exportWorkflow(originalWorkflowId);
// modify workflow json
Workflow importedWorkflow = client.importWorkflow(workflowJson);
String importedWorkflowId = importedWorkflow.getId();

It is not pretty obviously. They are pretty good about responding to
API pull requests so if you have the time to fix the Galaxy code
itself I think everyone would appreciate that fix.

-John


On Thu, Feb 28, 2013 at 3:24 PM, Marc Logghe  wrote:
> Hi all,
>
> Is this the correct forum to post blend4j issues ? Apologies if this is not
> the case.
>
>
>
> I was trying to run a custom workflow via blend4j, according to
> https://github.com/jmchilton/blend4j
>
> In my hands, the call to workflowDetails.getInputs() returns an empty Map. I
> believe the corresponding REST request looks like:
>
> /galaxy/api/workflows/?key=
>
> In the JSON response, the ‘inputs’ attribute is empty indeed ({"url":
> "/galaxy/api/workflows/f09437b8822035f7", "inputs": {}, …).
>
> I do not understand why this is the case because 2 steps require inputs to
> be set at runtime. Via the Galaxy web interface those required parameters
> can be set and the workflow is running smoothly.
>
> Or has the term ‘inputs’ nothing to do with ‘parameters’ ?
>
>
>
> Regards,
>
> Marc
>
> 
> THIS E-MAIL MESSAGE IS INTENDED ONLY FOR THE USE OF THE INDIVIDUAL OR ENTITY
> TO WHICH IT IS ADDRESSED AND MAY CONTAIN INFORMATION THAT IS PRIVILEGED,
> CONFIDENTIAL AND EXEMPT FROM DISCLOSURE.
> If the reader of this E-mail message is not the intended recipient, you are
> hereby notified that any dissemination, distribution or copying of this
> communication is strictly prohibited. If you have received this
> communication in error, please notify us immediately at abl...@ablynx.com.
> Thank you for your co-operation.
> "NANOBODY" and "NANOCLONE" are registered trademarks of Ablynx N.V.
> 
>
> ___
> Please keep all replies on the list by using "reply all"
> in your mail client.  To manage your subscriptions to this
> and other Galaxy lists, please use the interface at:
>
>   http://lists.bx.psu.edu/

___
Please keep all replies on the list by using "reply all"
in your mail client.  To manage your subscriptions to this
and other Galaxy lists, please use the interface at:

  http://lists.bx.psu.edu/


[galaxy-dev] blend4j

2013-02-28 Thread Marc Logghe
Hi all,
Is this the correct forum to post blend4j issues ? Apologies if this is not the 
case.

I was trying to run a custom workflow via blend4j, according to 
https://github.com/jmchilton/blend4j
In my hands, the call to workflowDetails.getInputs() returns an empty Map. I 
believe the corresponding REST request looks like:
/galaxy/api/workflows/?key=
In the JSON response, the 'inputs' attribute is empty indeed ({"url": 
"/galaxy/api/workflows/f09437b8822035f7", "inputs": {}, ...).
I do not understand why this is the case because 2 steps require inputs to be 
set at runtime. Via the Galaxy web interface those required parameters can be 
set and the workflow is running smoothly.
Or has the term 'inputs' nothing to do with 'parameters' ?

Regards,
Marc

THIS E-MAIL MESSAGE IS INTENDED ONLY FOR THE USE OF THE INDIVIDUAL OR ENTITY TO 
WHICH IT IS ADDRESSED AND MAY CONTAIN INFORMATION THAT IS PRIVILEGED, 
CONFIDENTIAL AND EXEMPT FROM DISCLOSURE. 
If the reader of this E-mail message is not the intended recipient, you are 
hereby notified that any dissemination, distribution or copying of this 
communication is strictly prohibited. If you have received this communication 
in error, please notify us immediately at abl...@ablynx.com. Thank you for your 
co-operation. 
"NANOBODY" and "NANOCLONE" are registered trademarks of Ablynx N.V. 

___
Please keep all replies on the list by using "reply all"
in your mail client.  To manage your subscriptions to this
and other Galaxy lists, please use the interface at:

  http://lists.bx.psu.edu/