diff bionano_scaffold.xml @ 3:295c0e28f4ee draft

"planemo upload for repository https://bionanogenomics.com/support/software-downloads/ commit 8afc84a2ccaa084b4eedb01a0b76e4c463931db3"
author bgruening
date Sun, 23 May 2021 17:23:03 +0000
parents 9bd94d9a1b2e
children 8cc3862f8b8e
line wrap: on
line diff
--- a/bionano_scaffold.xml	Mon May 17 21:26:16 2021 +0000
+++ b/bionano_scaffold.xml	Sun May 23 17:23:03 2021 +0000
@@ -5,23 +5,24 @@
     </macros>
     <expand macro="edam_ontology"/>
     <expand macro="requirements"/>
-    <version_command>perl /HybridScaffold/hybridScaffold.pl --version</version_command>
     <command detect_errors="exit_code"><![CDATA[
         #set RefAligner = '/usr/local/bin/RefAligner'
         ## softlinks do not work
         cp '${ngs_fasta}' ./ngs.fasta
         && cp '${bionano_cmap}' ./bionano.cmap
+        && export GALAXY_MEMORY_GB=\$((\${GALAXY_MEMORY_MB:-8192}/1024))
+        ## return max out of  GALAXY_SLOTS and 2 --> use a minimum 2 slots
+        && export SLOTS=\$(( \${GALAXY_SLOTS:-2} > 2 ? \${GALAXY_SLOTS:-2} : 2 ))
         #if $configuration_options.configuration == 'vgp'
             && cp '${vgp_mode}' ./config.xml
+            && sed -i "s|__MEMORY__|\$GALAXY_MEMORY_GB|" ./config.xml
+            && sed -i "s|__CORES__|\$SLOTS|" ./config.xml
         #else
-            #import os
-            #set cores = os.environ.get('GALAXY_SLOTS', 2)
-            #set memory = os.environ.get('GALAXY_MEMORY_MB', 4000) / 1000
             && cp '${configuration_file}' ./config.xml
-            && sed -i 's|attr="maxmem" val0=.* display|attr="maxmem" val0="$memory" display|' ./config.xml
-            && sed -i 's|attr="maxthreads" val0=.* display|attr="maxthreads" val0="$cores" display|' ./config.xml
-            && sed -i 's|attr="maxvirtmem" val0=.*/>|attr="maxvirtmem" val0="$cores"/>|' ./config.xml
-            && sed -i 's|attr="insertThreads" val0=.*/>|attr="insertThreads" val0="$cores"/>|' ./config.xml
+            && sed -i "s|attr=\"maxmem\" val0=.* display|attr=\"maxmem\" val0=\"\$GALAXY_MEMORY_GB\" display|" ./config.xml
+            && sed -i "s|attr=\"maxthreads\" val0=.* display|attr=\"maxthreads\" val0=\"\$SLOTS\" display|" ./config.xml
+            && sed -i "s|attr=\"maxvirtmem\" val0=.*/>|attr=\"maxvirtmem\" val0=\"\$GALAXY_MEMORY_GB\"/>|" ./config.xml
+            && sed -i "s|attr=\"insertThreads\" val0=.*/>|attr=\"insertThreads\" val0=\"\$SLOTS\"/>|" ./config.xml
         #end if
         ## output the configuration file on stdout
         && cat ./config.xml
@@ -53,24 +54,19 @@
         -f
         $zip_file
         -o ./
-        ##;
-        ##sleep 1000000
 
     ]]>    </command>
     <configfiles>
         <configfile name="vgp_mode"><![CDATA[
             #if $configuration_options.configuration == 'vgp'
-                #import os
-                #set cores = os.environ.get('GALAXY_SLOTS', 2)
-                #set memory = os.environ.get('GALAXY_MEMORY_MB', 4000) / 1000
                 <hybridScaffold>
                     <version>
                         <flag attr="version" val0="\$Id: hybridScaffold_DLE1_config.xml 7702 2018-06-25 20:53:51Z apang \$"/>
                     </version>
                     <global>
-                        <flag attr="maxmem" val0="$memory" display="Maximum memory (GB)" group="Global options" description="Define the maximum amount of RAM in gigabytes to be used by each process."/>
-                        <flag attr="maxthreads" val0="$cores" display="Max threads" group="Global options" description="Define maximum number of threads to be used by each process."/>
-                        <flag attr="maxvirtmem" val0="$memory"/>
+                        <flag attr="maxmem" val0="__MEMORY__" display="Maximum memory (GB)" group="Global options" description="Define the maximum amount of RAM in gigabytes to be used by each process."/>
+                        <flag attr="maxthreads" val0="__CORES__" display="Max threads" group="Global options" description="Define maximum number of threads to be used by each process."/>
+                        <flag attr="maxvirtmem" val0="__MEMORY__"/>
                         <flag attr="RAmem" val0="3" val1="1"/>
                     </global>
                     <fasta2cmap>
@@ -100,7 +96,7 @@
                         <flag attr="hashgen" val0="5" val1="7" val2="2.4" val3="1.5" val4="0.05" val5="5.0" val6="1" val7="1" val8="4"/>
                         <flag attr="hash" val0="-hashdelta" val1="26" val2="10" val3="46"/>
                         <flag attr="hashMultiMatch" val0="30" val1="10"/>
-                        <flag attr="insertThreads" val0="$cores"/>
+                        <flag attr="insertThreads" val0="__CORES__"/>
                         <flag attr="nosplit" val0="2"/>
                         <flag attr="biaswt" val0="0"/>
                         <flag attr="T" val0="1e-10" display="P-value" group="Initial alignment" description="Minimum confidence value to output initial alignments. Recommended starting value of 1e-5/genome size in Mb."/>
@@ -136,7 +132,7 @@
                         <flag attr="hashgen" val0="5" val1="7" val2="2.4" val3="1.5" val4="0.05" val5="5.0" val6="1" val7="1" val8="4"/>
                         <flag attr="hash" val0="-hashdelta" val1="26" val2="10" val3="46"/>
                         <flag attr="hashMultiMatch" val0="30" val1="10"/>
-                        <flag attr="insertThreads" val0="$cores"/>
+                        <flag attr="insertThreads" val0="__CORES__"/>
                         <flag attr="nosplit" val0="2"/>
                         <flag attr="biaswt" val0="0"/>
                         <flag attr="T" val0="1e-10" display="P-value" group="Initial alignment" description="Minimum confidence value to output initial alignments. Recommended starting value of 1e-5/genome size in Mb."/>
@@ -178,7 +174,7 @@
                         <flag attr="RepeatMask" val0="4" val1="0.01" display=""/>
                         <flag attr="RepeatRec" val0="0.7" val1="0.6" val2="1.4" display=""/>
                         <flag attr="pairmerge" val0="80" val1="0.2" display="Min alignment length and Max endoutlier" group="Merging" description="Minimum alignment length required for pair merge, and the maximum endoutlier allowed."/>
-                        <flag attr="maxmem" val0="$memory" display=""/>
+                        <flag attr="maxmem" val0="__MEMORY__" display=""/>
                         <flag attr="pairmergeRepeat"/>
                         <flag attr="NoBpp"/>
                         <flag attr="first" val0="-1" display=""/>
@@ -201,7 +197,7 @@
                         <flag attr="hashgen" val0="5" val1="7" val2="2.4" val3="1.5" val4="0.05" val5="5.0" val6="1" val7="1" val8="4"/>
                         <flag attr="hash" val0="-hashdelta" val1="26" val2="10" val3="46"/>
                         <flag attr="hashMultiMatch" val0="30" val1="10"/>
-                        <flag attr="insertThreads" val0="$cores"/>
+                        <flag attr="insertThreads" val0="__CORES__"/>
                         <flag attr="nosplit" val0="2"/>
                         <flag attr="biaswt" val0="0"/>
                         <flag attr="T" val0="1e-10" display="P-value" group="Initial alignment" description="Minimum confidence value to output intial alignments. Recommended starting value of 1e-5/genome size in Mb."/>
@@ -238,7 +234,7 @@
                         <flag attr="hashgen" val0="5" val1="3" val2="2.4" val3="1.5" val4="0.05" val5="5.0" val6="1" val7="1" val8="4"/>
                         <flag attr="hash" val0="-hashdelta" val1="50"/>
                         <flag attr="hashMultiMatch" val0="30" val1="10" val2="3"/>
-                        <flag attr="insertThreads" val0="$cores"/>
+                        <flag attr="insertThreads" val0="__CORES__"/>
                         <flag attr="nosplit" val0="2"/>
                         <flag attr="biaswt" val0="0"/>
                         <flag attr="T" val0="1e-10" display="P-value" group="Final alignment" description="Minimum confidence score used to align NGS contigs back to hybrid scaffold."/>
@@ -275,7 +271,7 @@
                         <flag attr="hashgen" val0="5" val1="7" val2="2.4" val3="1.5" val4="0.05" val5="5.0" val6="1" val7="1" val8="4"/>
                         <flag attr="hash" val0="-hashdelta" val1="26" val2="10" val3="46"/>
                         <flag attr="hashMultiMatch" val0="30" val1="10"/>
-                        <flag attr="insertThreads" val0="$cores"/>
+                        <flag attr="insertThreads" val0="__CORES__"/>
                         <flag attr="nosplit" val0="2"/>
                         <flag attr="biaswt" val0="0"/>
                         <flag attr="T" val0="1e-10" display="P-value" group="Final alignment" description="Minimum confidence score used to align NGS contigs back to hybrid scaffold."/>
@@ -348,7 +344,7 @@
                         <flag attr="HSDrange" val0="1.0"/>
                         <flag attr="hashoffset" val0="1"/>
                         <flag attr="hashMultiMatch" val0="15"/>
-                        <flag attr="insertThreads" val0="$cores"/>
+                        <flag attr="insertThreads" val0="__CORES__"/>
                         <flag attr="BestRef" val0="1"/>
                         <flag attr="BestRefPV" val0="1"/>
                         <flag attr="ChimQuality"/>
@@ -453,16 +449,16 @@
                 </assert_contents>
             </output>
             <assert_stdout>
-                <has_text text='attr="maxmem" val0="4.0"'/>
+                <has_text text='attr="maxmem" val0="8"'/>
             </assert_stdout>
             <assert_stdout>
-                <has_text text='attr="maxthreads" val0="2"'/>
+                <has_text text='attr="maxthreads" val0="1"'/>
             </assert_stdout>
             <assert_stdout>
-                <has_text text='attr="insertThreads" val0="2"'/>
+                <has_text text='attr="insertThreads" val0="1"'/>
             </assert_stdout>
              <assert_stdout>
-                <has_text text='attr="maxvirtmem" val0="4.0"'/>
+                <has_text text='attr="maxvirtmem" val0="8"'/>
             </assert_stdout>
             <assert_stdout>
                 <has_text text="hybridScaffold"/>
@@ -488,16 +484,16 @@
             <output name="ngs_contigs_scaffold_gap" file="test_02.gap" ftype="txt"/>
             <output name="report" file="test_02_report.txt" ftype="txt"/>
             <assert_stdout>
-                <has_text text='attr="maxmem" val0="4.0"'/>
+                <has_text text='attr="maxmem" val0="8"'/>
             </assert_stdout>
             <assert_stdout>
-                <has_text text='attr="maxthreads" val0="2"'/>
+                <has_text text='attr="maxthreads" val0="1"'/>
             </assert_stdout>
             <assert_stdout>
-                <has_text text='attr="insertThreads" val0="2"'/>
+                <has_text text='attr="insertThreads" val0="1"'/>
             </assert_stdout>
              <assert_stdout>
-                <has_text text='attr="maxvirtmem" val0="4.0"'/>
+                <has_text text='attr="maxvirtmem" val0="8"'/>
             </assert_stdout>
             <assert_stdout>
                 <has_text text="hybridScaffold"/>
@@ -531,16 +527,16 @@
                 </assert_contents>
             </output>
             <assert_stdout>
-                <has_text text='attr="maxmem" val0="4.0"'/>
+                <has_text text='attr="maxmem" val0="8"'/>
             </assert_stdout>
             <assert_stdout>
-                <has_text text='attr="maxthreads" val0="2"'/>
+                <has_text text='attr="maxthreads" val0="1"'/>
             </assert_stdout>
             <assert_stdout>
-                <has_text text='attr="insertThreads" val0="2"'/>
+                <has_text text='attr="insertThreads" val0="1"'/>
             </assert_stdout>
              <assert_stdout>
-                <has_text text='attr="maxvirtmem" val0="4.0"'/>
+                <has_text text='attr="maxvirtmem" val0="8"'/>
             </assert_stdout>
             <assert_stdout>
                 <has_text text="hybridScaffold"/>
@@ -572,16 +568,16 @@
                 </assert_contents>
             </output>
             <assert_stdout>
-                <has_text text='attr="maxmem" val0="4.0"'/>
+                <has_text text='attr="maxmem" val0="8"'/>
             </assert_stdout>
             <assert_stdout>
-                <has_text text='attr="maxthreads" val0="2"'/>
+                <has_text text='attr="maxthreads" val0="1"'/>
             </assert_stdout>
             <assert_stdout>
-                <has_text text='attr="insertThreads" val0="2"'/>
+                <has_text text='attr="insertThreads" val0="1"'/>
             </assert_stdout>
              <assert_stdout>
-                <has_text text='attr="maxvirtmem" val0="4.0"'/>
+                <has_text text='attr="maxvirtmem" val0="8"'/>
             </assert_stdout>
             <assert_stdout>
                 <has_text text="hybridScaffold"/>