Skip to content

Commit

Permalink
Merge pull request #4537 from galaxyproject/hinny-banana
Browse files Browse the repository at this point in the history
Add news post about embedded workflow list updates.
  • Loading branch information
nomadscientist authored Nov 20, 2023
2 parents 522674f + d500596 commit b0da7bf
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 8 deletions.
37 changes: 37 additions & 0 deletions news/_posts/2023-11-20-workflow-search.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
title: "Update: Workflow List now searches WorkflowHub.eu, advanced query syntax"
contributions:
authorship: [hexylena]
testing: [paulzierep, wm75]
tags: [feature update, gtn]
layout: news
---

## WorkflowHub

We have now added support for [WorkflowHub.eu](WorkflowHub.eu) in our [cross-galaxy workflow search]({% link workflows/list.html %}) interface that lets you find workflows from around the universe. The support for WorkflowHub helps us showcase all of the best-practice workflows currently available there! These can all be imported and run directly in Galaxy.

<iframe src="{% link workflows/embed.html %}?all=vgp+Delphine+Lariviere" height="300px" width="100%" class="gtn-embed"></iframe>

The "Load in Galaxy" button uses our [my.galaxy.training]({{ site.baseurl }}/news/2023/04/20/my-galaxy-training.html) service to let you choose which Galaxy server you're redirected to. These links will work for any recent Galaxy server.

## Querying

Based on [a request from Paul](https://github.com/galaxyproject/training-material/issues/4494), more advanced querying was needed.

As such we've added a couple of alternative query parameters that you may use:

Query Parameter | Example Values | Interpretation
--- | --- | ---
`?query=` | `?query=single-cell` | This will search for the text `singlecell` anywhere in the conjoined fields of title, tags, and authors. This is similar to `all` but will look for exact phrases including spaces, rather than splitting up queries word-by-word.
`?all=` | `?all=longreads+microbiome` | Each term, separated by a `+` (which is interpreted as a ` ` space character in URL parsing), must appear somewhere in those fields. If any term is missing, that workflow will not be included
`?any=` | `?any=longreads+shortread` | As long as one of these terms is present, the result will be shown. So long or short read workflows will match this query. (Assuming they're tagged properly!)
`?none=` | `?none=testing+training` | If you want to exclude one or more terms, you can list them here.

Try some examples here:
- [microbiome tutorials, without nanopore]({% link workflows/embed.html %}?all=microbiome&none=nanopore)
- [single-cell tutorials using the 'old' text query]({% link workflows/embed.html %}?query=single-cell)
- [single-cell tutorials using the new ?all query (it's the same.)]({% link workflows/embed.html %}?all=single-cell)
- [Just Paul's workflows]({% link workflows/embed.html %}?all=paulzierep)

If you have any ideas for new features or improvements, please [open an issue on GitHub](https://github.com/galaxyproject/training-material/issues/)
20 changes: 13 additions & 7 deletions workflows/embed.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,14 @@
<td>{{ workflow.updated }}</td>
<td>
{% for id in workflow.ids %}
<a href="{{ id[0] }}/published/workflow?id={{ id[1] }}" target="_blank">{{ id[0] }} <i class="fa fa-external-link-alt" aria-hidden="true"></i></a>
{% if id[0] == "https://workflowhub.eu" %}
<a href="{{ id[0] }}/workflows/{{ id[1] }}">{{ id[0] }} <i class="fa fa-external-link-alt" aria-hidden="true"></i></a><br/>
<a href="https://my.galaxy.training/?path=/workflows/trs_import%3ftrs_server=workflowhub.eu%26run_form=true%26trs_id={{ id[1] }}%26trs_version=1">
Load in Galaxy
</a><br/>
{% else %}
<a href="{{ id[0] }}/published/workflow?id={{ id[1] }}">{{ id[0] }} <i class="fa fa-external-link-alt" aria-hidden="true"></i></a>
{% endif %}
{% endfor %}
</td>
</tr>
Expand All @@ -61,14 +68,13 @@
}

function search(params){
const textQuery = params.get('query')?.toLowerCase();
const filter_all = params.get('all')?.split(" ").map(f => f.trim().toLowerCase());
const filter_any = params.get('any')?.split(" ").map(f => f.trim().toLowerCase());
const filter_none = params.get('none')?.split(" ").map(f => f.trim().toLowerCase());
const textQuery = params.get('query')?.toLowerCase().replace(/[^a-z0-9 ]/g, '');
const filter_all = params.get('all')?.split(" ").map(f => f.trim().toLowerCase().replace(/[^a-z0-9 ]/g, ''));
const filter_any = params.get('any')?.split(" ").map(f => f.trim().toLowerCase().replace(/[^a-z0-9 ]/g, ''));
const filter_none = params.get('none')?.split(" ").map(f => f.trim().toLowerCase().replace(/[^a-z0-9 ]/g, ''));

var to_hide = rows.filter(row => {
var text = clean(row.children[0].innerText.toLowerCase() + " " +
row.children[1].innerText.toLowerCase());
var text = clean(row.children[0].innerText + " " + row.children[1].innerText);
if (filter_all) {
// Every term in filter_all must be present
// Immediately reject if not all present.
Expand Down
5 changes: 4 additions & 1 deletion workflows/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@
<td>
{% for id in workflow.ids %}
{% if id[0] == "https://workflowhub.eu" %}
<a href="{{ id[0] }}/workflows/{{ id[1] }}">{{ id[0] }} <i class="fa fa-external-link-alt" aria-hidden="true"></i></a>
<a href="{{ id[0] }}/workflows/{{ id[1] }}">{{ id[0] }} <i class="fa fa-external-link-alt" aria-hidden="true"></i></a><br/>
<a href="https://my.galaxy.training/?path=/workflows/trs_import%3ftrs_server=workflowhub.eu%26run_form=true%26trs_id={{ id[1] }}%26trs_version=1">
Load in Galaxy
</a>
{% else %}
<a href="{{ id[0] }}/published/workflow?id={{ id[1] }}">{{ id[0] }} <i class="fa fa-external-link-alt" aria-hidden="true"></i></a>
{% endif %}
Expand Down

0 comments on commit b0da7bf

Please sign in to comment.