-
Notifications
You must be signed in to change notification settings - Fork 414
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1451 from bebatut/enasearch
Add ENASearch
- Loading branch information
Showing
10 changed files
with
10,264 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: enasearch | ||
owner: iuc | ||
description: "A Python library for interacting with ENA's API" | ||
homepage_url: https://github.com/bebatut/enasearch | ||
long_description: | | ||
ENASearch is a Python library for interacting with ENA's API. | ||
remote_repository_url: https://github.com/ASaiM/galaxytools/tree/master/tools/enasearch/ | ||
type: unrestricted | ||
categories: | ||
- Data Source | ||
auto_tool_repositories: | ||
name_template: "{{ tool_id }}" | ||
description_template: "Wrapper for the ENASearch tool suite: {{ tool_name }}" | ||
suite: | ||
name: "suite_enasearch" | ||
description: "A Python library for interacting with ENA's API" | ||
long_description: | | ||
ENASearch is a Python library for interacting with ENA's API. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
ENASearch | ||
========= | ||
|
||
[ENASearch](https://github.com/bebatut/enasearch) is a Python library for interacting with [ENA](http://www.ebi.ac.uk/ena/browse/programmatic-access)'s API. | ||
|
||
For any change in the `macros.xml`, please change on [`generate_macros.py`](generate_macros.py) and regenerate the `macros.xml` with | ||
|
||
``` | ||
$ conda install enasearch | ||
$ python generate_macros.py | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<tool id="enasearch_retrieve_analysis_report" name="Retrieve an analysis report" version="@WRAPPER_VERSION@.0"> | ||
<description></description> | ||
<macros> | ||
<import>macros.xml</import> | ||
<import>search_macros.xml</import> | ||
</macros> | ||
<expand macro="requirements"/> | ||
<expand macro="version"/> | ||
<command detect_errors="aggressive"><![CDATA[ | ||
enasearch | ||
retrieve_analysis_report | ||
--accession '$accession' | ||
@FIELDS@ | ||
--file '$output' | ||
]]></command> | ||
<inputs> | ||
<expand macro="accession"/> | ||
<param argument="--fields" type="select" optional="true" multiple="true" label="Fields to return"> | ||
<expand macro="analysis_fields"/> | ||
</param> | ||
</inputs> | ||
<outputs> | ||
<data name="output" format="tabular" label="${tool.name} on ${accession}"/> | ||
</outputs> | ||
<tests> | ||
<test> | ||
<param name="accession" value="ERZ009929"/> | ||
<output name="output" md5="cfcb3fb4db26e039f12f36eaa7519871"/> | ||
</test> | ||
<test> | ||
<param name="accession" value="ERZ009929"/> | ||
<param name="fields" value="analysis_accession"/> | ||
<output name="output" md5="7249f93fac05d1e6746a076e1ae445b5"/> | ||
</test> | ||
<test> | ||
<param name="accession" value="ERZ009929"/> | ||
<param name="fields" value="analysis_accession,sample_accession,scientific_name"/> | ||
<output name="output" md5="af4ba9b125b27525979ab6ea6a2b3637"/> | ||
</test> | ||
</tests> | ||
<help><![CDATA[ | ||
**What it does** | ||
This tool retrieve an analysis report for an accession id | ||
]]></help> | ||
<expand macro="citations"/> | ||
</tool> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
<tool id="enasearch_retrieve_data" name="Retrieve ENA data" version="@WRAPPER_VERSION@.0"> | ||
<description>(other than taxon and project)</description> | ||
<macros> | ||
<import>macros.xml</import> | ||
<import>search_macros.xml</import> | ||
</macros> | ||
<expand macro="requirements"/> | ||
<expand macro="version"/> | ||
<command detect_errors="aggressive"><![CDATA[ | ||
enasearch | ||
retrieve_data | ||
@IDS@ | ||
@DISPLAY@ | ||
$expanded | ||
$header | ||
--file '$output' | ||
--download 'txt' | ||
]]></command> | ||
<inputs> | ||
<param argument="--ids" type="text" multiple="true" label="Ids for records to return" help="Other than Taxon and Project. It can also be range of ids (e.g. ERA000010-ERA000020)"/> | ||
<expand macro="display_opt"/> | ||
<expand macro="expanded"/> | ||
<expand macro="header"/> | ||
</inputs> | ||
<outputs> | ||
<data name="output" format="tabular" label="${tool.name} on ${ids}"> | ||
<expand macro="change_format"/> | ||
</data> | ||
</outputs> | ||
<tests> | ||
<test> | ||
<param name="ids" value="ERA000010-ERA000020"/> | ||
<conditional name="display_opt"> | ||
<param name="display" value="xml"/> | ||
</conditional> | ||
<output name="output" ftype="xml" md5="d42dec30c41578705ba9b167dc0c30b1"/> | ||
</test> | ||
<test> | ||
<param name="ids" value="A00145"/> | ||
<conditional name="display_opt"> | ||
<param name="display" value="fasta"/> | ||
<param name="range_start" value="3"/> | ||
<param name="range_stop" value="63"/> | ||
</conditional> | ||
<output name="output" ftype="fasta" md5="758cb77161dcf6f8cf841cb141e9277e"/> | ||
</test> | ||
<test> | ||
<param name="ids" value="AL513382"/> | ||
<conditional name="display_opt"> | ||
<param name="display" value="text"/> | ||
<param name="offset" value="0"/> | ||
<param name="length" value="100"/> | ||
</conditional> | ||
<param name="expanded" value="true"/> | ||
<output name="output" md5="e77ed0fb6f75093251b6ddc98f9db835"/> | ||
</test> | ||
<test> | ||
<param name="ids" value="PRJEB2772,AL513382"/> | ||
<conditional name="display_opt"> | ||
<param name="display" value="html"/> | ||
</conditional> | ||
<param name="header" value="true"/> | ||
<output name="output" md5="7b23a8c12893728272f4993073e341f6"/> | ||
</test> | ||
</tests> | ||
<help><![CDATA[ | ||
**What it does** | ||
This tool retrieve ENA data (other than taxon and project) | ||
]]></help> | ||
<expand macro="citations"/> | ||
</tool> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<tool id="enasearch_retrieve_run_report" name="Retrieve a run report" version="@WRAPPER_VERSION@.0"> | ||
<description></description> | ||
<macros> | ||
<import>macros.xml</import> | ||
<import>search_macros.xml</import> | ||
</macros> | ||
<expand macro="requirements"/> | ||
<expand macro="version"/> | ||
<command detect_errors="aggressive"><![CDATA[ | ||
enasearch | ||
retrieve_run_report | ||
--accession '$accession' | ||
@FIELDS@ | ||
--file '$output' | ||
]]></command> | ||
<inputs> | ||
<expand macro="accession"/> | ||
<param argument="--fields" type="select" optional="true" multiple="true" label="Fields to return"> | ||
<expand macro="run_fields"/> | ||
</param> | ||
</inputs> | ||
<outputs> | ||
<data name="output" format="tabular" label="${tool.name} on ${accession}"/> | ||
</outputs> | ||
<tests> | ||
<test> | ||
<param name="accession" value="SRX017289"/> | ||
<output name="output" md5="0f0c6df8d03b9b26b2906921524d7ad1"/> | ||
</test> | ||
<test> | ||
<param name="accession" value="SRX017289"/> | ||
<param name="fields" value="study_accession,study_title,sra_aspera"/> | ||
<output name="output" md5="c6e42cb421832aafac42de4bfc9cc7e8"/> | ||
</test> | ||
</tests> | ||
<help><![CDATA[ | ||
**What it does** | ||
This tool retrieve a run report for an accession id | ||
]]></help> | ||
<expand macro="citations"/> | ||
</tool> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<tool id="enasearch_retrieve_taxons" name="Retrieve ENA taxon data" version="@WRAPPER_VERSION@.0"> | ||
<description></description> | ||
<macros> | ||
<import>macros.xml</import> | ||
<import>search_macros.xml</import> | ||
</macros> | ||
<expand macro="requirements"/> | ||
<expand macro="version"/> | ||
<command detect_errors="aggressive"><![CDATA[ | ||
enasearch | ||
retrieve_taxons | ||
@IDS@ | ||
#if $result | ||
--result '$result' | ||
#end if | ||
@DISPLAY@ | ||
$expanded | ||
$header | ||
--file '$output' | ||
--download 'txt' | ||
]]></command> | ||
<inputs> | ||
<param argument="--ids" type="text" multiple="true" label="Ids for records to return"/> | ||
<param argument="--result" type="select" optional="true" label="Taxonomy result to return"> | ||
<expand macro="taxonomy_results"/> | ||
</param> | ||
<expand macro="display_opt"/> | ||
<expand macro="expanded"/> | ||
<expand macro="header"/> | ||
</inputs> | ||
<outputs> | ||
<data name="output" format="tabular" label="${tool.name} on ${ids}"> | ||
<expand macro="change_format"/> | ||
</data> | ||
</outputs> | ||
<tests> | ||
<test> | ||
<param name="ids" value="6543"/> | ||
<param name="result" value="sequence_release"/> | ||
<conditional name="display_opt"> | ||
<param name="display" value="fasta"/> | ||
</conditional> | ||
<output name="output" ftype="fasta" md5="e2fe353d00ffdec2f8b884903add458b"/> | ||
</test> | ||
<test> | ||
<param name="ids" value="Human,Cat,Mouse,Zebrafish"/> | ||
<conditional name="display_opt"> | ||
<param name="display" value="xml"/> | ||
</conditional> | ||
<output name="output" ftype="xml" md5="0833f5ac248a3e7f382e4d53762fc71d"/> | ||
</test> | ||
</tests> | ||
<help><![CDATA[ | ||
**What it does** | ||
This tool retrieve ENA taxon data | ||
]]></help> | ||
<expand macro="citations"/> | ||
</tool> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,143 @@ | ||
<tool id="enasearch_search_data" name="Search ENA data" version="@WRAPPER_VERSION@.0"> | ||
<description>given a query</description> | ||
<macros> | ||
<import>macros.xml</import> | ||
<import>search_macros.xml</import> | ||
</macros> | ||
<expand macro="requirements"/> | ||
<expand macro="version"/> | ||
<command detect_errors="aggressive"><![CDATA[ | ||
enasearch | ||
search_data | ||
$query_type.free_text_search | ||
#if $query_type.free_text_search == '--free_text_search' | ||
--query '$query_type.query' | ||
--result '$query_type.res.result' | ||
@SEARCH_DATA_DISPLAY@ | ||
#else | ||
--result '$query_type.res.result' | ||
#set $queries='' | ||
#set $sep='' | ||
#for $i, $s in enumerate( $query_type.res.queries ) | ||
#if $sep == '' | ||
#set $sep = str($s.combination_operation) | ||
#else | ||
#set $sep = str($s.combination_operation) | ||
#set $queries += ' %s ' % ($sep) | ||
#end if | ||
#if $s.filter_field.field != 'location' | ||
#set $queries += '%s' % (str($s.filter_field.field)) | ||
#if str($s.filter_field.operation) == "equal" | ||
#set $queries += '=' | ||
#elif str($s.filter_field.operation) == "different" | ||
#set $queries += '!=' | ||
#elif str($s.filter_field.operation) == "lower" | ||
#set $queries += '<' | ||
#elif str($s.filter_field.operation) == "equal or lower" | ||
#set $queries += '<=' | ||
#elif str($s.filter_field.operation) == "higher" | ||
#set $queries += '>' | ||
#elif str($s.filter_field.operation) == "equal or higher" | ||
#set $queries += '>=' | ||
#end if | ||
#set $queries += '"%s"' % (str($s.filter_field.value)) | ||
#else | ||
#set $queries += '%s(%s)' % (str($s.filter_field.operation),str($s.filter_field.values)) | ||
#end if | ||
#end for | ||
--query '$queries' | ||
@SEARCH_DATA_DISPLAY@ | ||
#end if | ||
--file '$output' | ||
--download 'txt' | ||
]]></command> | ||
<inputs> | ||
<conditional name="query_type"> | ||
<param argument="--free_text_search" type="select" label="Use free text search?" help="If not, the ENA data warehouse is used"> | ||
<option value="--free_text_search">Yes</option> | ||
<option value="">False</option> | ||
</param> | ||
<when value="--free_text_search"> | ||
<param argument="--query" type="text" label="Query"/> | ||
<expand macro="free_text_search"/> | ||
</when> | ||
<when value=""> | ||
<expand macro="conditional_text_search"/> | ||
</when> | ||
</conditional> | ||
</inputs> | ||
<outputs> | ||
<data name="output" format="tabular" label="${tool.name}"> | ||
<change_format> | ||
<when input="query_type.res.display_opt.display" value="fasta" format="fasta" /> | ||
<when input="query_type.res.display_opt.display" value="fastq" format="fastq" /> | ||
<when input="query_type.res.display_opt.display" value="html" format="html" /> | ||
<when input="query_type.res.display_opt.display" value="text" format="text" /> | ||
<when input="query_type.res.display_opt.display" value="xml" format="xml" /> | ||
</change_format> | ||
</data> | ||
</outputs> | ||
<tests> | ||
<test> | ||
<conditional name="query_type"> | ||
<param name="free_text_search" value="--free_text_search"/> | ||
<param name="query" value="kinase+homo+sapiens"/> | ||
<conditional name="res"> | ||
<param name="result" value="sequence_update"/> | ||
<conditional name="display_opt"> | ||
<param name="display" value="fasta"/> | ||
</conditional> | ||
</conditional> | ||
</conditional> | ||
<output name="output" ftype="fasta" md5="d02da99308bbf1e432fc5614c1982994"/> | ||
</test> | ||
<test> | ||
<conditional name="query_type"> | ||
<param name="free_text_search" value="--free_text_search"/> | ||
<param name="query" value="kinase+homo+sapiens"/> | ||
<conditional name="res"> | ||
<param name="result" value="wgs_set"/> | ||
<conditional name="display_opt"> | ||
<param name="display" value="report"/> | ||
<param name="fields" value="accession,environmental_sample"/> | ||
</conditional> | ||
</conditional> | ||
</conditional> | ||
<output name="output" ftype="tabular" md5="c1f91a8276f59c90ec53025e1a3d31d5"/> | ||
</test> | ||
<test> | ||
<conditional name="query_type"> | ||
<param name="free_text_search" value=""/> | ||
<conditional name="res"> | ||
<param name="result" value="coding_release"/> | ||
<repeat name="queries"> | ||
<param name="combination_operation" value="AND"/> | ||
<conditional name="filter_field"> | ||
<param name="field" value="dataclass"/> | ||
<param name="operation" value="equal"/> | ||
<param name="value" value="STD"/> | ||
</conditional> | ||
</repeat> | ||
<repeat name="queries"> | ||
<param name="combination_operation" value="AND"/> | ||
<conditional name="filter_field"> | ||
<param name="field" value="tissue_lib"/> | ||
<param name="operation" value="equal"/> | ||
<param name="value" value="lambda gt11"/> | ||
</conditional> | ||
</repeat> | ||
<conditional name="display_opt"> | ||
<param name="display" value="xml"/> | ||
</conditional> | ||
</conditional> | ||
</conditional> | ||
<output name="output" ftype="xml" md5="0ed405b4db2bcaf9c1540307fe15e9bb"/> | ||
</test> | ||
</tests> | ||
<help><![CDATA[ | ||
**What it does** | ||
This tool retrieve ENA taxon data | ||
]]></help> | ||
<expand macro="citations"/> | ||
</tool> |
Oops, something went wrong.