Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version of run_tool exercise for discussion #6

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

claresloggett
Copy link
Contributor

Some exercises added to the bioblend API notebook for discussion. For now just added to the ex1_bioblend_answers notebook; the exercises notebook hasn't been updated.
The basic idea is to get the output dataset from the workflow (i.e. the tabular dataset) and sort it using run_tool().
I think this may be too much, particularly for the upcoming conference where teaching might be slow. Some steps, like getting the output dataset, are a bit fiddly. Do we want this stuff in now? Or can it be simplified?

Copy link
Owner

@nsoranzo nsoranzo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot @claresloggett ! I was thinking, maybe the tool search/view/run part could be put in a separate exercise?

"metadata": {},
"outputs": [],
"source": [
"sort_tool = 'sort1'"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"sort_tool = 'sort1'"
"sort_tool_id = 'sort1'"

}
],
"source": [
"tool_details = tc.show_tool(sort_tool, io_details=True)\n",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"tool_details = tc.show_tool(sort_tool, io_details=True)\n",
"tool_details = tc.show_tool(sort_tool_id, io_details=True)\n",

}
],
"source": [
"tc.run_tool(new_hist['id'], sort_tool,\n",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"tc.run_tool(new_hist['id'], sort_tool,\n",
"gi.tools.run_tool(new_hist['id'], sort_tool_id,\n",

"cell_type": "markdown",
"metadata": {},
"source": [
"9) Create a `bioblend.galaxy.tools.ToolClient` object."
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To make it simpler I tend to use gi.tools instead of creating separate objects.

}
],
"source": [
"pprint(tc.get_tools(name='Sort'))"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"pprint(tc.get_tools(name='Sort'))"
"pprint(gi.tools.get_tools(name='Sort'))"

@@ -339,7 +347,522 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"8) View the results on the Galaxy server with your web browser."
"8) Get the id of the output dataset from the workflow. You can get this from the history, or by getting the job id from `gi.workflows.show_invocation()` and then the output dataset id from the job using `gi.jobs.show_job()`. You'll need to wait until the workflow jobs have been scheduled."
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"8) Get the id of the output dataset from the workflow. You can get this from the history, or by getting the job id from `gi.workflows.show_invocation()` and then the output dataset id from the job using `gi.jobs.show_job()`. You'll need to wait until the workflow jobs have been scheduled."
"8) Get the id of the output dataset from the workflow. You can get this from the history, or by getting first the job id from `gi.invocations.show_invocation()`, and then the output dataset id from the job using `gi.jobs.show_job()`. You will need to wait until the workflow jobs have been scheduled."

}
],
"source": [
"invocation = gi.workflows.show_invocation(wf['id'],ret['id'])\n",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"invocation = gi.workflows.show_invocation(wf['id'],ret['id'])\n",
"invocation = gi.invocations.show_invocation(ret['id'])\n",

It would be probably good to replace ret with something like invocation or wf_inv here and above.

"cell_type": "markdown",
"metadata": {},
"source": [
"11) Check the tool inputs by calling `show_tool()` with `io_details=True`. It might be useful to open Galaxy and compare the inputs you see here to the tool inputs in the Galaxy UI."
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"11) Check the tool inputs by calling `show_tool()` with `io_details=True`. It might be useful to open Galaxy and compare the inputs you see here to the tool inputs in the Galaxy UI."
"11) Inspect the tool inputs by calling `show_tool()` with `io_details=True`. It might be useful to open Galaxy and compare the inputs you see here to the tool inputs in the Galaxy UI."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants