view artic_minion.xml @ 7:f5643712dca7 draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/artic commit e6a1f8250cdcbd279220f1ea9fcc11ac5a90df46"
author iuc
date Mon, 31 Jan 2022 10:12:30 +0000
parents f212134e204c
children 6f52ebc01098
line wrap: on
line source

<tool id="artic_minion" name="ARTIC minion" version="@PACKAGE_VERSION@+galaxy0" profile="20.09">
    <description>Build consensus sequence and call variants from amplicon-based nanopore sequence data</description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <xrefs>
        <xref type="bio.tools">artic</xref>
    </xrefs>
    <requirements>
        <requirement type="package" version="@PACKAGE_VERSION@">artic</requirement>
    </requirements>
    <command detect_errors="exit_code"><![CDATA[
        mkdir -p 'scheme/name/V1' &&
        #if str( $primer_scheme_source.primer_scheme_source_selector ) == "tool_data_table":
          ln -s '${primer_scheme_source.primer_scheme_bedfile.fields.path}' 'scheme/name/V1/name.scheme.bed' &&
        #else:
          ln -s '${primer_scheme_source.primer_scheme_bedfile}' 'scheme/name/V1/name.scheme.bed' &&
        #end if
        #if str( $reference_source.reference_source_selector ) == "history":
          ln -s '${reference_source.reference}' 'scheme/name/V1/name.reference.fasta' &&
          samtools faidx 'scheme/name/V1/name.reference.fasta' &&
        #else:
          ln -s '${reference_source.reference.fields.path}' 'scheme/name/V1/name.reference.fasta' &&
          samtools faidx 'scheme/name/V1/name.reference.fasta' &&
        #end if
        artic minion
            --threads \${GALAXY_SLOTS:-1}
        #if $normalise > 0:
            --normalise ${normalise}
        #end if
            --read-file '${read_file}'
            --scheme-directory 'scheme'
            --medaka
            --medaka-model '$medaka_model'
            $bwa
            'name/V1'
            ## enclose the sample name in extra single quotes because
            ## the minion pipeline script doesn't care about passing
            ## its arguments safely.
            "'"'${read_file.element_identifier}'"'"
        && bgzip -f '${read_file.element_identifier}.fail.vcf'
        ## remove enclosing single-quotes from header of output consensus fasta
        && sed -i "1s/'${read_file.element_identifier}'/${read_file.element_identifier}/" ${read_file.element_identifier}.consensus.fasta
    ]]></command>
    <inputs>
        <param argument="--read-file" type="data" format="fastq,fastqsanger,fastq.gz,fastqsanger.gz" label="Input Read File"/>
        <param argument="--normalise" type="integer" min="0" value="0"
        label="Coverage normalisation depth"
        help="Sample at most this number of reads per amplicon and strand. default=0 (use all reads)" />
        <param argument="--bwa" type="boolean" truevalue="--bwa" falsevalue="" label="Use bwa aligner"/>
        <conditional name="primer_scheme_source">
            <param name="primer_scheme_source_selector" type="select" label="Select a primer scheme from your history or use one from a tool data table?"
                   help="Screening files must be stored in the 'primer_scheme_bedfiles' tool data table">
                <option value="tool_data_table">From tool data table</option>
                <option value="history">From history</option>
            </param>
            <when value="tool_data_table">
                <param name="primer_scheme_bedfile" type="select" format="tabular" label="Primer Scheme">
	            <options from_data_table="primer_scheme_bedfiles">
	                <validator type="no_options" message="No primer scheme .bed files are available" />
                    </options>
	        </param>
            </when>
            <when value="history">
                <param name="primer_scheme_bedfile" type="data" format="tabular" label="Primer Scheme" />
            </when>
        </conditional>
        <conditional name="reference_source">
            <param name="reference_source_selector" type="select" label="Will you select a reference genome from your history or use a built-in reference?" >
                <option value="cached">Use a built-in reference</option>
                <option value="history">Use a reference from history</option>
            </param>
            <when value="cached">
                <param name="reference" type="select" label="Using reference genome" help="Select genome from the list">
                    <options from_data_table="all_fasta">
                        <filter type="sort_by" column="2" />
                        <validator type="no_options" message="No references are available" />
                    </options>
                </param>
            </when>
            <when value="history">
                <param name="reference" type="data" format="fasta" label="Use the following dataset as the reference sequence"
                       help="You can upload a FASTA sequence to the history and use it as reference" />
            </when>
        </conditional>
        <param type="text" name="medaka_model" label="Medaka model" help="Model string to pass to medaka (see https://github.com/nanoporetech/medaka#models)">
            <validator type="expression" message="Please specify a valid medaka model string (see https://github.com/nanoporetech/medaka#models)">(len(value.strip().split('_')) == 3 or len(value.strip().split('_')) == 4) and value.strip().startswith('r')</validator>
        </param>
    </inputs>
    <outputs>
        <data name="alignment_trimmed" format="bam" from_work_dir="*.primertrimmed.rg.sorted.bam" label="${tool.name} on ${on_string}: trimmed alignment" />
        <data name="alignment_report" format="tabular" from_work_dir="*.alignreport.txt" label="${tool.name} on ${on_string}: alignment report" />
        <data name="variants_merged_vcf" format="vcf_bgzip" from_work_dir="*.merged.vcf.gz" label="${tool.name} on ${on_string}: medaka variant calls" />
        <data name="variants_fail_vcf" format="vcf_bgzip" from_work_dir="*.fail.vcf.gz" label="${tool.name} on ${on_string}: variants fail" />
        <data name="variants_pass_vcf" format="vcf_bgzip" from_work_dir="*.pass.vcf.gz" label="${tool.name} on ${on_string}: variants pass" />
        <data name="consensus_fasta" format="fasta" from_work_dir="*.consensus.fasta" label="${tool.name} on ${on_string}: consensus sequence" />
        <data name="coverage_mask" format="tabular" from_work_dir="*.coverage_mask.txt" label="${tool.name} on ${on_string}: consensus coverage mask" />
        <data name="analysis_log" format="txt" from_work_dir="*.minion.log.txt" label="${tool.name} on ${on_string}: analysis log" />
    </outputs>
    <tests>
        <test>
            <param name="reference_source_selector" value="history" />
            <param name="read_file" value="SRR11410539_seqtk_sample_500_1.fastq" />
            <param name="reference" value="nCoV-2019.reference.fasta" />
            <param name="primer_scheme_source_selector" value="tool_data_table" />
            <param name="primer_scheme_bedfile" value="test_entry" />
            <param name="medaka_model" value="r941_min_high_g360" />
            <output name="consensus_fasta" file="SRR11410539_seqtk_sample_500_1.fastq.consensus.fasta" />
        </test>
        <test>
            <param name="reference_source_selector" value="history" />
            <param name="read_file" value="SRR11410539_seqtk_sample_500_1.fastq" />
            <param name="reference" value="nCoV-2019.reference.fasta" />
            <param name="primer_scheme_source_selector" value="history" />
            <param name="primer_scheme_bedfile" value="nCoV-2019.scheme.V1.bed" />
            <param name="medaka_model" value="r941_min_high_g360" />
            <output name="consensus_fasta" file="SRR11410539_seqtk_sample_500_1.fastq.consensus.fasta" />
        </test>
        <test>
            <param name="reference_source_selector" value="tool_data_table" />
            <param name="read_file" value="SRR11410539_seqtk_sample_500_1.fastq" />
            <param name="reference" value="test_entry" />
            <param name="primer_scheme_source_selector" value="tool_data_table" />
            <param name="primer_scheme_bedfile" value="test_entry" />
            <param name="medaka_model" value="r941_min_high_g360" />
            <output name="consensus_fasta" file="SRR11410539_seqtk_sample_500_1.fastq.consensus.fasta" />
        </test>
    </tests>
    <help><![CDATA[
ARTIC_ minion aligns Nanopore reads that were generated from a tiling amplicon library against a viral reference sequence. 
It generates a consensus fasta file and a vcf variant file.

This tool is configured to use the experimental 'medaka' variant caller and must be supplied with the name of
a model file to use with 'medaka', see the `medaka web page`_ for details.

.. _ARTIC: https://artic.readthedocs.io/en/latest/
.. _medaka web page: https://github.com/nanoporetech/medaka#models

Note that you should choose an appropriate model for the medaka version used by ARTIC minion.

==================  ==================
  ARTIC version     medaka version
==================  ==================
 1.2.1                1.0.3
 1.3.0-dev            1.2.3
==================  ==================
    ]]></help>
    <expand macro="citations" />
</tool>