view gprofiler_snpense.xml @ 1:74385d563652 draft default tip

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/gprofiler/ commit 4d4576623a85b58137f9e8c5a7747cb2f484c8b6"
author iuc
date Mon, 18 Nov 2019 17:55:27 -0500
parents f83a08dff6f0
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>