view esearch.xml @ 4:e88866c4f3e7 draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ncbi_entrez_eutils commit 25545b698cffc9999cde0079b3be176f55e17803"
author iuc
date Mon, 04 Jan 2021 11:42:16 +0000
parents e267701c187b
children f3a84eecaf8b
line wrap: on
line source

<?xml version="1.0"?>
<tool id="ncbi_eutils_esearch" name="NCBI ESearch" version="@WRAPPER_VERSION@" profile="@PROFILE@">
  <description>search NCBI Databases by text query</description>
  <macros>
    <import>macros.xml</import>
  </macros>
  <expand macro="requirements"/>
  <version_command>python esearch.py --version</version_command>
  <command detect_errors="aggressive">
    <![CDATA[

      ##Doing replacement here so that dataset label doesn't have slashes
      #set saniterm = $term.replace('"','\\"')

      python '$__tool_directory__/esearch.py'

      $db_select

      "$saniterm"

      #if $history_file and $history_file is not None:
        --history_file '$history_file'
      #end if

#if $date.enabled == 'True'
    --datetype $date.datetype

    #if $date.reldate and $date.reldate is not None:
    --reldate $date.reldate
    #end if

    #if $date.mindate and $date.mindate is not None:
    --mindate '$date.mindate'
    #end if

    #if $date.maxdate and $date.maxdate is not None:
    --maxdate '$date.maxdate'
    #end if
#end if

      #if $retstart is not None:
        --retstart '$retstart'
      #end if

      #if $retmax is not None:
        --retmax '$retmax'
      #end if

      #if $output_format == 'history_xml':
        --history_out
        --retmode xml
      #elif $output_format == 'history_json':
        --history_out
        --retmode json
      #elif $output_format == 'id_xml':
        --retmode xml
      #elif $output_format == 'id_json':
        --retmode json
      #elif $output_format == 'id_text':
        --retmode text
      #end if

      @EMAIL_ARGUMENTS@

      > $default

    ]]>
  </command>
  <inputs>
    <expand macro="dbselect"/>
    <param name="term" type="text" label="Search term">
      <sanitizer>
        <valid>
          <add value="'"/>
          <add value="["/>
          <add value="]"/>
          <add value='"'/>
        </valid>
      </sanitizer>
    </param>
    <param name="history_file" type="data" format="json" optional="true" label="Filter existing history" />
    <param name="output_format" type="select" label="Output Format">
      <option value="history_json">History File (json)</option>
      <option value="history_xml">History File (xml)</option>
      <option value="id_xml">ID File (xml)</option>
      <option value="id_json">ID File (json)</option>
      <option value="id_text" selected="true">ID File (tabular)</option>
    </param>
    <conditional name="date">
      <param name="enabled" type="select" label="Filter by date">
        <option value="False">No</option>
        <option value="True">Yes</option>
      </param>
      <when value="True">
        <param label="Date type" name="datetype" type="select">
          <option value="PDAT">Publish date</option>
          <option value="EDAT">Entrez date</option>
          <option value="MDAT">Modification date</option>
        </param>
        <param name="reldate" type="integer" min="1" optional="true" label="In past N days" />
        <param name="mindate" type="text" label="Minimum date" help="YYYY, YYYY/MM or YYYY/MM/DD" />
        <param name="maxdate" type="text" label="Maximum date" help="YYYY, YYYY/MM or YYYY/MM/DD" />
      </when>
      <when value="False"/>
    </conditional>
    <param name="retstart" type="integer" value="0" min="0" max="99999" label="Starting record to return (--retstart)" />
    <param name="retmax" type="integer" value="100000" min="1" max="100000" label="Maximum number of records to return (--retmax)" />
  </inputs>
  <outputs>
    <data name="default" format="xml" label="ESearch results for $db_select database query: $term">
      <change_format>
        <when input="output_format" value="history_json" format="json" />
        <when input="output_format" value="history_xml" format="xml" />
        <when input="output_format" value="id_xml" format="xml" />
        <when input="output_format" value="id_json" format="json" />
        <when input="output_format" value="id_text" format="tabular" />
      </change_format>
    </data>
  </outputs>
  <tests>
    <test>
      <param name="db_select" value="pubmed"/>
      <param name="term" value="(PNAS[ta] AND 97[vi])"/>
      <param name="retstart" value="0"/>
      <param name="retmax" value="20"/>
      <param name="output_format" value="id_xml"/>
      <output name="default" file="esearch.pubmed.xml" ftype="xml" lines_diff="2"/>
    </test>
    <test>
      <param name="db_select" value="pubmed"/>
      <param name="term" value="PNAS[ta]"/>
      <param name="retstart" value="0"/>
      <param name="retmax" value="20"/>
      <param name="output_format" value="id_xml"/>
      <param name="enabled" value="True"/>
      <param name="datetype" value="PDAT"/>
      <param name="mindate" value="2014/01/01"/>
      <param name="maxdate" value="2014/02/01"/>
      <output name="default" file="esearch.pubmed.2014-01-pnas.xml" ftype="xml" lines_diff="2"/>
    </test>
    <test>
      <param name="db_select" value="gene"/>
      <param name="term" value="&quot;genetype rrna&quot;[Properties] AND &quot;Homo sapiens&quot;[Organism] AND (&quot;srcdb refseq&quot;[Properties] AND alive[prop])"/>
      <param name="retstart" value="2"/>
      <param name="retmax" value="22"/>
      <param name="output_format" value="id_text"/>
      <output name="default" file="esearch.gene.tabular" ftype="tabular" lines_diff="2"/>
    </test>
    <test>
      <param name="db_select" value="gene"/>
      <param name="term" value="118502329"/>
      <param name="retstart" value="0"/>
      <param name="retmax" value="1"/>
      <param name="output_format" value="id_json"/>
      <output name="default" file="esearch.gene.json" ftype="json" lines_diff="2"/>
    </test>
    <test>
      <param name="db_select" value="gene"/>
      <param name="term" value="118502329"/>
      <param name="retstart" value="0"/>
      <param name="retmax" value="1"/>
      <param name="output_format" value="history_json"/>
      <output name="default" file="esearch.gene.hist.json" ftype="json" lines_diff="2"/>
    </test>
    <test>
      <param name="db_select" value="gene"/>
      <param name="term" value="118502329"/>
      <param name="retstart" value="0"/>
      <param name="retmax" value="1"/>
      <param name="output_format" value="history_xml"/>
      <output name="default" file="esearch.gene.hist.xml" ftype="xml" lines_diff="2"/>
    </test>
  </tests>
  <help><![CDATA[
NCBI Entrez ESearch
===================

Responds to a text query with the list of matching UIDs in a given database
(for later use in ESummary, EFetch or ELink), along with the term translations
of the query.

Example Queries
---------------

Search in PubMed with the term cancer for abstracts that have an Entrez date
within the last 60 days:

+----------------------+-------------+
| Parameter            | Value       |
+======================+=============+
| NCBI Database to Use | PubMed      |
+----------------------+-------------+
| Term                 | Cancer      |
+----------------------+-------------+
| Datetype             | Entrez Date |
+----------------------+-------------+
| In past N Days       | 60          |
+----------------------+-------------+

Search PubMed Central for free full text articles containing the query stem cells:

+----------------------+--------------------------------------+
| Parameter            | Value                                |
+======================+======================================+
| NCBI Database to Use | PubMedCentral                        |
+----------------------+--------------------------------------+
| Term                 | Stem Cells AND free fulltext[filter] |
+----------------------+--------------------------------------+

Search in Nucleotide for all tRNAs:

+----------------------+--------------------------------------+
| Parameter            | Value                                |
+======================+======================================+
| NCBI Database to Use | Nucleotide                           |
+----------------------+--------------------------------------+
| Term                 | biomol trna[prop]                    |
+----------------------+--------------------------------------+

Search in Protein for a molecular weight range:

+----------------------+--------------------------------------+
| Parameter            | Value                                |
+======================+======================================+
| NCBI Database to Use | Protein                              |
+----------------------+--------------------------------------+
| Term                 | 70000:90000[molecular weight]        |
+----------------------+--------------------------------------+


@REFERENCES@

@DISCLAIMER@
      ]]></help>
  <expand macro="citations"/>
</tool>