changeset 24:94e32337ba54 draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/ncbi_datasets commit 5a65a62588a36d757f96681bf72f537c12c91beb
author iuc
date Fri, 26 Dec 2025 17:17:02 +0000
parents 95be88b49f4e
children
files datasets_gene.xml datasets_genome.xml macros.xml
diffstat 3 files changed, 139 insertions(+), 54 deletions(-) [+]
line wrap: on
line diff
--- a/datasets_gene.xml	Mon Aug 04 08:51:59 2025 +0000
+++ b/datasets_gene.xml	Fri Dec 26 17:17:02 2025 +0000
@@ -209,7 +209,7 @@
             <filter>file_choices['kingdom_cond']['include'] and "cds" in file_choices['kingdom_cond']['include']</filter>
         </data>
         <data name="threep_utr_fasta" label="NCBI Gene Datasets: 3' UTR fasta" format="fasta" from_work_dir="ncbi_dataset/data/3p_utr.fna">
-            <filter>file_choices['kingdom_cond']['include'] and "5p-utr" in file_choices['kingdom_cond']['include']</filter>
+            <filter>file_choices['kingdom_cond']['include'] and "3p-utr" in file_choices['kingdom_cond']['include']</filter>
         </data>
         <data name="fivep_utr_fasta" label="NCBI Gene Datasets: 5' UTR fasta" format="fasta" from_work_dir="ncbi_dataset/data/5p_utr.fna">
             <filter>file_choices['kingdom_cond']['include'] and "5p-utr" in file_choices['kingdom_cond']['include']</filter>
@@ -513,15 +513,60 @@
             </output>
         </test> -->
     </tests>
-    <help>
-<![CDATA[
-**Download Gene Datasets from NCBI**
+    <help><![CDATA[
+.. class:: infomark
+
+**What it does**
+
+Downloads gene data from NCBI using the `datasets`_ command-line tool.
+Retrieve gene sequences, transcripts, proteins, and annotation reports.
+
+**Query Options**
+
+=============  ================================================================
+Method         Description
+=============  ================================================================
+Gene ID        NCBI Gene ID (e.g., 672 for BRCA1)
+Symbol         Gene symbol with taxon (e.g., TP53 in human)
+Accession      RefSeq nucleotide (NM\_) or protein (NP\_/WP\_) accession
+Taxon          All genes for a taxon (large downloads)
+=============  ================================================================
+
+----
+
+**Key Options**
+
+- **Ortholog retrieval**: Get orthologous genes across taxa (vertebrates/insects)
+- **Taxon filter**: Limit WP\_ accession results to specific organisms
+- **Flanking sequence**: Include nucleotides upstream/downstream (WP\_ only)
+- **FASTA filter**: Subset output to specific accessions
 
-Download a gene dataset (gene sequence, transcipt, amino acid sequences, 
-nucleotide coding sequences, 5'-UTR, 3'-UTR) as well as gene and gene
-product reports. Genes can be referred by gene id, symbol, accession,
-or taxon.
-]]>
-    </help>
+**Outputs (Eukaryote)**
+
+- **Gene Data Report**: Tabular metadata (ID, symbol, description, coordinates)
+- **Gene Product Report**: Detailed transcript/protein information
+- **Sequences**: Gene, RNA, protein, CDS, 5'/3' UTR FASTA files
+
+**Outputs (Prokaryote)**
+
+Prokaryotic genes (WP\_ accessions) use a different report format with:
+accession, description, EC number, gene symbol, protein info.
+
+**Examples**
+
+Download human BRCA1::
+
+    Query by: Gene ID
+    Gene ID: 672
+
+Download TP53 orthologs in rodents::
+
+    Query by: Symbol
+    Symbol: tp53
+    Ortholog: rodentia
+
+
+.. _datasets: https://www.ncbi.nlm.nih.gov/datasets/
+]]></help>
     <expand macro="citations"/>
 </tool>
--- a/datasets_genome.xml	Mon Aug 04 08:51:59 2025 +0000
+++ b/datasets_genome.xml	Fri Dec 26 17:17:02 2025 +0000
@@ -46,7 +46,7 @@
 @RELEASED_BEFORE@
 @RELEASED_AFTER@
 #for search_term in $filters.search:
-    --search '$filters.search_term'
+    --search '$search_term.search'
 #end for
 --no-progressbar
 --dehydrated
@@ -191,18 +191,18 @@
             <output name="genome_data_report">
                 <assert_contents>
                     <has_text text="Assembly Accession&#9;Assembly Name&#9;Assembly Submitter&#9;Organism Name"/>
-                    <has_n_lines n="142"/>
+                    <has_n_lines min="140"/>
                     <has_n_columns n="4"/>
                 </assert_contents>
             </output>
