view nanocomp.xml @ 3:8b2f1e817c9d draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/nanocomp commit 69a2f2135f021f6e7bc35bce7b4954d2779efc07
author iuc
date Fri, 12 Dec 2025 08:20:02 +0000
parents 0670dca750f7
children
line wrap: on
line source

<tool id="nanocomp" name="NanoComp" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="23.2">
  <description>Compare multiple runs of long read sequencing data and alignments</description>
  <macros>
    <token name="@TOOL_VERSION@">1.25.6</token>
    <token name="@VERSION_SUFFIX@">1</token>
  </macros>
  <xrefs>
    <xref type="bio.tools">nanocomp</xref>
  </xrefs>
    <requirements>
      <requirement type="package" version="@TOOL_VERSION@">nanocomp</requirement>
    </requirements>
  <version_command>NanoComp -v</version_command>
  <command detect_errors="exit_code"><![CDATA[
 #import re

 ##link input files with proper names (Nanocomp checks file-extensions)
  #set $linked_files = []
  #for $file in $inputs.input_type.input_data
    #if '.' in str($file.name)
      #set $in_name = re.sub('[\-\:\s]', '_', str($file.name))
    #else
      #set $in_name = re.sub('[\-\:\s]', '_', str($file.name)) + "." + $file.ext
    #end if
    ln -sf '$file' '$in_name' &&
    #silent $linked_files.append($in_name)
  #end for

 ##run nanocomp
  NanoComp

  ##no need for the static images (becomes deprecated)
  --make_no_static

 ##Compute options
  --threads \${GALAXY_SLOTS:-4}

 ##add input files
  #if $inputs.input_type.input_type_selector == "fastq"
   --fastq
  #else if $inputs.input_type.input_type_selector == "fastq_r" 
   --fastq_rich
  #else if $inputs.input_type.input_type_selector == "fasta"
   --fasta
  #else if $inputs.input_type.input_type_selector == "bam"
   --bam
  #else if $inputs.input_type.input_type_selector == "ubam"
   --ubam
  #else if $inputs.input_type.input_type_selector == "cram"
   --cram
  #else if $inputs.input_type.input_type_selector == "pickle"
   --pickle
  #else if $inputs.input_type.input_type_selector == "arrow"
   --arrow
  #end if

  ## add the input files
  #for $file in $linked_files
    '$file'
  #end for

 ##Filter options
  #if $filters.maxlength
    --maxlength $filters.maxlength
  #end if
  #if $filters.minlength
    --minlength $filters.minlength
  #end if

 ##Plot options
  #if $plot_options.plot
    --plot $plot_options.plot 
  #end if

  #if $plot_options.title
    --title "$plot_options.title"
  #end if

  #if $plot_options.names
    --names $plot_options.names
  #end if

  #if $plot_options.colors
    --colors $plot_options.colors
  #end if

 ##Output options
  #if $output_options.tsv_stats
    $output_options.tsv_stats
  #end if

  --verbose 
  >& $out_log

]]></command>
  <inputs>
    <section name="inputs" title="Input data" expanded="True"> 
      <conditional name="input_type">
        <param name="input_type_selector" type="select" label="Choose Input Format and Files">
          <option value="fastq" selected="true">FASTQ files</option>
          <option value="fastq_r">FASTQ-rich files</option>
          <option value="fasta">FASTA files</option>
          <option value="bam">BAM files</option>
          <option value="ubam">uBAM files</option>
          <option value="cram">CRAM files</option>
          <option value="pickle">PICKLE files</option>
          <option value="arrow">ARROW files</option>
        </param>
        <when value="fastq">
          <param name="input_data" type="data" format="fastqsanger,fastqsanger.gz" multiple="true" label="FASTQ input files" help="Data is in (compressed) fastq format" />
        </when>
        <when value="fastq_r">
          <param name="input_data" type="data" format="fastqsanger,fastqsanger.gz" multiple="true" label="FASTQ input files" help="Data is in one or more fastq file(s) generated by MinKNOW or guppy with additional information concerning channel and time" />
        </when>
        <when value="fasta">
          <param name="input_data" type="data" format="fasta,fasta.gz" multiple="true" label="FASTA input files" help="Data is in (compressed) fasta format" />
        </when>
        <when value="bam">
          <param name="input_data" type="data" format="bam" multiple="true" label="BAM input files" help="Data is in sorted bam files." />
        </when>
        <when value="ubam">
          <param name="input_data" type="data" format="bam" multiple="true" label="Unmapped BAM input files" help="Data is in one or more unmapped bam files." />
        </when>
        <when value="cram">
          <param name="input_data" type="data" format="cram" multiple="true" label="CRAM input files" help="Data is in sorted cram files." />
        </when>
        <when value="pickle">
          <param name="input_data" type="data" format="binary" multiple="true" label="PICKLE input files" help="Data is in one or more pickle file(s) from using NanoComp/NanoPlot." />
        </when>
        <when value="arrow">
          <param name="input_data" type="data" format="binary" multiple="true" label="ARROW input files" help="Data is in one or more feather/arrow file(s)." />
        </when>
      </conditional>
    </section>  

    <section name="filters" title="Filtering Input Prior To Plotting" expanded="false">
      <param argument="--maxlength" type="integer" optional="true" label="Max read length filtering" help="Drop reads longer than length specified." />
      <param argument="--minlength" type="integer" optional="true" label="Min read length filtering" help="Drop reads shorter than length specified." />
    </section>

    <section name="plot_options" title="Plot Customization Options" expanded="false">
      <param argument="--plot" type="select" label="Plot Type" help="Specify the type of plot to be used.">
        <option value="box">Box plot</option>
        <option value="violin" selected="true">Violin plot</option>
        <option value="ridge">Ridge (joyplot) plot</option>
        <option value="not">No plot</option>
      </param>
      <param argument="--title" type="text" label="Custom plot titles" help="Add a title to all plots." />
      <param argument="--names" type="text" label="Custom names" help="Specify the names (space seperated, respective to input) to be used for the datasets." />
      <param argument="--colors" type="text" label="Custom colors" help="Specify the colors (space seperated, respective to input) to be used for each the datasets. Can be any valid Matplotlib color: Named, HEX-string, RGB, ... " />
    </section>  

    <section name="output_options" title="Output Options" expanded="false">
      <param argument="--tsv_stats" type="boolean" truevalue="--tsv_stats" falsevalue="" optional="true" checked="false" label="TSV Output Format" help="Output the statistics file as properly formatted TSV."/>
    </section>

  </inputs>

  <outputs>
    <data name="out_log" format="txt" label="${tool.name} on ${on_string}: Log file"/>
    <data name="stats_file" format="txt" from_work_dir="NanoStats.txt" label="${tool.name} on ${on_string}: Statistics file"/>  
    <data name="html_report" format="html" from_work_dir="NanoComp-report.html" label="${tool.name} on ${on_string}: Html Report"/>  
  </outputs>
  <tests>
    <!-- 1) fastq.gz input -->
    <test expect_num_outputs="3">
      <section name="inputs">
        <conditional name="input_type">  
          <param name="input_type_selector" value="fastq" />
          <param name="input_data" ftype="fastqsanger.gz" value="in1.fastq.gz,in2.fastq.gz,in3.fastq.gz" />
        </conditional>
      </section>
      <output name="stats_file" ftype="txt"> 
        <assert_contents>
          <has_text text="General summary" />
        </assert_contents>
      </output>
      <output name="html_report" ftype="html"> 
        <assert_contents>
          <has_text text="html"/>
          <has_text text="Summary statistics"/>
        </assert_contents>
      </output>
    </test>
    <!-- 2) bam input -->
    <test expect_num_outputs="3">
      <section name="inputs">
        <conditional name="input_type">
          <param name="input_type_selector" value="bam" />
          <param name="input_data" ftype="bam" value="in4.bam,in5.bam" />
        </conditional>
      </section>
      <section name="filters" >
        <param name="maxlength" value="15000"/>
        <param name="minlength" value="500"/>
      </section>
      <output name="html_report" ftype="html">
        <assert_contents>
          <has_text text="html"/>
          <has_text text="Summary statistics"/>
        </assert_contents>
      </output>
    </test>
    <!-- 3) fastq.gz input, tsv output -->
    <test expect_num_outputs="3">
      <section name="inputs">
        <conditional name="input_type">  
          <param name="input_type_selector" value="fastq" />
          <param name="input_data" ftype="fastqsanger.gz" value="in1.fastq.gz,in3.fastq.gz" />
        </conditional>
      </section>
      <section name="output_options">
        <param name="tsv_stats" value="true"/>
      </section>
      <output name="stats_file" ftype="txt"> 
      <assert_contents>
        <has_text text="Metrics" />
      </assert_contents>
      </output>
    </test>
    <!-- 4) bam input, box plot output -->
    <test expect_num_outputs="3">
      <section name="inputs">
        <conditional name="input_type">
          <param name="input_type_selector" value="bam" />
          <param name="input_data" ftype="bam" value="in4.bam,in5.bam" />
        </conditional>
      </section>
      <section name="plot_options" >
    <param name="plot" value="box"/>
      </section>
      <output name="html_report" ftype="html">
        <assert_contents>
          <has_text text="html"/>
          <has_text text="Plots"/>
        </assert_contents>
      </output>
    </test>
  </tests>
  <help><![CDATA[
**NanoComp** 

Compare multiple runs of long read sequencing data and alignments. Creates violin plots or box plots of length, quality and percent identity and creates dynamic, overlaying read length histograms and a cumulative yield plot.

**Usage Instructions**  

Multiple input files (of the same type) are allowed

**Output Files**  

HTML file with the stats report and associated plots

**More Information**  

- **Official Repository**: [GitHub - wdecoster/nanocomp](https://github.com/wdecoster/nanocomp)  
]]></help>
  <citations>
    <citation type="doi">10.1093/bioinformatics/btad311</citation>
  </citations>
</tool>