Repository 'salmonquantmerge'
hg clone https://toolshed.g2.bx.psu.edu/repos/bgruening/salmonquantmerge

Changeset 11:7643953b19f9 (2025-10-29)
Previous changeset 10:a896b8b7d264 (2024-03-18) Next changeset 12:71ce24befa24 (2025-10-31)
Commit message:
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/salmon commit 1971e35a365a91ae36c990b374a552a46196e888
modified:
macros.xml
salmonquantmerge.xml
test-data/full_data_structure.txt
umiout.sh
b
diff -r a896b8b7d264 -r 7643953b19f9 macros.xml
--- a/macros.xml Mon Mar 18 09:35:17 2024 +0000
+++ b/macros.xml Wed Oct 29 10:46:47 2025 +0000
[
b'@@ -1,8 +1,8 @@\n <macros>\n     <token name="@TOOL_VERSION@">1.10.1</token>\n-    <token name="@VERSION_SUFFIX@">2</token>\n+    <token name="@VERSION_SUFFIX@">3</token>\n     <token name="@IDX_VERSION@">q7</token>\n-    <token name="@PROFILE_VERSION@">20.01</token>\n+    <token name="@PROFILE_VERSION@">24.1</token>\n     <xml name="xrefs">\n         <xrefs>\n             <xref type="bio.tools">salmon</xref>\n@@ -19,8 +19,11 @@\n             <requirement type="package" version="1.9.3">scipy</requirement>\n         </requirements>\n     </xml>\n+    <xml name="version_command">\n+        <version_command><![CDATA[salmon --no-version-check --version | cut -d" " -f2]]></version_command>\n+    </xml>\n     <xml name="orient">\n-        <param name="orientation" type="select" label="Relative orientation of reads within a pair">\n+        <param argument="--libType" name="orientation" type="select" label="Relative orientation of reads within a pair">\n             <option value="M">Mates are oriented in the same direction (M = matching)</option>\n             <option value="O">Mates are oriented away from each other (O = outward)</option>\n             <option value="I" selected="True">Mates are oriented toward each other (I = inward)</option>\n@@ -28,7 +31,7 @@\n     </xml>\n     <xml name="stranded">\n         <conditional name="libtype" >\n-            <param name="strandedness" type="select" label="Specify the strandedness of the reads" help="--libtype">\n+            <param argument="--libType" name="strandedness" type="select" label="Specify the strandedness of the reads" help="--libtype">\n                 <option value="A" selected="true">Infer automatically (A)</option>\n                 <option value="U">Not stranded (U)</option>\n                 <option value="SF">read comes from the forward strand (SF)</option>\n@@ -68,7 +71,7 @@\n                 <option value="history" selected="True">Use one from the history</option>\n             </param>\n             <when value="indexed">\n-                <param name="index" type="select" label="Select a reference transcriptome" help="If your transcriptome of interest is not listed, contact your Galaxy admin">\n+                <param argument="--index" type="select" label="Select a reference transcriptome" help="If your transcriptome of interest is not listed, contact your Galaxy admin">\n                     <options from_data_table="salmon_indexes_versioned">\n                         <filter type="sort_by" column="2"/>\n                         <filter type="static_value" column="4" value="@IDX_VERSION@" />\n@@ -78,14 +81,11 @@\n             </when>  <!-- build-in -->\n             <when value="history">\n                 <section name="s_index" title="Salmon index" expanded="true">\n-                    <param name="fasta" type="data" format="fasta" label="Transcripts FASTA file"/>\n-                    <param name="genome" type="data" format="fasta" optional="true" label="Reference genome" \n+                    <param argument="--transcripts" name="fasta" type="data" format="fasta" label="Transcripts FASTA file"/>\n+                    <param argument="--genome" type="data" format="fasta" optional="true" label="Reference genome" \n                         help="The reference genome is required for generating a decoy-away index. The decoy sequences are regions of the target genome \n                             that are sequence similar to annotated transcripts. These are the regions of the genome most likely to cause mismapping." />\n-                    <param name="kmer" type="integer" value="31" label="Kmer length"/>\n-                    <param name="phash" type="boolean" label="Perfect Hash" truevalue="--perfectHash" falsevalue="" checked="false"\n-                        help="Build the index using a perfect hash rather than a dense hash.  This will require less memory (especially during quantification), \n-                            but will take longer to construct"/>\n+                    <param argument="--kmerLen'..b' #if $quant_type.input.single_or_paired.single_or_paired_opts == \'single\':\n                 --libType ${quant_type.input.single_or_paired.libtype.strandedness}\n@@ -431,28 +375,18 @@\n                 #else\n                     ${quant_type.input.single_or_paired.libtype.orientation}${quant_type.input.single_or_paired.libtype.strandedness}\n                 #end if\n-                #if $quant_type.input.single_or_paired.single_or_paired_opts == \'paired_interleaved\':\n-                    #if $compressed == \'BZ2\':\n-                        --mates1 <(bzcat < ./mate1.$ext | seqtk seq -1)\n-                        --mates2 <(bzcat < ./mate1.$ext | seqtk seq -2)\n-                    #else:\n-                        --mates1 <(seqtk seq -1 ./mate1.$ext)\n-                        --mates2 <(seqtk seq -2 ./mate1.$ext)\n-                    #end if\n+                #if $compressed == \'GZ\':\n+                    --mates1 <(zcat < ./mate1.$ext)\n+                    --mates2 <(zcat < ./mate2.$ext)\n+                #else if $compressed == \'BZ2\':\n+                    --mates1 <(bzcat < ./mate1.$ext)\n+                    --mates2 <(bzcat < ./mate2.$ext)\n                 #else:\n-                    #if $compressed == \'GZ\':\n-                        --mates1 <(zcat < ./mate1.$ext)\n-                        --mates2 <(zcat < ./mate2.$ext)\n-                    #else if $compressed == \'BZ2\':\n-                        --mates1 <(bzcat < ./mate1.$ext)\n-                        --mates2 <(bzcat < ./mate2.$ext)\n-                    #else:\n-                        --mates1 ./mate1.$ext\n-                        --mates2 ./mate2.$ext\n-                    #end if\n+                    --mates1 ./mate1.$ext\n+                    --mates2 ./mate2.$ext\n                 #end if\n             #end if\n-            --threads "\\${GALAXY_SLOTS:-4}"\n+            --threads "\\$SLOTS"\n             ${quant_type.discardOrphansQuasi}\n             ${quant_type.validmap.validateMappings}\n             #if $quant_type.validmap.validateMappings:\n@@ -497,12 +431,12 @@\n         #if $geneMap:\n             ln -s "$geneMap" ./geneMap.${geneMap.ext} &&\n         #end if\n-        salmon quant\n-        -t \'${quant_type.transcript}\'\n-        -l \'${quant_type.libtype.strandedness}\'\n-        -a \'${quant_type.afile}\'\n+        salmon --no-version-check quant\n+        --targets \'${quant_type.transcript}\'\n+        --libType \'${quant_type.libtype.strandedness}\'\n+        --alignments \'${quant_type.afile}\'\n         $quant_type.ont\n-        --threads "\\${GALAXY_SLOTS:-4}"\n+        --threads "\\$SLOTS"\n         ${quant_type.discardOrphans}\n         ${quant_type.noErrorModel}\n         #if $quant_type.numErrorBins:\n@@ -590,33 +524,7 @@\n         -o ./output\n         ]]>\n     </token>\n-    <token name="@qmerge@"><![CDATA[\n-        #import re\n \n-        #for $counter, $input_data in enumerate($quantfiles):\n-            rank_of_series=$counter\n-            mkdir ${counter}.quantmerge &&\n-            ln -s $input_data.quants ${counter}.quantmerge/quant.sf &&\n-        #end for\n-        salmon quantmerge\n-            --quants *.quantmerge\n-            --names\n-            #for $counter, $input_data in enumerate($quantfiles):\n-                #if $input_data.names and re.sub(\' \', \'\', \'$input_data.names\') != \'\':\n-                    \'${input_data.names}\'\n-                #else:\n-                    #set $identifier=re.sub(\'[^\\w\\-\\s]\', \'_\', str($input_data.quants.element_identifier))\n-                    "$identifier"\n-               #end if\n-            #end for\n-            --column \'${column}\'\n-            ${genes}\n-            #if $missing:\n-                --missing \'${missing}\'\n-            #end if\n-            -o qmergeout.tab\n-        ]]>\n-    </token>\n     <token name="@salmonhelp@"><![CDATA[\n         Salmon is a lightweight method for quantifying transcript abundance from RNA\xe2\x80\x93seq reads, combining a dual-phase parallel inference algorithm and feature-rich bias models with an ultra-fast read mapping procedure.\n \n'
b
diff -r a896b8b7d264 -r 7643953b19f9 salmonquantmerge.xml
--- a/salmonquantmerge.xml Mon Mar 18 09:35:17 2024 +0000
+++ b/salmonquantmerge.xml Wed Oct 29 10:46:47 2025 +0000
[
@@ -5,11 +5,46 @@
     </macros>
     <expand macro="xrefs"/>
     <expand macro="requirements"/>
+    <expand macro="version_command"/>
     <command detect_errors="exit_code"><![CDATA[
-        @qmerge@
+    #import re
+
+    #for $counter, $input_data in enumerate($quantfiles):
+        rank_of_series=$counter
+        mkdir ${counter}.quantmerge &&
+        ln -s '$input_data.quants' ${counter}.quantmerge/quant.sf &&
+    #end for
+    salmon --no-version-check quantmerge
+        --quants *.quantmerge
+        --names
+        #for $counter, $input_data in enumerate($quantfiles):
+            #if $input_data.names and re.sub(' ', '', '$input_data.names') != '':
+                '${input_data.names}'
+            #else:
+                #set $identifier=re.sub('[^\w\-\s]', '_', str($input_data.quants.element_identifier))
+                "$identifier"
+            #end if
+        #end for
+        --column '${column}'
+        ${genes}
+        #if $missing:
+            --missing '${missing}'
+        #end if
+        -o qmergeout.tab
     ]]></command>
     <inputs>
-        <expand macro="quantmerge"/>
+        <repeat name="quantfiles" title="Quant file and names">
+            <param argument="--quants" type="data" format="tsv,tabular" label="Salmon quant tabular output files"/>
+            <param argument="--names" type="text" label="One-word sample names" optional="True"/>
+        </repeat>
+        <param argument="--column" type="select" label="Columns" help="Name of columns that will be merged in the output file">
+            <option value="len" selected="True">Length</option>
+            <option value="elen">Effective Length</option>
+            <option value="tpm">Transcripts per Million</option>
+            <option value="numreads">NumReads</option>
+        </param>
+        <param argument="--genes" type="boolean" truevalue="--genes" falsevalue="" checked="False" label="Genes" help="Use gene quantifications instead of transcript"/>
+        <param argument="--missing" type="integer" label="Missing" optional="True" help="The value of missing values"/>
     </inputs>
     <outputs>
         <data name="mergedfile" format="tabular" label="${tool.name} on ${on_string}" from_work_dir="qmergeout.tab"/>
b
diff -r a896b8b7d264 -r 7643953b19f9 test-data/full_data_structure.txt
--- a/test-data/full_data_structure.txt Mon Mar 18 09:35:17 2024 +0000
+++ b/test-data/full_data_structure.txt Wed Oct 29 10:46:47 2025 +0000
b
@@ -544,7 +544,7 @@
 8 198 199 200 201 202 203 204 205 1 1 32 1 TACGGGCTGC 1
 1 170 1 1 21 1 GAACATTTGT 1
 3 29 30 31 2 2 34 1 CGGCGTCCGG 1 1 1 AGCGGCTGGT 1
-11 5 6 7 8 9 10 11 12 13 14 16 1 1 93 1 TTGACACCAT 1
+1 16 1 1 93 1 TTGACACCAT 1
 1 146 1 1 46 1 AACACAGATA 1
 4 287 289 291 293 2 2 140 1 CCGTACGGGG 1 35 1 GGATTCAGTA 1
 3 273 274 275 1 1 86 1 CCGACTCGTT 1
b
diff -r a896b8b7d264 -r 7643953b19f9 umiout.sh
--- a/umiout.sh Mon Mar 18 09:35:17 2024 +0000
+++ b/umiout.sh Wed Oct 29 10:46:47 2025 +0000
b
@@ -1,11 +1,14 @@
 #!/usr/bin/bash
 
-mkdir fixed;
+set -e
+
+mkdir -p fixed;
 for file in ./umiout/*;
-do prefix="${file%.dot.gz}";
-prefix=${prefix/.\/umiout\//};
-gunzip $file;
-sed "s/umiout\/$prefix.dot.gz/$prefix/" umiout/$prefix.dot > fixed/$prefix.dot;
-dot -Tpdf fixed/$prefix.dot -o fixed/$prefix.pdf;
+do
+prefix="${file%.dot.gz}";
+prefix="${prefix/.\/umiout\//}";
+gunzip "$file";
+sed "s/umiout\/$prefix.dot.gz/$prefix/" "umiout/$prefix.dot" > "fixed/$prefix.dot";
+dot -Tpdf "fixed/$prefix.dot" -o "fixed/$prefix.pdf";
 done
 ls fixed