view macros.xml @ 21:df8ac8fff5e0 draft default tip

planemo upload for repository commit 20d8d84d66eb27f870cadb94a02c97806090df24
author gga
date Wed, 11 May 2022 14:45:43 +0000
parents e40c57255d4c
line wrap: on
line source

<?xml version="1.0"?>
    <xml name="requirements">
            <requirement type="package" version="@LIB_VERSION@">python-chado</requirement>
            <requirement type="package" version="1.5">jq</requirement>
            <requirement type="package" version="@PG_VERSION@">postgresql</requirement>
            <requirement type="package" version="0.1">pglite</requirement>

    <token name="@LIB_VERSION@">2.3.9</token>
    <token name="@WRAPPER_VERSION@">@LIB_VERSION@+galaxy0</token>
    <token name="@PG_VERSION@">11.2</token>

    <xml name="stdio">
            <regex level="fatal" match="Exception:" source="stderr" />
            <regex level="fatal" match="error" source="stderr" />
            <exit_code range="1:" />

    <xml name="citation">

    <token name="@HELP_OVERVIEW@"><![CDATA[
        **Python-chado Overview**

        Python-cado provides several tools allowing to load data into a remote Chado database.

    <token name="@HELP@"><![CDATA[

    <xml name="sanitized">
            <valid initial="string.printable">
                <remove value="&apos;"/>
            <mapping initial="none">
                <add source="&apos;" target="&apos;&quot;&apos;&quot;&apos;"/>
                <add source="(" target="\("/>
                <add source=")" target="\)"/>

    <!-- I'm not proud of it, but it is needed for workflows -->
    <xml name="wait_for">
        <param name="wait_for"
               label="Run this only after the following dataset is ready"
               help="Use this if you want to delay the job execution until some data is already loaded. The selected dataset will not be used for anything else."/>

    <xml name="feature_rel">
        <param name="rel_subject_re"
               label="Regular expression to extract the unique name of the parent feature"
               help="this regex will be applied on the fasta definition line to generate the unique name of the parent feature">
            <expand macro="sanitized"/>

        <param name="rel_subject_type"
               label="Sequence type of the parent"
               help="this should be a Sequence Ontology term" />

    <xml name="psql_target">
      <conditional name="psql_target">
         <param name="method" type="select" label="Chado Database" help="If you select 'Remote database' make sure credentials are defined in environment variables">
              <option value="remote">Remote database</option>
              <option value="pgtools">Database from history</option>
          <when value="remote"/>
          <when value="pgtools">
            <param name="infile" type="data" format="postgresql" label="Input database" />
            <param name="schema" type="text" label="Schema containing Chado tables" value="public" help="Can be 'chado' for a Tripal database"/>

    <token name="@START_PSQL@"><![CDATA[
        #if $psql_target.method == 'pgtools'
            tar -xjvf '$psql_target.infile' > /dev/null &&
            . '$__tool_directory__/' '$psql_target.schema'
            if [ -z "\$CHAKIN_GLOBAL_CONFIG_PATH" ]; then
              echo "__default: local" > '.auth.yml' &&
              echo "local:" >> '.auth.yml' &&
              echo "    dbhost: \"\$GALAXY_CHADO_DBHOST\"" >> '.auth.yml' &&
              echo "    dbname: \"\$GALAXY_CHADO_DBNAME\"" >> '.auth.yml' &&
              echo "    dbpass: \"\$GALAXY_CHADO_DBPASS\"" >> '.auth.yml' &&
              echo "    dbuser: \"\$GALAXY_CHADO_DBUSER\"" >> '.auth.yml' &&
              echo "    dbschema: \"\$GALAXY_CHADO_DBSCHEMA\"" >> '.auth.yml' &&
              echo "    dbport: \"\$GALAXY_CHADO_DBPORT\"" >> '.auth.yml' &&

              export CHAKIN_GLOBAL_CONFIG_PATH='.auth.yml'
            ; fi
        #end if

    <token name="@STOP_PSQL@"><![CDATA[
        #if $psql_target.method == 'pgtools'
            pglite stop -d ./postgresql &&
            timeout 60 bash -c 'until pglite status -d ./postgresql | grep -F -q "no server running"; do sleep 1; done'
            ## Make sure psql is stopped even if loading script failed
            pglite stop -d ./postgresql || true
        #end if

    <token name="@ZIP_PSQL@"><![CDATA[
        #if $psql_target.method == 'pgtools'
            pglite stop -d ./postgresql &&
            timeout 60 bash -c 'until pglite status -d ./postgresql | grep -F -q "no server running"; do sleep 1; done' &&
            tar -cvjf postgresql_out.tar.bz2 postgresql > /dev/null
            ## Make sure psql is stopped even if loading script failed
            pglite stop -d ./postgresql || true
        #end if