Repository revision
16:a6a475ed58cb

Repository 'ncbi_datasets'
hg clone https://toolshed.g2.bx.psu.edu/repos/iuc/ncbi_datasets

NCBI Datasets Gene tool metadata
Miscellaneous
download gene sequences and metadata
datasets_download_gene
toolshed.g2.bx.psu.edu/repos/iuc/ncbi_datasets/datasets_download_gene/16.20.0+galaxy0
16.20.0+galaxy0
None
True
Version lineage of this tool (guids ordered most recent to oldest)
toolshed.g2.bx.psu.edu/repos/iuc/ncbi_datasets/datasets_download_gene/16.20.0+galaxy0 (this tool)
toolshed.g2.bx.psu.edu/repos/iuc/ncbi_datasets/datasets_download_gene/16.6.0+galaxy0
toolshed.g2.bx.psu.edu/repos/iuc/ncbi_datasets/datasets_download_gene/15.19.1+galaxy0
toolshed.g2.bx.psu.edu/repos/iuc/ncbi_datasets/datasets_download_gene/14.6.0+galaxy0
toolshed.g2.bx.psu.edu/repos/iuc/ncbi_datasets/datasets_download_gene/14.4+galaxy1
toolshed.g2.bx.psu.edu/repos/iuc/ncbi_datasets/datasets_download_gene/14.4+galaxy0
datasets_download_gene
Requirements (dependencies defined in the <requirements> tag set)
name version type
ncbi-datasets-cli 16.20.0 package
ca-certificates 2024.2.2 package
p7zip 16.02 package
Additional information about this tool
#import re

## If running in a container use certificates from ca-certificates instead of outdated/missing container certificates
[ -f /usr/local/ssl/cacert.pem ] && export SSL_CERT_FILE="/usr/local/ssl/cacert.pem";
        
datasets download gene $query.subcommand.download_by
#if $query.subcommand.download_by == 'taxon':
    '$query.subcommand.taxon_positional'
#else:
    #if $query.subcommand.text_or_file.text_or_file == 'text':
        #echo " ".join(f"'{x}'" for x in re.split(" |,", str($query.subcommand.text_or_file.accession)) if x)
    #else
        --inputfile '$query.subcommand.text_or_file.inputfile'
    #end if
#end if

#if $query.subcommand.download_by != 'taxon' and $query.subcommand.ortholog:
    --ortholog '$query.subcommand.ortholog'
#end if

#if $query.subcommand.download_by == 'symbol':
    #if $query.subcommand.taxon
        --taxon '$query.subcommand.taxon'
    #end if
#end if

#if $query.subcommand.download_by == 'accession':
    #if $query.subcommand.taxon_filter
        --taxon-filter '$query.subcommand.taxon_filter'
    #end if
    #if str($query.subcommand.include_flanks_bp)
        --include-flanks-bp $query.subcommand.include_flanks_bp
    #end if
#end if

#if $filters.fasta_filter_cond.fasta_filter_select
    #if $filters.fasta_filter_cond.fasta_filter_select == 'text'
        --fasta-filter #echo ",".join(f"'{x}'" for x in $filters.fasta_filter_cond.fasta_filter.split(',') if x)
    #else
        --fasta-filter-file '$filters.fasta_filter_cond.fasta_filter_file'
    #end if
#end if

--include
#if $file_choices.kingdom_cond.include
    #echo ",".join($file_choices.kingdom_cond.include)
#else
    none
#end if

--no-progressbar

## produce TSV report file (either gene or prok-gene)
&& 
dataformat
    tsv
    $file_choices.kingdom_cond.kingdom_sel
    --package ncbi_dataset.zip
    --fields #echo ",".join($file_choices.kingdom_cond.report_columns)
    > gene_data_report.tsv
## if ! dataformat tsv gene --package ncbi_dataset.zip > gene_data_report.tsv 2> dataformat.log; then
##     dataformat tsv prok-gene --package ncbi_dataset.zip > gene_data_report.tsv 2>> dataformat.log;
## fi

#if $file_choices.kingdom_cond.include and "product-report" in $file_choices.kingdom_cond.include
    && dataformat tsv gene-product --package ncbi_dataset.zip > gene_product_report.tsv
#end if

## unzip and rehydrate if any data is to be downloaded (include is not None)
#if $file_choices.kingdom_cond.include
    ## unzip
    && 7z x -y ncbi_dataset.zip > 7z.log
#end if
None
False
Functional tests
name inputs outputs required files
Test-1 query|subcommand|text_or_file|accession: 672
query|subcommand|text_or_file|text_or_file: text
query|subcommand|download_by: gene-id
name: value
name: value
name: value
value
Test-2 query|subcommand|text_or_file|accession: 2597,14433
query|subcommand|text_or_file|text_or_file: text
query|subcommand|download_by: gene-id
name: value
name: value
name: value
value
Test-3 query|subcommand|text_or_file|inputfile: geneids.txt
query|subcommand|text_or_file|text_or_file: file
query|subcommand|ortholog: Haplorrhini,Strepsirrhini
query|subcommand|download_by: gene-id
file_choices|kingdom_cond|include: ['gene', 'cds']
name: value
name: value
name: value
geneids.txt
value
Test-4 query|subcommand|text_or_file|accession: tp53
query|subcommand|text_or_file|text_or_file: text
query|subcommand|download_by: symbol
file_choices|kingdom_cond|include:
name: value
value
Test-5 query|subcommand|text_or_file|accession: brca1
query|subcommand|text_or_file|text_or_file: text
query|subcommand|taxon: house mouse
query|subcommand|download_by: symbol
file_choices|kingdom_cond|include: ['3p-utr', '5p-utr', 'product-report']
name: value
name: value
name: value
name: value
value
Test-6 query|subcommand|text_or_file|accession: brca1
query|subcommand|text_or_file|text_or_file: text
query|subcommand|ortholog: rodentia
query|subcommand|download_by: symbol
file_choices|kingdom_cond|include:
name: value
value
Test-7 query|subcommand|text_or_file|accession: NP_000483.3
query|subcommand|text_or_file|text_or_file: text
query|subcommand|download_by: accession
file_choices|kingdom_cond|include:
name: value
value
Test-8 query|subcommand|text_or_file|accession: NM_000546.6 NM_000492.4
query|subcommand|text_or_file|text_or_file: text
query|subcommand|ortholog: all
query|subcommand|download_by: accession
file_choices|kingdom_cond|include:
name: value
value
Test-9 query|subcommand|text_or_file|accession: WP_004675351.1
query|subcommand|text_or_file|text_or_file: text
query|subcommand|include_flanks_bp: 100
query|subcommand|download_by: accession
file_choices|kingdom_cond|include: ['gene', 'protein']
file_choices|kingdom_cond|kingdom_sel: prok-gene
Test-10 query|subcommand|taxon_positional: human
query|subcommand|download_by: taxon
file_choices|kingdom_cond|include:
name: value
value
Test-11 query|subcommand|taxon_positional: human
query|subcommand|download_by: taxon
filters|fasta_filter_cond|fasta_filter: NP_542432.2
filters|fasta_filter_cond|fasta_filter_select: text
file_choices|kingdom_cond|include: protein
name: value
name: value
value