-            <output_collection name="rna_fasta" type="list" count="2">
+            <output_collection name="rna_fasta" type="list">
                 <element name="GCF_000306695.2" decompress="true">
                     <assert_contents>
                         <has_text text="&gt;"/>
                     </assert_contents>
                 </element>
             </output_collection>
-            <output_collection name="genomic_gff" type="list" count="12">
+            <output_collection name="genomic_gff" type="list">
                 <element name="GCF_000306695.2">
                     <assert_contents>
                         <has_n_lines min="1000000"/>
@@ -218,29 +218,25 @@
         <test expect_num_outputs="2">
             <conditional name="query|subcommand">
                 <param name="download_by" value="taxon"/>
-                <param name="taxon_positional" value="human"/>
+                <param name="taxon_positional" value="Norway rat"/>
             </conditional>
             <section name="filters">
-                <param name="chromosomes" value="21"/>
-                <param name="assembly_level" value="chromosome,complete"/>  
-                <param name="released_before" value="01/01/2018"/>
+                <param name="chromosomes" value="MT"/>
             </section>
             <section name="file_choices">
                 <param name="include" value="genome"/>
                 <param name="decompress" value="true"/>
             </section>
-            <output_collection name="genome_fasta" type="list:list" count="11">
-                <expand macro="genome_fasta_assert" el1="GCA_000002115.2" el2="chr21" expression="&gt;"/>
-                <expand macro="genome_fasta_assert" el1="GCA_000002125.2" el2="chr21" expression="&gt;"/>
-                <expand macro="genome_fasta_assert" el1="GCA_000212995.1" el2="chr21" expression="&gt;"/>
-                <expand macro="genome_fasta_assert" el1="GCA_000306695.2" el2="chr21" expression="&gt;"/>
-                <expand macro="genome_fasta_assert" el1="GCA_000365445.1" el2="chr21" expression="&gt;"/>
-                <expand macro="genome_fasta_assert" el1="GCA_001292825.2" el2="chr21" expression="&gt;"/>
-                <expand macro="genome_fasta_assert" el1="GCA_001524155.4" el2="chr21" expression="&gt;"/>
-                <expand macro="genome_fasta_assert" el1="GCA_001712695.1" el2="chr21" expression="&gt;"/>
-                <expand macro="genome_fasta_assert" el1="GCA_022833125.2" el2="chr21" expression="&gt;"/>
-                <expand macro="genome_fasta_assert" el1="GCF_000002125.1" el2="chr21" expression="&gt;"/>
-                <expand macro="genome_fasta_assert" el1="GCF_000306695.2" el2="chr21" expression="&gt;"/>
+            <output_collection name="genome_fasta" type="list:list" count="9">
+                <expand macro="genome_fasta_assert" el1="GCA_000001895.4" el2="chrMT" expression="&gt;"/>
+                <expand macro="genome_fasta_assert" el1="GCA_015227675.2" el2="chrMT" expression="&gt;"/>
+                <expand macro="genome_fasta_assert" el1="GCA_036323735.1" el2="chrMT" expression="&gt;"/>
+                <expand macro="genome_fasta_assert" el1="GCA_041222355.1" el2="chrMT" expression="&gt;"/>
+                <expand macro="genome_fasta_assert" el1="GCA_045687965.1" el2="chrMT" expression="&gt;"/>
+                <expand macro="genome_fasta_assert" el1="GCA_045687995.1" el2="chrMT" expression="&gt;"/>
+                <expand macro="genome_fasta_assert" el1="GCA_045688005.1" el2="chrMT" expression="&gt;"/>
+                <expand macro="genome_fasta_assert" el1="GCF_000001895.5" el2="chrMT" expression="&gt;"/>
+                <expand macro="genome_fasta_assert" el1="GCF_015227675.2" el2="chrMT" expression="&gt;"/>
                 <!-- According to  https://github.com/ncbi/datasets/issues/188, the following should not be included among the returned results anymore 09/2023 -->
                 <!--
                 <expand macro="genome_fasta_assert" el1="GCA_000442335.2" el2="GCA_000442335.2_LinearCen1.1_normalized" expression=">" expression_n="25"/>
@@ -249,7 +245,7 @@
             </output_collection>
             <output name="genome_data_report">
                 <assert_contents>
-                    <has_text text="Homo sapiens"/>
+                    <has_text text="Rattus norvegicus"/>
                     <has_n_columns n="4"/>
                 </assert_contents>
             </output>
@@ -495,25 +491,72 @@
                 </assert_contents>
             </output>
         </test>
