view gprofiler_snpense.xml @ 0:f83a08dff6f0 draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/gprofiler/ commit ed9b518a6aaf6a5aada47e39c039f6936e41b290"
author iuc
date Thu, 14 Nov 2019 06:01:29 -0500
parents
children
line wrap: on
line source

<?xml version="1.0"?>
<tool id="gprofiler_snpense" name="gProfiler SNPense" version="@VERSION@">
    <description>maps SNP rs-codes to gene names, chromosomal coordinates and variant effects</description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <expand macro="requirements"></expand>
    <expand macro="version_command" />
    <command detect_errors="aggressive">Rscript $script_file</command>
    <configfiles>
        <configfile name="script_file"><![CDATA[

options( show.error.messages=F, error = function () { cat( geterrmessage(), file=stderr() ); q( "no", 1, F ) } )
loc <- Sys.setlocale("LC_MESSAGES", "en_US.UTF-8")

suppressPackageStartupMessages({
    library("gprofiler2")
})

set_user_agent(paste(get_user_agent(), "galaxy"))
sessionInfo()

#if $tool_settings.base_url
    set_base_url('${tool_settings.base_url}')
#end if

query <- scan('${input.file_name}', character(), quote = "")

response <- gsnpense( query
                    , filter_na  = ${filter_na}
                    )

output <- response
output[['ensgs']] <- vapply(output[['ensgs']], paste, collapse = ",", character(1L))
output[['gene_names']] <- vapply(output[['gene_names']], paste, collapse = ",", character(1L))

output.colnames = append(colnames(output)[1:(length(colnames(output))-1)], colnames(output[['variants']]))
write.table(output, file='${output}', quote=FALSE, sep='\t', row.names = FALSE, col.names = output.colnames)

        ]]></configfile>
    </configfiles>
    <inputs>
        <param name="input" type="data" format="txt" label="Input is whitespace-separated list of SNP IDs to be translated (should start with prefix ’rs’)." />
        <expand macro="filter_na" />
        <expand macro="tool_settings"></expand>
    </inputs>
    <outputs>
        <data name="output" format="tabular" label="${tool.name} on ${on_string}" />
    </outputs>
    <tests>
        <test>
            <param name="input" ftype="txt" value="example_snpense_query.txt" />
            <param name="base_url" value="http://biit.cs.ut.ee/gprofiler_archive3/e94_eg41_p11" />
            <output name="output" ftype="tabular" file="example_snpense_results.txt" sort="true" />
        </test>
        <test>
            <param name="input" ftype="txt" value="example_snpense_query.txt" />
            <param name="base_url" value="http://biit.cs.ut.ee/gprofiler_archive3/e94_eg41_p11" />
            <param name="filter_na" value="T" />
            <output name="output" ftype="tabular" file="example_snpense_results_2.txt" sort="true" />
        </test>
    </tests>

    <help><![CDATA[

**What it does**
  This tool wraps gprofiler2 R package which performs a request to g:Profiler g:SNPense tool through its API.
    g:Profiler g:SNPense maps SNP rs identifiers to chromosome positions, genes and variant effects. Available only
    for human SNPs.

-----

@REFERENCES@

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