view nanoplot.xml @ 9:a38bdcec9e4c draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/nanoplot/ commit 05ce3d2300557dd40f5faa8f25c2b26f00c7fdb2
author iuc
date Fri, 16 Aug 2024 09:00:22 +0000
parents a02b8b3f5a0c
children
line wrap: on
line source

<tool id="nanoplot" name="NanoPlot" version="@TOOL_VERSION@+galaxy0" profile="22.05">
    <description>Plotting suite for Oxford Nanopore sequencing data and alignments</description>
    <macros>
        <token name="@TOOL_VERSION@">1.43.0</token>
    </macros>
    <xrefs>
        <xref type="bio.tools">nanoplot</xref>
    </xrefs>
    <requirements>
        <requirement type="package" version="@TOOL_VERSION@">nanoplot</requirement>
    </requirements>
    <!--stdio>
        Not needed anymore, because we do not generate the static PNGs anymore.
        I will leave this in, in the case we activate the PNGs at some point again.
        <regex match="kaleido problem" source="stderr" level="fatal" description="No static plots are saved due to some kaleido problem"/>
    </stdio-->
    <version_command>NanoPlot --version</version_command>
    <command detect_errors="exit_code"><![CDATA[
#set $myfiles = $mode.reads.files if $mode.choice == 'combined' else [$mode.reads.files]
#set reads_temp = []
#for $i, $f in enumerate($myfiles)
    #if $f.ext.startswith("fastq"):
       #set $extension = "fastq" if "." not in $f.ext else "fastq.%s" % $f.ext.split(".")[-1]
    #else
        #set $extension = $f.ext
    #end if
    ln -s '$f' './read_${i}.$extension' &&
    #if $extension == "bam"
        ln -s '$f.metadata.bam_index' './read_${i}.${extension}.bai' &&
    #end if
    $reads_temp.append("read_" + str($i) + "." + str($extension))
#end for

NanoPlot
    --threads \${GALAXY_SLOTS:-4}
    --tsv_stats
    --no_static
    --$mode.reads.type ${' '.join($reads_temp)}
    #if $filter.maxlength
        --maxlength $filter.maxlength
    #end if
    #if $filter.minlength
        --minlength $filter.minlength
    #end if
    #if $filter.downsample
        --downsample $filter.downsample
    #end if
    #if $filter.minqual
        --minqual $filter.minqual
    #end if
    #if $filter.runtime_until
        -- $filter.runtime_until
    #end if
    #if $filter.readtype
        --readtype $filter.readtype
    #end if
    #if $customization.color
        --color $customization.color
    #end if
    #if $customization.plots
        --plots ${str($customization.plots).replace(',', ' ')}
    #end if
    $filter.drop_outliers
    $filter.loglength
    $filter.percentqual
    $filter.alength
    $filter.barcoded
    $filter.no_supplementary
    $customization.N50
    -o '.'
    && >&2 cat *log
    ]]></command>
    <inputs>
        <conditional name="mode">
            <param name="choice" type="select" label="Select multifile mode" help="When supplying multiple files, batch mode will run NanoPlot on each file separately, while combined mode will run NanoPlot once on all the reads together. When only supplying a single input file, this setting does not matter.">
                <option value="batch" selected="true">batch</option>
                <option value="combined">combined</option>
            </param>
            <when value="batch">
                <conditional name="reads">
                    <param name="type" type="select" label="Type of the file(s) to work on">
                        <option value="fastq" selected="true">fastq</option>
                        <option value="fasta">fasta</option>
                        <option value="fastq_rich">fastq_rich</option>
                        <option value="fastq_minimal">fastq_minimal</option>
                        <option value="summary">summary</option>
                        <option value="bam">bam</option>
                        <option value="cram">cram</option>
                    </param>
                    <when value="fastq">
                        <param type="data" argument="--fastq" name="files" format="fastq,fastq.gz,fastq.bz2,vcf_bgzip"/>
                    </when>
                    <when value="fasta">
                        <param type="data" argument="--fasta" name="files" format="fasta,fasta.gz,vcf_bgzip"/>
                    </when>
                    <when value="fastq_rich">
                        <param type="data" argument="--fastq_rich" name="files" format="fastq,fastq.gz,fastq.bz2,vcf_bgzip"/>
                    </when>
                    <when value="fastq_minimal">
                        <param type="data" argument="--fastq_minimal" name="files" format="fastq,fastq.gz,fastq.bz2,vcf_bgzip"/>
                    </when>
                    <when value="summary">
                        <param type="data" argument="--summary" name="files" format="txt,zip"/>
                    </when>
                    <when value="bam">
                        <param type="data" argument="--bam" name="files" format="bam"/>
                    </when>
                    <when value="cram">
                        <param type="data" argument="--cram" name="files" format="cram"/>
                    </when>
                </conditional>
            </when>
            <when value="combined">
                <conditional name="reads">
                    <param name="type" type="select" label="Type of the file(s) to work on">
                        <option value="fastq" selected="true">fastq</option>
                        <option value="fasta">fasta</option>
                        <option value="fastq_rich">fastq_rich</option>
                        <option value="fastq_minimal">fastq_minimal</option>
                        <option value="summary">summary</option>
                        <option value="bam">bam</option>
                        <option value="cram">cram</option>
                    </param>
                    <when value="fastq">
                        <param type="data" argument="--fastq" name="files" format="fastq,fastq.gz,fastq.bz2,vcf_bgzip" multiple="true"/>
                    </when>
                    <when value="fasta">
                        <param type="data" argument="--fasta" name="files" format="fasta,fasta.gz,vcf_bgzip" multiple="true"/>
                    </when>
                    <when value="fastq_rich">
                        <param type="data" argument="--fastq_rich" name="files" format="fastq,fastq.gz,fastq.bz2,vcf_bgzip" multiple="true"/>
                    </when>
                    <when value="fastq_minimal">
                        <param type="data" argument="--fastq_minimal" name="files" format="fastq,fastq.gz,fastq.bz2,vcf_bgzip" multiple="true"/>
                    </when>
                    <when value="summary">
                        <param type="data" argument="--summary" name="files" format="txt,zip" multiple="true"/>
                    </when>
                    <when value="bam">
                        <param type="data" argument="--bam" name="files" format="bam" multiple="true"/>
                    </when>
                    <when value="cram">
                        <param type="data" argument="--cram" name="files" format="cram" multiple="true"/>
                    </when>
                </conditional>
            </when>
        </conditional>
        <section name="filter" title="Options for filtering or transforming input prior to plotting" expanded="false">
            <param argument="--maxlength" type="integer" optional="true" label="Drop reads longer than length specified."/>
            <param argument="--minlength" type="integer" optional="true" label="Drop reads shorter than length specified."/>
            <param argument="--drop_outliers" type="boolean" truevalue="--drop_outliers" falsevalue="" label="Drop outlier reads with extreme long length."/>
            <param argument="--downsample" type="integer" optional="true" label="Reduce dataset to N reads by random sampling."/>
            <param argument="--loglength" type="boolean" truevalue="--loglength" falsevalue="" label="Logarithmic scaling of lengths in plots."/>
            <param argument="--percentqual" type="boolean" truevalue="--percentqual" falsevalue="" label="Use qualities as theoretical percent identities."/>
            <param argument="--alength" type="boolean" truevalue="--alength" falsevalue="" label="Use aligned read lengths rather than sequenced length (bam mode)."/>
            <param argument="--minqual" type="integer" optional="true" label="Drop reads with an average quality lower than specified."/>
            <param argument="--runtime_until" type="integer" optional="true" label="Only take the N first hours of a run"/>
            <param argument="--readtype" type="select" optional="true" label="Which read type to extract information about from summary.">
                <option value="1D">1D</option>
                <option value="2D">2D</option>
                <option value="1D2">1D2</option>
            </param>
            <param argument="--barcoded" type="boolean" truevalue="--barcoded" falsevalue="" label="Use if you want to split the summary file by barcode."/>
            <param argument="--no_supplementary" type="boolean" truevalue="--no_supplementary" falsevalue="" label="Use if you want to remove supplementary alignments"/>
        </section>
        <section name="customization" title="Options for customizing the plots created" expanded="false">
            <param type="select" argument="--color" optional="true" label="Specify a color for the plots.">
                <option value="aliceblue">aliceblue</option>
                <option value="antiquewhite">antiquewhite</option>
                <option value="aqua">aqua</option>
                <option value="aquamarine">aquamarine</option>
                <option value="azure">azure</option>
                <option value="beige">beige</option>
                <option value="bisque">bisque</option>
                <option value="black">black</option>
                <option value="blanchedalmond">blanchedalmond</option>
                <option value="blue">blue</option>
                <option value="blueviolet">blueviolet</option>
                <option value="brown">brown</option>
                <option value="burlywood">burlywood</option>
                <option value="cadetblue">cadetblue</option>
                <option value="chartreuse">chartreuse</option>
                <option value="chocolate">chocolate</option>
                <option value="coral">coral</option>
                <option value="cornflowerblue">cornflowerblue</option>
                <option value="cornsilk">cornsilk</option>
                <option value="crimson">crimson</option>
                <option value="cyan">cyan</option>
                <option value="darkblue">darkblue</option>
                <option value="darkcyan">darkcyan</option>
                <option value="darkgoldenrod">darkgoldenrod</option>
                <option value="darkgray">darkgray</option>
                <option value="darkgreen">darkgreen</option>
                <option value="darkgrey">darkgrey</option>
                <option value="darkkhaki">darkkhaki</option>
                <option value="darkmagenta">darkmagenta</option>
                <option value="darkolivegreen">darkolivegreen</option>
                <option value="darkorange">darkorange</option>
                <option value="darkorchid">darkorchid</option>
                <option value="darkred">darkred</option>
                <option value="darksalmon">darksalmon</option>
                <option value="darkseagreen">darkseagreen</option>
                <option value="darkslateblue">darkslateblue</option>
                <option value="darkslategray">darkslategray</option>
                <option value="darkslategrey">darkslategrey</option>
                <option value="darkturquoise">darkturquoise</option>
                <option value="darkviolet">darkviolet</option>
                <option value="deeppink">deeppink</option>
                <option value="deepskyblue">deepskyblue</option>
                <option value="dimgray">dimgray</option>
                <option value="dimgrey">dimgrey</option>
                <option value="dodgerblue">dodgerblue</option>
                <option value="firebrick">firebrick</option>
                <option value="floralwhite">floralwhite</option>
                <option value="forestgreen">forestgreen</option>
                <option value="fuchsia">fuchsia</option>
                <option value="gainsboro">gainsboro</option>
                <option value="ghostwhite">ghostwhite</option>
                <option value="goldenrod">goldenrod</option>
                <option value="gold">gold</option>
                <option value="gray">gray</option>
                <option value="green">green</option>
                <option value="greenyellow">greenyellow</option>
                <option value="grey">grey</option>
                <option value="honeydew">honeydew</option>
                <option value="hotpink">hotpink</option>
                <option value="indianred">indianred</option>
                <option value="indigo">indigo</option>
                <option value="ivory">ivory</option>
                <option value="khaki">khaki</option>
                <option value="lavenderblush">lavenderblush</option>
                <option value="lavender">lavender</option>
                <option value="lawngreen">lawngreen</option>
                <option value="lemonchiffon">lemonchiffon</option>
                <option value="lightblue">lightblue</option>
                <option value="lightcoral">lightcoral</option>
                <option value="lightcyan">lightcyan</option>
                <option value="lightgoldenrodyellow">lightgoldenrodyellow</option>
                <option value="lightgray">lightgray</option>
                <option value="lightgreen">lightgreen</option>
                <option value="lightgrey">lightgrey</option>
                <option value="lightpink">lightpink</option>
                <option value="lightsalmon">lightsalmon</option>
                <option value="lightseagreen">lightseagreen</option>
                <option value="lightskyblue">lightskyblue</option>
                <option value="lightslategray">lightslategray</option>
                <option value="lightslategrey">lightslategrey</option>
                <option value="lightsteelblue">lightsteelblue</option>
                <option value="lightyellow">lightyellow</option>
                <option value="limegreen">limegreen</option>
                <option value="lime">lime</option>
                <option value="linen">linen</option>
                <option value="magenta">magenta</option>
                <option value="maroon">maroon</option>
                <option value="mediumaquamarine">mediumaquamarine</option>
                <option value="mediumblue">mediumblue</option>
                <option value="mediumorchid">mediumorchid</option>
                <option value="mediumpurple">mediumpurple</option>
                <option value="mediumseagreen">mediumseagreen</option>
                <option value="mediumslateblue">mediumslateblue</option>
                <option value="mediumspringgreen">mediumspringgreen</option>
                <option value="mediumturquoise">mediumturquoise</option>
                <option value="mediumvioletred">mediumvioletred</option>
                <option value="midnightblue">midnightblue</option>
                <option value="mintcream">mintcream</option>
                <option value="mistyrose">mistyrose</option>
                <option value="moccasin">moccasin</option>
                <option value="navajowhite">navajowhite</option>
                <option value="navy">navy</option>
                <option value="oldlace">oldlace</option>
                <option value="olivedrab">olivedrab</option>
                <option value="olive">olive</option>
                <option value="orange">orange</option>
                <option value="orangered">orangered</option>
                <option value="orchid">orchid</option>
                <option value="palegoldenrod">palegoldenrod</option>
                <option value="palegreen">palegreen</option>
                <option value="paleturquoise">paleturquoise</option>
                <option value="palevioletred">palevioletred</option>
                <option value="papayawhip">papayawhip</option>
                <option value="peachpuff">peachpuff</option>
                <option value="peru">peru</option>
                <option value="pink">pink</option>
                <option value="plum">plum</option>
                <option value="powderblue">powderblue</option>
                <option value="purple">purple</option>
                <option value="rebeccapurple">rebeccapurple</option>
                <option value="red">red</option>
                <option value="rosybrown">rosybrown</option>
                <option value="royalblue">royalblue</option>
                <option value="saddlebrown">saddlebrown</option>
                <option value="salmon">salmon</option>
                <option value="sandybrown">sandybrown</option>
                <option value="seagreen">seagreen</option>
                <option value="seashell">seashell</option>
                <option value="sienna">sienna</option>
                <option value="silver">silver</option>
                <option value="skyblue">skyblue</option>
                <option value="slateblue">slateblue</option>
                <option value="slategray">slategray</option>
                <option value="slategrey">slategrey</option>
                <option value="snow">snow</option>
                <option value="springgreen">springgreen</option>
                <option value="steelblue">steelblue</option>
                <option value="tan">tan</option>
                <option value="teal">teal</option>
                <option value="thistle">thistle</option>
                <option value="tomato">tomato</option>
                <option value="turquoise">turquoise</option>
                <option value="violet">violet</option>
                <option value="wheat">wheat</option>
                <option value="whitesmoke">whitesmoke</option>
                <option value="white">white</option>
                <option value="yellowgreen">yellowgreen</option>
                <option value="yellow">yellow</option>
            </param>
            <param type="select" argument="--plots" optional="true" multiple="true" display="checkboxes" label="Specify the bivariate format of the plots.">
                <option value="kde">kernel density estimation (kde)</option>
                <option value="dot">dots (dot)</option>
            </param>
            <param type="boolean" argument="--N50" truevalue="--N50" falsevalue="" label="Show the N50 mark in the read length histogram."/>
        </section>
    </inputs>
    <outputs>
        <data name="output_html" format="html" from_work_dir="NanoPlot-report.html" label="${tool.name} on ${on_string}: HTML report"/>
        <data name="nanostats" format="tabular" from_work_dir="NanoStats.txt" label="${tool.name} on ${on_string}: NanoStats"/>
        <data name="nanostats_post_filtering" format="tabular" from_work_dir="NanoStats_post_filtering.txt" label="${tool.name} on ${on_string}: NanoStats post filtering"/>
        <!-- https://github.com/wdecoster/NanoPlot/issues/352 generating PNGs can take much much longer to process. Not sure if this output is relevant at all -->
        <!--data name="read_length" format="png" from_work_dir="Non_weightedHistogramReadlength.png" label="${tool.name} on ${on_string}: Histogram Read Length"/>
        <data name="log_read_length" format="png" from_work_dir="Non_weightedLogTransformed_HistogramReadlength.png" label="${tool.name} on ${on_string}: Log Transformed Histogram Read Length"/-->
    </outputs>
    <tests>
        <test>
            <conditional name="mode">
                <param name="choice" value="batch"/>
                <conditional name="reads">
                    <param name="type" value="fastq_rich"/>
                    <param name="files" value="reads.fastq.gz" ftype="fastqsanger.gz"/>
                </conditional>
            </conditional>
            <section name="filter">
                <param name="downsample" value="800"/>
            </section>
            <section name="customization">
                <param name="plots" value="kde"/>
            </section>
            <output name="output_html" ftype="html">
                <assert_contents>
                    <has_text text="html"/>
                    <has_text text="mean_qual"/>
                </assert_contents>
            </output>
            <output name="nanostats" file="NanoStats.txt" ftype="tabular"/>
            <output name="nanostats_post_filtering" file="NanoStats_post_filtering.txt" ftype="tabular"/>
        </test>
        <test>
            <conditional name="mode">
                <param name="choice" value="combined"/>
                <conditional name="reads">
                    <param name="type" value="bam"/>
                    <param name="files" value="alignment.bam" ftype="bam"/>
                </conditional>
            </conditional>
            <section name="filter">
                <param name="maxlength" value="2000"/>
                <param name="minlenght" value="1000"/>
            </section>
            <section name="customization">
                <param name="color" value="yellow"/>
            </section>
            <output name="output_html" ftype="html">
                <assert_contents>
                    <has_text text="html"/>
                    <has_text text="Aligned read length vs Percent identity plot using dots"/>
                    <!-- bam report specific -->
                </assert_contents>
            </output>
        </test>
        <test>
            <!-- test with multiple input files -->
            <conditional name="mode">
                <param name="choice" value="combined"/>
                <conditional name="reads">
                    <param name="type" value="fasta"/>
                    <param name="files" ftype="fasta" value="reads1.fasta,reads2.fasta"/>
                </conditional>
            </conditional>
            <output name="output_html" ftype="html">
                <assert_contents>
                    <has_text text="html"/>
                    <not_has_text text="Aligned read length vs Percent identity plot using dots"/>
                    <has_text text="&lt;td&gt;9&lt;/td&gt;"/>
                    <!--check both files were used 4+5 reads -->
                </assert_contents>
            </output>
        </test>
    </tests>
    <help>
        <![CDATA[
        **What it does**

        NanoPlot_ is a plotting tool for long read sequencing data and alignments written by `Wouter De Coster`_

        .. _NanoPlot: https://github.com/wdecoster/NanoPlot
        .. _`Wouter De Coster`: https://github.com/wdecoster

        **Input**

        NanoPlot requires 1 or more files as input. They can either be fastq (can be generated
        by albacore, guppy or MinKNOW containing additional information), fasta, sorted bam,
        sorted cram or sequencing summary.

        **Output**

        NanoPlot produces different number of plots depending on the data and customizations.
        A detailed view can be seen on here_. Additionally a file showing the statistics
        is generated.

        .. _here: https://github.com/wdecoster/NanoPlot#plots-generated
    ]]>
    </help>
    <citations>
        <citation type="bibtex">
            @misc{githubnanoplot, author = {De Coster, Wouter}, year = {2018}, title =
            {NanoPlot}, publisher = {GitHub}, journal = {GitHub repository}, url =
            {https://github.com/wdecoster/NanoPlot}, }</citation>
        <citation type="doi">10.1093/bioinformatics/bty149</citation>
    </citations>
</tool>