+        <!-- test search filter -->
+        <test expect_num_outputs="1">
+            <conditional name="query|subcommand">
+                <param name="download_by" value="taxon"/>
+                <param name="taxon_positional" value="Streptococcus"/>
+            </conditional>
+            <section name="filters">
+                <repeat name="search">
+                    <param name="search" value="pyogenes"/>
+                </repeat>
+            </section>
+            <section name="file_choices">
+                <param name="include" value_json="null"/>
+            </section>
+            <output name="genome_data_report">
+                <assert_contents>
+                    <has_text text="pyogenes"/>
+                </assert_contents>
+            </output>
+        </test>
     </tests>
-    <help>
-<![CDATA[
-**Download Genome Datasets from NCBI**
+    <help><![CDATA[
+.. class:: infomark
 
-Download a genome dataset including genome, transcript and protein sequence, annotation and a detailed data report.
-Genome datasets can be specified by NCBI Assembly or BioProject accession(s) or by taxon.
+**What it does**
+
+Downloads genome assemblies from NCBI using the `datasets`_ command-line tool.
+Retrieve genome sequences, annotations, and metadata by accession or taxon.
 
-The download is a three step process:
+**Query Options**
+
+- **By Accession**: NCBI Assembly (GCF\_/GCA\_) or BioProject accession
+- **By Taxon**: Taxonomy ID, scientific name, or common name
 
-1. A "dehydrated" zip file is downloaded which includes the metadata and the download URL)
-2. The metadata is transformed into a tabular (TSV) file
-3. The data is hydrated (the actual data is downloaded)
+**Filters**
+
+====================  ===============================================
+Filter                Description
+====================  ===============================================
+Reference only        Limit to reference/representative assemblies
+Annotated only        Include only genomes with annotations
+Assembly level        Chromosome, complete, contig, or scaffold
+Assembly source       RefSeq (GCF\_) or GenBank (GCA\_)
+Exclude atypical      Remove atypical assemblies (e.g., partial)
+MAG filter            Include/exclude metagenome-assembled genomes
+Date range            Filter by release date
+====================  ===============================================
+
+----
 
-The 3rd step can be skipped by unselecting all output types in the `Include` parameter.
-Thereby its possible to inspect the metadata prior to the actual data download. Also this
-allows to use the tool for querying data sets (and their accessions) of interest which
-can then be downloaded in a second call using the accessions.
-]]>
-    </help>
+.. class:: warningmark
+
+**Note**: The "Reference only" filter returns only RefSeq (GCF\_) assemblies.
+If a taxon has only GenBank (GCA\_) assemblies, this filter will return no results
+with a misleading error message. It is a NCBI datasets bug (not a Galaxy bug).
+
+**Outputs**
+
+- **Data Report**: Tabular metadata for matching assemblies
+- **Genome FASTA**: Genomic sequences (nested collection by accession)
+- **Annotation files**: GFF3, GTF, GenBank flat files
+- **Protein/RNA/CDS**: Amino acid and nucleotide sequences
+- **Sequence Report**: Per-sequence metadata (chromosome, length, etc.)
+
+.. _datasets: https://www.ncbi.nlm.nih.gov/datasets/
+
+]]></help>
     <expand macro="citations"/>
 </tool>
--- a/macros.xml	Mon Aug 04 08:51:59 2025 +0000
+++ b/macros.xml	Fri Dec 26 17:17:02 2025 +0000
@@ -1,5 +1,5 @@
 <macros>
-    <token name="@TOOL_VERSION@">18.5.1</token>
+    <token name="@TOOL_VERSION@">18.13.0</token>
     <token name="@VERSION_SUFFIX@">0</token>
     <token name="@PROFILE@">23.0</token>
     <token name="@LICENSE@">MIT</token>
@@ -95,7 +95,7 @@
     <xml name="genome_includes">
         <option value="genome" selected="true">genomic sequence (genome)</option>
         <option value="rna">transcript (rna)</option>
-        <option value="protein">amnio acid sequences (protein)</option>
+        <option value="protein">amino acid sequences (protein)</option>
         <option value="cds">nucleotide coding sequences (cds)</option>
         <option value="gff3">general feature file (gff3)</option>
         <option value="gtf">gene transfer format (gtf)</option>
@@ -105,7 +105,7 @@
     </xml>
     <xml name="gene_includes">
         <option value="gene">gene sequence (gene)</option>
-        <option value="protein" selected="true">amnio acid sequences (protein)</option>
+        <option value="protein" selected="true">amino acid sequences (protein)</option>
         <yield/>
     </xml>
 
@@ -402,11 +402,8 @@
     </xml>
     <xml name="citations">
         <citations>
-            <citation type="bibtex">@misc{NCBI,
-                author = "{NCBI}",
-                title = "NCBI Datasets",
-                year = "2022",
-                url = "https://github.com/ncbi/datasets"}
+            <citation type="doi">
+                10.1038/s41597-024-03571-y
             </citation>
         </citations>
     </xml>