diff data_manager/hisat2_index_builder.xml @ 8:e4f36467bb51 draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_hisat2_index_builder commit e5971e34b23280f7c3d6291a03325b6dd47e3fdd
author iuc
date Sat, 16 Aug 2025 14:36:15 +0000
parents 8eac26f44d29
children
line wrap: on
line diff
--- a/data_manager/hisat2_index_builder.xml	Sun Apr 16 08:30:13 2023 +0000
+++ b/data_manager/hisat2_index_builder.xml	Sat Aug 16 14:36:15 2025 +0000
@@ -1,9 +1,15 @@
-<tool id="hisat2_index_builder_data_manager" name="HISAT2 index" tool_type="manage_data" version="2.1.0" profile="19.05">
+<tool id="hisat2_index_builder_data_manager" name="HISAT2 index" tool_type="manage_data" version="@WRAPPER_VERSION@+galaxy@VERSION_SUFFIX@" profile="23.0">
     <description>builder</description>
+    <macros>
+        <token name="@WRAPPER_VERSION@">2.2.1</token>
+        <token name="@VERSION_SUFFIX@">1</token>
+    </macros>
     <requirements>
-        <requirement type="package" version="2.1.0">hisat2</requirement>
+        <requirement type="package" version="@WRAPPER_VERSION@">hisat2</requirement>
     </requirements>
     <command detect_errors="exit_code"><![CDATA[
+        #set $value = $sequence_id or $all_fasta_source.fields.dbkey
+        #set $fasta_file_name = str($all_fasta_source.fields.path).split('/')[-1]
         #if $advanced.adv_param_select == 'yes' and $advanced.gtf_input:
             ln -s '${advanced.gtf_input}' gtf_file.gtf &&
             hisat2_extract_splice_sites.py gtf_file.gtf > splice_sites.txt &&
@@ -17,30 +23,53 @@
                 hisat2_extract_snps_haplotypes_UCSC.py '${all_fasta_source.fields.path}' snps.tabular extracted &&
             #end if
         #end if
-        python '$__tool_directory__/hisat2_index_builder.py' --output '${out_file}'
-            --fasta_filename '${all_fasta_source.fields.path}'
-            --fasta_dbkey '${all_fasta_source.fields.dbkey}'
-            --fasta_description '${all_fasta_source.fields.name}'
-            --data_table_name hisat2_indexes
-            --indexer_options "-p \${GALAXY_SLOTS:-1}
+
+        mkdir -p '${out_file.extra_files_path}' &&
+        ln -s '${all_fasta_source.fields.path}' '${out_file.extra_files_path}/${fasta_file_name}' &&
+        working="\$(pwd)" &&
+        cd '${out_file.extra_files_path}' &&
+
+        hisat2-build -p "\${GALAXY_SLOTS:-1}"
             #if $advanced.adv_param_select == 'yes':
                 --noauto
                 #if $advanced.snps:
-                    --snps "`pwd`/extracted.snp"
-                    --haplotype "`pwd`/extracted.haplotype"
+                    --snp "\${working}/extracted.snp"
+                    --haplotype "\${working}/extracted.haplotype"
                 #end if
                 #if $advanced.gtf_input:
-                    --ss "`pwd`/splice_sites.txt"
-                    --exon "`pwd`/exon.txt"
+                    --ss "\${working}/splice_sites.txt"
+                    --exon "\${working}/exon.txt"
                 #end if
                 --bmax $advanced.bmax
                 --bmaxdivn $advanced.bmaxdivn
                 --dcv $advanced.dcv
                 --offrate $advanced.offrate
             #end if
-            "
+            '${fasta_file_name}' '${value}' &&
+        rm '${out_file.extra_files_path}/${fasta_file_name}' &&
+
+        cp '$dmjson' '$out_file'
         ]]>
     </command>
+    <configfiles>
+        <configfile name="dmjson"><![CDATA[#slurp
+#set $fasta_file_name = str($all_fasta_source.fields.path).split('/')[-1]
+#set $value = $sequence_id or $all_fasta_source.fields.dbkey
+#set $name = $sequence_name or $all_fasta_source.fields.name
+{
+  "data_tables":{
+    "hisat2_indexes":[
+      {
+        "value": "${value}",
+        "dbkey": "${all_fasta_source.fields.dbkey}",
+        "name": "${name}",
+        "path": "${value}"
+      }
+    ]
+  }
+}
+]]></configfile>
+    </configfiles>
     <inputs>
         <param label="Source FASTA Sequence" name="all_fasta_source" type="select">
             <options from_data_table="all_fasta" />
@@ -69,7 +98,18 @@
     <tests>
         <test>
             <param name="all_fasta_source" value="phiX174"/>
-            <output name="out_file" file="hisat2_data_manager.json"/>
+            <output name="out_file" file="hisat2_data_manager.1.json"/>
+        </test>
+        <test>
+            <param name="all_fasta_source" value="phiX174"/>
+            <param name="sequence_name" value="Galeocerdo cuvier"/>
+            <param name="sequence_id" value="tigHai1"/>
+            <param name="advanced|adv_param_select" value="yes"/>
+            <param name="advanced|bmax" value="3"/>
+            <param name="advanced|bmaxdivn" value="3"/>
+            <param name="advanced|dcv" value="4"/>
+            <param name="advanced|offrate" value="5"/>
+            <output name="out_file" file="hisat2_data_manager.2.json"/>
         </test>
     </tests>
     <help>