view processing_short_reads_macros.xml @ 2:76ff9af5c0a3 draft default tip

planemo upload for repository https://github.com/geraldinepascal/FROGS-wrappers/ commit 0e987ae3594883fb3b12d2999c6ad7fccd0b1b64
author frogs
date Fri, 06 Feb 2026 22:05:51 +0000
parents cd7675c5b15a
children
line wrap: on
line source

<?xml version="1.0"?>
<macros>
    <token name="@PROCESSING_SHORT_READS_CMD_LINE@">
        #set $sep = ' '

        reads_processing.py illumina 
            @CPUS@

            ## PAIRED END READS
            #if $fastq_input.input_type == "paired"
                ## INPUTS
                #if $fastq_input.input_files.file_type == "archive"
                    --input-archive '${fastq_input.input_files.input_archive}'
                #else
                    --samples-names 
                    #for $current in $fastq_input.input_files.samples
                        $sep'${current.samples_names.strip()}'
                    #end for
                    --input-R1 
                    #for $current in $fastq_input.input_files.samples
                        $sep'${current.input_R1}'
                    #end for
                    --input-R2
                    #for $current in $fastq_input.input_files.samples
                        $sep'${current.input_R2}'
                    #end for
                #end if

                ## MERGING PARAMETERS
                --R1-size $fastq_input.R1_size
                --R2-size $fastq_input.R2_size
                --mismatch-rate $fastq_input.mismatch_rate
                --merge-software $fastq_input.merge_software_type.merge_software
                #if $fastq_input.merge_software_type.merge_software == "flash"
                    --expected-amplicon-size $fastq_input.merge_software_type.expected_amplicon_size
                #end if
                #if $fastq_input.keep_unmerged
                    --keep-unmerged
                #end if

            ## SINGLE END READS
            #elif $fastq_input.input_type == "single"
                --already-contiged
                ## INPUTS
                #if $fastq_input.input_files.file_type == "archive"
                    --input-archive '${fastq_input.input_files.input_archive}'
                #else
                    --samples-names 
                    #for $current in $fastq_input.input_files.samples
                        $sep'${current.samples_names.strip()}'
                    #end for
                    --input-R1 
                    #for $current in $fastq_input.input_files.samples
                        $sep'${current.input_R1}'
                    #end for
                #end if
            #end if

            ## AMPLICON PARAMETERS
            --min-amplicon-size $min_amplicon_size
            --max-amplicon-size $max_amplicon_size

            ## PRIMERS
            #if $is_primer_in_seq.primer_choice == "true"
                --five-prim-primer '$is_primer_in_seq.five_prim_primer'
                --three-prim-primer '$is_primer_in_seq.three_prim_primer'
            #else
                --without-primers
            #end if

            ## PROCESS TYPE
            #if $process_type.process == "Preprocess only"
                --process preprocess-only
            #elif $process_type.process == "Clustering Swarm"
                --process swarm
                --distance $process_type.distance
                #if $process_type.cluster_improvements.clustering_options != "no-refinement"
                    $process_type.cluster_improvements.clustering_options
                #end if
            #elif $process_type.process == "Denoising DADA2"
                --process dada2
                --sample-inference $process_type.sample_inference
            #end if

            ## OUTPUTS
            --output-biom $output_biom 
            --output-fasta $output_fasta
            --html $html
            #if $process_type.process == "Clustering Swarm"
                --output-compo $output_cluster_compo
            #end if
    </token>

    <xml name="processing_short_reads_inputs">
       <!-- Files -->
        <conditional name="fastq_input">
	      	<param name="input_type" type="select" display="radio" label="Paired-end or Single-end reads" help="">
                <option value="paired" selected="true">Paired-end reads</option>
	      		<option value="single">Single-end reads or Paired reads that have already been merged.</option>
	        </param>
	      	<when value="paired">
                <conditional name="input_files">
                    <param name="file_type" type="select" label="Input" help="Sample files can be provided either as a single TAR archive or as separate files per sample (one or two files each).">
                        <option value="archive" selected="true">TAR Archive</option>
                        <option value="files_per_sample" >Files per sample</option>
                    </param>
                    <when value="archive">
                        <param argument="--input-archive" type="data" format="tar,tgz" label="Archive file (.tar.gz)" help="The TAR file containing the short R1 R2 read pairs (.fastq.gz) for each sample. Each sample should ideally have its R1 and R2 reads named consistently (e.g., sampleX_R1.fastq.gz and sampleX_R2.fastq.gz). Supported sequencers: Illumina, Aviti and IonTorrent." />
                    </when>
                    <when value="files_per_sample">
                        <repeat name="samples" title="Samples" default="1" min="1">
                            <param argument="--samples-names" type="text" label="Sample name" help="The sample name.">
                                <expand macro="restricted_sanitizer_validator"/>
                            </param>
                            <param argument="--input-R1" type="data" format="fastq" label="R1 reads (.fastq.gz)" help="R1 reads fastq file. Supported sequencers: Illumina and Aviti." />
                            <param argument="--input-R2" type="data" format="fastq" label="R2 reads (.fastq.gz)" help="R2 reads fastq file. Supported sequencers: Illumina and Aviti."  />
                        </repeat>
                    </when>
                </conditional>
                <!-- Paired parameters -->
                <param argument="--R1-size" value="300" type="integer" label="R1 read length" help="Please provide the maximum length of the R1 reads." />
                <param argument="--R2-size" value="300" type="integer" label="R2 read length" help="Please provide the maximum length of the R2 reads." />
                <param argument="--mismatch-rate" type="float" value="0.1" label="Mismatch rate (used for R1-R2 merging)" help="Maximum allowed mismatch rate in the overlap region between R1 and R2 reads."/>
                <conditional name="merge_software_type">
                    <param argument="--merge-software" type="select" display="radio" label="Paired-end merging tool" help="Select the tool used to merge paired-end reads">
                        <!-- <option value="pear" >Pear (only for non commercial, non military use. See Pear licence)</option> -->
                        <option value="vsearch" >Vsearch</option>
                        <option value="flash">Flash</option>
                    </param>
                    <when value="vsearch"/>
                    <when value="flash">
                        <param argument="--expected-amplicon-size" type="integer" min="0" value="450" label="Expected amplicon length" help="Specify the maximum expected amplicon length (covers ~90% of amplicons)" />
                    </when>
                </conditional>
                <param argument="keep_unmerged" type="boolean" truevalue="--keep-unmerged" falsevalue="" checked="false" label="Would you like to keep unmerged reads?" help="No = unmerged reads will be removed; Yes = unmerged reads will be artificially combined with 100 N to allow further processing." />
            </when>
            <when value="single">
                <conditional name="input_files">
                    <param name="file_type" type="select" label="Input" help="Sample files can be provided either as a single TAR archive or as separate files per sample (one or two files each).">
                        <option value="archive" selected="true">TAR Archive</option>
                        <option value="files_per_sample" >Files per sample</option>
                    </param>
                    <when value="archive">
                        <param argument="--input-archive" type="data" format="tar,tgz" label="Archive file (tar format)" help="The TAR file containing the short single-end reads or merged paired-end reads (.fastq.gz) for each sample. Supported sequencers: Illumina and Aviti." />
                    </when>
                    <when value="files_per_sample">
                        <repeat name="samples" title="Samples" default="1" min="1">
                            <param argument="--samples-names" type="text" label="Name" help="The sample name.">
                                <expand macro="restricted_sanitizer_validator"/>
                            </param>
                            <param argument="--input-R1" type="data" format="fastq" label="The short single-end reads or merged paired-end reads (.fastq.gz)" help="Single-end short reads or merge paired-end reads (.fastq.gz). Supported sequencers: Illumina and Aviti." />
                        </repeat>
                    </when>
                </conditional>
            </when>
        </conditional>

        <!-- Amplicons Parameters-->
        <param argument="--min-amplicon-size" type="integer" value="350" label="Minimum amplicon length" help="The minimum length of the amplicons (including primers). For paired-end reads, substract 10 bases to account for the minimum overlap between R1 and R2 reads."/>
        <param argument="--max-amplicon-size" type="integer" value="500" label="Maximum amplicon length" help="The maximum length of the amplicons (including primers). For paired-end reads, substract 10 bases to account for the minimum overlap between R1 and R2 reads."/>

        <!-- Primers -->
        <conditional name="is_primer_in_seq">
            <param name="primer_choice" type="select" display="radio" label="Do the sequences include PCR primers?" help="Indicate whether the sequences still include PCR primers. Select “Yes” if primers are present, “No” if they have already been removed." >
                <option value="true" selected="true">Yes</option>
                <option value="false">No</option>     
            </param>
            <when value="true">
                <param argument="--five-prim-primer" type="text" value="" optional="true" label="5' primer" help="Enter the 5' primer sequence. Wildcards are allowed. The sequence must be provided in 5' → 3' orientation.">
                    <expand macro="only_letter_sanitizer_validator"/>
                </param>
                <param argument="--three-prim-primer" type="text" value="" optional="true" label="3' primer" help="Enter the 3' primer sequence. Wildcards are allowed. The sequence must be provided in 5' → 3' orientation.">
                     <expand macro="only_letter_sanitizer_validator"/>
                </param>
            </when>
            <when value="false"/>
        </conditional>

        <!-- Preprocessing only, clustering or denoising -->
         <conditional name="process_type">
            <param argument="--process" type="select" display="radio" label="Process type" help="Select the type of process to run">
                <option value="Preprocess only">Preprocessing only</option>
                <option value="Clustering Swarm" selected="true">Preprocessing and clustering with Swarm</option>
                <option value="Denoising DADA2">Preprocessing and denoising with DADA2</option>
            </param>
            <when value="Preprocess only"/>
            <when value="Clustering Swarm">
                <param argument="--distance" type="integer" min="1" value="1" optional="false" label="Swarm distance threshold" help="Distance threshold used by Swarm for clustering."/>
                <conditional name="cluster_improvements">
                    <param name="clustering_options" type="select" display="radio" label="Clustering refinement" help="(i) With --distance = 1, use the Swarm --fastidious option to refine clustering (recommended since FROGS 3.2). (ii) With --distance > 1, enable pre-clustering to reduce redundancy before final clustering step. (iii) Select this option to apply neither refinement nor pre-clustering.">
                        <option value="--fastidious" selected="true">With --distance = 1, refine clusters with Swarm --fastidious option (recommended since FROGS 3.2)</option>
                        <option value="--pre-clustering">With --distance > 1, perform a pre-clustering step with FROGS --pre-clustering option</option>
                        <option value="no-refinement">No clustering refinement</option>
                    </param>
                    <when value="--fastidious"/>
                    <when value="--pre-clustering"/>
                    <when value="no-refinement"/>
                </conditional>
            </when>
            <when value="Denoising DADA2">
                <param argument="--sample-inference" type="select" display="radio" label="DADA2 pooling method" help="Choose how to consider sample prior to sample inference">
                    <option value="pseudo-pooling" selected="true">Pseudo pooling, samples will be pseudo-pooled prior to sample inference.</option>
                    <option value="independent">Independent, sample inference will be performed on each sample individually.</option>
                    <option value="pooling">Full pooling, all samples will be pooled together prior to sample inference.</option>
                </param>
            </when>
        </conditional>
    </xml>

    <!-- Test swarm -->
    <xml name="swarm_processing_short_reads_test_input">
        <!-- Files -->
        <conditional name="fastq_input">
            <param name="input_type" value="paired" />
            <conditional name="input_files">
                <param name="file_type" value="archive" />
                <param name="input_archive" ftype="tgz" value="input/test_dataset.tar.gz" />
            </conditional>
            <!-- Paired parameters -->
            <param name="R1_size" value="266" />
            <param name="R2_size" value="267"/>
            <param name="mismatch_rate" value="0.15"/>
        </conditional>

        <!-- Amplicons Parameters-->
        <param name="min_amplicon_size" value="44"/>
        <param name="max_amplicon_size" value="490"/>

        <!-- Primers -->
        <conditional name="is_primer_in_seq">
            <param name="primer_choice" value="true" />
            <param name="five_prim_primer" value="GGCGVACGGGTGAGTAA" />
            <param name="three_prim_primer" value="GTGCCAGCNGCNGCGG"/>
        </conditional>
        
        <!-- Preprocessing only, clustering or denoising -->
        <conditional name="process_type">
            <param name="process" value="Clustering Swarm" />
        </conditional>
    </xml>

    <xml name="swarm_processing_short_reads_test_output">
        <output name="output_biom" file="references/01-reads_processing-swarm-vsearch.biom" compare="sim_size" delta="0" />
        <output name="output_fasta" file="references/01-reads_processing-swarm-vsearch.fasta" compare="diff" lines_diff="0" />
        <output name="output_cluster_compo" file="references/01-reads_processing-swarm-vsearch_compo.tsv" compare="diff" lines_diff="0" />
        <output name="html" file="references/01-reads_processing-swarm-vsearch.html" compare="diff" lines_diff="0" />
    </xml>

    <!-- Test dada2 -->
    <xml name="dada2_processing_short_reads_test_input">
        <!-- Files -->
        <conditional name="fastq_input">
            <param name="input_type" value="paired" />
            <conditional name="input_files">
                <param name="file_type" value="archive" />
                <param name="input_archive" ftype="tgz" value="input/verysmallITS.tar.gz" />
            </conditional>
            <!-- Paired parameters -->
            <param name="R1_size" value="300" />
            <param name="R2_size" value="300"/>
            <param name="keep_unmerged" value="true" />
        </conditional>

        <!-- Amplicons Parameters-->
        <param name="min_amplicon_size" value="50"/>
        <param name="max_amplicon_size" value="1000"/>

        <!-- Primers -->
        <conditional name="is_primer_in_seq">
            <param name="primer_choice" value="true" />
            <param name="five_prim_primer" value="TAGACTCGTCAHCGATGAAGAACGYRG" />
            <param name="three_prim_primer" value="GCATATCAATAAGCGSAGGAA"/>
        </conditional>
        
        <!-- Preprocessing only, clustering or denoising -->
        <conditional name="process_type">
            <param name="process" value="Denoising DADA2" />
        </conditional>
    </xml>

    <xml name="dada2_processing_short_reads_test_output">
        <output name="output_biom" file="references/01-reads_processing-dada2-clusters.biom" compare="sim_size" delta="0" />
        <output name="output_fasta" file="references/01-reads_processing-dada2-clusters.fasta" compare="diff" lines_diff="0" />
        <output name="html" file="references/01-reads_processing-dada2.html" compare="diff" lines_diff="0" />
    </xml>
</macros>