diff cactus_export.xml @ 0:a82a0acf4eb6 draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/cactus commit 827619d22d2931d8fb34ed6844cfa91433e1ac2c
author iuc
date Tue, 06 Feb 2024 00:30:57 +0000
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cactus_export.xml	Tue Feb 06 00:30:57 2024 +0000
@@ -0,0 +1,156 @@
+<tool id="cactus_export" name="Cactus: export" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@" license="MIT">
+    <description>whole-genome multiple sequence alignment to other formats</description>
+    <macros>
+        <import>macros.xml</import>
+    </macros>
+    <expand macro="xrefs"/>
+    <expand macro="requirements"/>
+    <command detect_errors="exit_code"><![CDATA[
+
+        ## check if the reference level was specified
+        #if $export_select.format in ['maf_selector', 'vg_selector']:
+            #if $export_select.ref_level == '':
+                echo "You must provide a reference level" &&
+                exit 1 ;
+            #end if
+        #end if
+
+        ln -s '$hal_file' alignment.hal 
+
+        ## make a MAF
+        #if $export_select.format == 'maf_selector':
+            &&
+            hal2maf 
+            --refGenome $export_select.ref_level
+            alignment.hal
+            alignment.maf
+        #end if
+
+        ## make an assemblyHub
+        #if $export_select.format == 'ah_selector':
+            &&
+            hal2assemblyHub.py 
+            --maxCores  \${GALAXY_SLOTS:-4}
+            --maxMemory \${GALAXY_MEMORY_MB:-8196}M
+            ./jobStore
+            alignment.hal
+            assemblyhub
+            &&
+            tar -cv assemblyhub > assemblyhub.tar
+        #end if
+
+        ## make a VG
+        #if $export_select.format == 'vg_selector':
+            &&
+            hal2vg alignment.hal
+            --progress 
+            > alignment.pg
+        #end if
+
+    ]]></command>
+    <inputs>
+        <param name="hal_file" type="data" format="h5" label="HAL file" help="Multiple-genome alignment generated by Cactus"/>
+        <conditional name="export_select">
+            <param name="format" type="select" label="Output format" help="The type of output you want to export. Run this tool once for each output format.">
+                <option value="maf_selector" selected="true">MAF file</option>
+                <option value="ah_selector">Assembly Hub</option>
+                <option value="vg_selector">VG file</option>
+            </param>
+            <when value="maf_selector">
+                <param name="ref_level" type="text" value="" label="Reference genome" help="Specify one of the Input Genomes as the reference level. This must match the label used in 'Genome Label'."/>
+            </when>
+            <when value="ah_selector">
+            </when>
+            <when value="vg_selector">
+                <param name="ref_level" type="text" value="" label="Reference genome" help="Specify one of the Input Genomes as the reference level. This must match the label used in 'Genome Label'."/>
+            </when>
+        </conditional>
+    </inputs>
+    <outputs>
+        <data name="out_maf" format="maf" from_work_dir="alignment.maf" label="${tool.name} on ${on_string} (MAF file)">
+            <filter>export_select['format'] == 'maf_selector'</filter>
+        </data>
+        <data name="out_vg" format="vg" from_work_dir="alignment.pg" label="${tool.name} on ${on_string} (VG file)">
+            <filter>export_select['format'] == 'vg_selector'</filter>
+        </data>
+        <data name="out_ah" format="tar" from_work_dir="assemblyhub.tar" label="${tool.name} on ${on_string} (Assembly Hub)">
+            <filter>export_select['format'] == 'ah_selector'</filter>
+        </data>
+    </outputs>
+    <tests>
+        <!-- this fails because no reference level is set -->
+        <test expect_failure="true">
+            <conditional name="export_select">
+                <param name="format" value="maf_selector"/>
+            </conditional>
+            <param name="hal_file" ftype="h5" location="https://zenodo.org/record/8336793/files/evolverMammals.hal"/>
+        </test>
+        <!-- within-species mode -->
+        <test expect_num_outputs="1">
+            <conditional name="export_select">
+                <param name="ref_level" value="simMouse_chr6"/>
+                <param name="format" value="maf_selector"/>
+            </conditional>
+            <param name="hal_file" ftype="h5" location="https://zenodo.org/record/8336793/files/within.hal"/>
+            <output name="out_maf" location="https://zenodo.org/record/8336793/files/set_reference.maf"/>
+        </test>
+        <!-- between-species  -->
+        <test expect_num_outputs="1">
+            <conditional name="export_select">
+                <param name="ref_level" value="simMouse_chr6"/>
+                <param name="format" value="maf_selector"/>
+            </conditional>
+            <param name="hal_file" ftype="h5" location="https://zenodo.org/record/8336793/files/evolverMammals_noroot.hal"/>
+            <output name="out_maf" location="https://zenodo.org/record/8336793/files/evolverMammals_noroot.maf"/>
+        </test>
+        <!-- assembly hub format -->
+        <test expect_num_outputs="1">
+            <conditional name="export_select">
+                <param name="format" value="ah_selector"/>
+            </conditional>
+            <param name="hal_file" ftype="h5" location="https://zenodo.org/record/8336793/files/within.hal"/>
+            <output name="out_ah">
+                <assert_contents>
+                    <has_archive_member path="assemblyhub/hub.txt"/>
+                </assert_contents>
+            </output>
+        </test>
+        <!-- vg format -->
+        <test expect_num_outputs="1">
+            <conditional name="export_select">
+                <param name="format" value="vg_selector"/>
+                <param name="ref_level" value="simMouse_chr6"/>
+            </conditional>
+            <param name="hal_file" ftype="h5" location="https://zenodo.org/record/8336793/files/within.hal"/>
+            <output name="out_vg">
+                <assert_contents>
+                    <has_size value="860452" delta="200000"/>
+                </assert_contents>
+            </output>
+        </test>
+        <!-- gfa format (gfa2): not implemented -->
+    </tests>
+    <help><![CDATA[
+**What it does**
+
+Converts the HAL output from `Cactus whole-genome multiple sequence
+aligner <root?tool_id=cactus_cactus>`__ into other formats.
+
+**Input**
+
+A `HAL
+file <https://github.com/ComparativeGenomicsToolkit/cactus#using-the-output>`__
+from `Cactus <root?tool_id=cactus_cactus>`__.
+
+**Output**
+
+Currently, you can export a pangenome in VG format, for use with
+`vg <https://github.com/vgteam/vg>`__, or Multiple Alignment Format
+(MAF). Note that these files are **reference-based**, so it will contain
+alignments to a single reference from your list of inputs (i.e. not a
+graph). You have to provide this with the ‘reference genome’ option.
+
+You can also export an Assembly Hub for use with the UCSC Genome Browser.
+]]></help>
+    <expand macro="citations"/>
+</tool>