view data_manager/install_primer_scheme_bedfiles.xml @ 6:dd451e45681c draft default tip

"planemo upload for repository commit 4880dcfcdddd9ed8415ccde01b2f8e2c28dab5c3"
author iuc
date Tue, 16 Nov 2021 08:22:08 +0000
parents be70da9dc013
line wrap: on
line source

<tool id="data_manager_primer_scheme_bedfiles" name="BED-format primer scheme data manager" version="0.0.13" tool_type="manage_data" profile="20.09">
        <requirement type="package" version="2.26.0">requests</requirement>
    <!-- fetch all the primers in one go -->
    <command detect_errors="exit_code"><![CDATA[
    python '$__tool_directory__/'
        #if $input.input_type == "network"
            ## this code looks up the existing table and uses it to build a list of known primers which
            ## is then used to filter the $input.primers variable. some notes:
            ## $__app__.tool_data_tables is a dictionary where the keys are data table names and the values 
            ## are TabularToolDataTable objects (from lib/galaxy/tools/data/
            ## the get_fields() method on the TabularToolDataTable returns a list of lists, with one list
            ## per line of the tool data table, so row[0] is the first field (i.e. the value column)
            ## $input.primers is a string ('val1,val2') when interpreted outside of #set but a list inside of #set
            ## known_primers is the $known_primers variable but because it is in a list comprehension the $ should
            ## not be used
            #set $data_table = $__app__.tool_data_tables.get("primer_scheme_bedfiles")
            #if $data_table is not None:
                #set $known_primers = [ row[0] for row in $data_table.get_fields() ]
                #set $primer_list = ','.join([ primer_name for primer_name in $input.primers if primer_name not in known_primers ])
                #set $primer_list = $input.primers
            #end if
            --artic_primers '$primer_list'
            --primer_file '${input.primer_input}'
            --primer_name '${input.primer_name}'
            --primer_description '${input.primer_description}'
        #end if
        <conditional name="input">
            <param name="input_type" label="Choose the source for primer schemes" type="select">
                <option value="network" selected="true">ARTIC SARS-CoV-2, VarSkip and Midnight web pages</option>
                <option value="history">History</option>
            <when value="network">
                <param name="primers" type="select" multiple="true" label="SARS-CoV-2 Primers to fetch">
                    <option value="SARS-CoV-2-ARTICv1" selected="true">SARS-CoV-2 ARTIC v1</option>
                    <option value="SARS-CoV-2-ARTICv2" selected="true">SARS-CoV-2 ARTIC v2</option>
                    <option value="SARS-CoV-2-ARTICv3" selected="true">SARS-CoV-2 ARTIC v3</option>
                    <option value="SARS-CoV-2-ARTICv4" selected="true">SARS-CoV-2 ARTIC v4</option>
                    <option value="VarSkip-V1a" selected="true">NEB VarSkip-V1a</option>
                    <option value="Midnight-v1" selected="true">RAPID/Midnight v1</option>
            <when value="history">
                <param name="primer_input" label="Select history item" type="data" format="bed" />
                <param name="primer_name" label="Name for this primer scheme" type="text" 
                       help="Characters that are not word characters or - will be removed from primer scheme name and spaces replaced with underscore (_)" />
                <param name="primer_description" label="Description for primer scheme" type="text" />
        <data name="output_file" format="data_manager_json"/>
            <param name="input_type" value="network" />
            <param name="primers" value="SARS-CoV-2-ARTICv1,SARS-CoV-2-ARTICv2,SARS-CoV-2-ARTICv3,SARS-CoV-2-ARTICv4,VarSkip-V1a,Midnight-v1"/>
            <output name="output_file" value="data_manager_primer_scheme_bedfiles.json.template" compare="re_match" />
            <param name="input_type" value="history" />
            <param name="primer_input" ftype="bed" value="sample1.bed" />
            <param name="primer_name" value="sample_primer" />
            <param name="primer_description" value="sample primer scheme" />
            <output name="output_file">
                    <has_text text="sample_primer"/>
            <param name="input_type" value="history" />
            <param name="primer_input" ftype="bed" value="sample1.bed" />
            <param name="primer_name" value="sample^primer" />
            <param name="primer_description" value="sample primer scheme" />
            <output name="output_file">
                    <has_text text="sampleprimer"/>
        Amplicon sequencing for viral pathogens using the ARTIC_ pipeline or `PrimalSeq and iVar`_ relies on
        identifying primer locations in a reference sequence using BED format files. This 
        data manager populates a Galaxy tool data table, either from files provided via
        a history or via the ARTIC_, the New England Biolabs VarSkip_ and the Massey 
        University Midnight_ web pages.

        If the data manager fails with an error message about downloading some of the primer data files,
        try and visit the corresponding website to see if it is functioning correctly. As with anything
        network-dependent, problems can sometimes happen. A simple solution is to wait some time and
        run the data manager again.

        Finally, the data manager is designed to not duplicate primer files, so primers schemes that have
        already been downloaded will be skipped when the install from network download mode is used.

        .. _PrimalSeq and iVar:
        .. _ARTIC:
        .. _VarSkip:
        .. _Midnight:
        .. here_:
      <citation type="doi">10.1186/s13059-018-1618-7</citation>