view cfsan_lexmapr2.xml @ 19:a2bf7a8b7bc9

"planemo upload"
author kkonganti
date Thu, 15 Sep 2022 14:50:34 -0400
parents 62b848017a6a
children 0be9a7117ba5
line wrap: on
line source
<tool id="cfsan_lexmapr2" name="Lexmapr2" version="2.0+galaxy0">
    <description>A Lexicon and Rule-Based Tool for Translating Short Biomedical Specimen Descriptions into Semantic Web Ontology Terms</description>
    <requirements>
        <requirement type="package" version="3.7">python</requirement>
        <requirement type="package">python-dateutil</requirement>
        <requirement type="package">inflection</requirement>
        <requirement type="package">matplotlib</requirement>
        <requirement type="package">pandas</requirement>
        <requirement type="package">nltk</requirement>
        <requirement type="package">requests</requirement>
        <requirement type="package">seaborn</requirement>
        <requirement type="package">pygraphviz</requirement>
    </requirements>
    <version_command>python $__tool_directory__/lexmapr2.py --version</version_command>
    <command detect_errors="exit_code"><![CDATA[
    mkdir -p lexmapr2-input || exit 1;
    ln -sf '/tool/tool-data/cfsan_lexmapr2/0/lexmapr' .;
    ln -sf '$input' './lexmapr2-input/$input.name';
    python $__tool_directory__/lexmapr2.py
    #if ($embl_ont != ""):
        -e $embl_ont
    #end if
    #if (str($no_ancestors) != "false"):
        $no_ancestors
    #end if
    #if (str($bins) != "false"):
        $bins
    #end if
    #if (str($full) != "false"):
        $full
    #end if
    #if (str($graph) != "false"):
        $graph
    #end if
    #if $input_json.json_is_set:
        -u "$input_json.upload"
    #end if
    -o lexmapr2_output.tsv
    ./lexmapr2-input/$input.name;
    mv 'lexmapr_run.log' 'lexmapr2_run_log.txt' || exit 1;
    ]]></command>
    <environment_variables>
        <environment_variable name="NLTK_DATA">/tool/tool-data/cfsan_lexmapr2/0/nltk_data</environment_variable>
        <environment_variable name="PYTHONPATH">/tool/tool-data/cfsan_lexmapr2/0</environment_variable>
    </environment_variables>
    <inputs>
        <param name="input" type="data" format="csv" label="Input CSV"
            help="First row should be a header and first column should be sample names" />
        <param name="embl_ont" type="text" optional="true" 
            label="User defined comma-separated EMBL Ontology short names" />
        <conditional name="input_json">
            <param name="json_is_set" type="boolean" label="Use User defined bins in JSON format?" />
            <when value="true">
                <param name="upload" type="data" format="json" label="User defined bins" />
            </when>
            <when value="false">
            </when>
        </conditional>
        <param name="bins" truevalue="-b" type="boolean" checked="true"
            label="Classify samples into default bins" help="Default: true"/>
        <param name="graph" truevalue="-g" type="boolean" checked="true"
            label="Visualize summary of mapping and binning" help="Default: true"/>
        <param name="full" truevalue="-f" type="boolean" checked="true"
            label="Generate full output format" help="Default: true"/>
        <param name="no_ancestors" truevalue="-a" type="boolean" checked="false"
            label="Remove ancestral terms from output" help="Default: false"/>
    </inputs>
    <outputs>
        <data name="lexmapr2_output" format="tsv" label="Lexmapr2: Results On ${on_string}" from_work_dir="lexmapr2_output.tsv"/>
        <collection name="plots" type="list" label="Lexmapr2: Plots on ${on_string}">
            <discover_datasets pattern="(?P&lt;designation&gt;.+)\.png" format="png" directory="lexmapr_figures"/>
        </collection>
        <data name="lexmapr2_log" format="txt" label="Lexmapr2: Log On ${on_string}" from_work_dir="lexmapr2_run_log.txt"/>
    </outputs>
    <tests>
        <test expect_num_outputs="2">
            <param name="input" value="test.csv"/>
        </test>
    </tests>
    <help><![CDATA[

.. class:: infomark

**Purpose**

Lexmapr2 is a fork of Lexmapr (https://github.com/cidgoh/LexMapr) with the following added functionalitites:

    ::

        - pull ontology accession ids and definitions from EMBL-EBI via the API
        - group mapped results by parent ontologies
        - visualize mapping results

----

.. class:: infomark

**Customization**

By default, the FOODON and NCBITaxon ontologies are used. Users can define a comma-delimited list of ontology short names (https://www.ebi.ac.uk/ols/ontologies) flagged with '-e'. Bins are used to categorize matched ontologies by their parent ontologies. Users can override the default bins by flagging a JSON file with the '-u' option.

Example JSON format to use a bin titled 'ncbi_taxon':

    ::

        {
            "ncbi_taxon":{
                "Actinopterygii":"NCBITaxon_7898",
                "Ecdysozoa":"NCBITaxon_1206794",
                "Echinodermata":"NCBITaxon_7586",
                "Fungi":"NCBITaxon_4751",
                "Mammalia":"NCBITaxon_40674",
                "Sauropsida":"NCBITaxon_8457",
                "Spiralia":"NCBITaxon_2697495",
                "Viridiplantae":"NCBITaxon_33090"
            }
        }

----

.. class:: infomark

**Outputs**

The main output files are:

    ::

        - An tab-seperated file with possible matched annotations.
        - A list of Lexmapr2 figures in PNG format.

  ]]></help>
    <citations>
        <citation type="bibtex">
            @misc{github,
            author = {Penn, Kayla},
            year = {2022},
            title = {LexMapr2},
            publisher = {GitHub},
            journal = {GitHub repository},
            url = {https://github.com/CFSAN-Biostatistics/LexMapr2}}
        </citation>
        <citation type="bibtex">
            @misc{GalaxyToolWrapper,
            author = {Konganti, Kranti},
            year = {2022},
            title = {Lexmapr2 Tool Wrapper for Galaxy},
            journal = {GalaxyTrakr Tool repository},
            url = {https://toolrepo.galaxytrakr.org/repository/browse_repository?id=e00d4fc8bba8b6c5}}
        </citation>
    </citations>
</tool>