comparison data_manager/salmon_index_builder.xml @ 9:ad0ad1f6623e draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/data_managers/data_manager_salmon_index_builder commit 940b8237169a0a16541bd3bc340b085c95fb5bd7
author iuc
date Fri, 07 Nov 2025 07:58:18 +0000
parents e1bbef81b470
children
comparison
equal deleted inserted replaced
8:e1bbef81b470 9:ad0ad1f6623e
1 <tool id="salmon_index_builder_data_manager" name="Salmon" tool_type="manage_data" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="24.0"> 1 <tool id="salmon_index_builder_data_manager" name="Salmon" tool_type="manage_data" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="24.0">
2 <description>index builder</description> 2 <description>index builder</description>
3 <macros> 3 <macros>
4 <token name="@TOOL_VERSION@">1.10.1</token> 4 <token name="@TOOL_VERSION@">1.10.1</token>
5 <token name="@VERSION_SUFFIX@">0</token> 5 <token name="@VERSION_SUFFIX@">1</token>
6 <token name="@PROFILE@">24.0</token> 6 <token name="@PROFILE@">24.0</token>
7 <token name="@IDX_VERSION@">q7</token> 7 <token name="@IDX_VERSION@">q7</token>
8 </macros> 8 </macros>
9 <requirements> 9 <requirements>
10 <requirement type="package" version="@TOOL_VERSION@">salmon</requirement> 10 <requirement type="package" version="@TOOL_VERSION@">salmon</requirement>
11 </requirements> 11 </requirements>
12 <version_command><![CDATA[salmon --no-version-check --version | cut -d" " -f2]]></version_command>
12 <command detect_errors="exit_code"><![CDATA[ 13 <command detect_errors="exit_code"><![CDATA[
13 ## salmon uses one thread to much 14 ## salmon uses one thread to much
15 ## https://github.com/COMBINE-lab/salmon/issues/993
14 SLOTS=\$(( \${GALAXY_SLOTS:-12} > 1 ? \${GALAXY_SLOTS:-12} - 1 : 1 )); 16 SLOTS=\$(( \${GALAXY_SLOTS:-12} > 1 ? \${GALAXY_SLOTS:-12} - 1 : 1 ));
15 17
16 ## https://combine-lab.github.io/alevin-tutorial/2019/selective-alignment/ 18 ## https://combine-lab.github.io/alevin-tutorial/2019/selective-alignment/
17 ## https://salmon.readthedocs.io/en/latest/salmon.html#preparing-transcriptome-indices-mapping-based-mode 19 ## https://salmon.readthedocs.io/en/latest/salmon.html#preparing-transcriptome-indices-mapping-based-mode
18
19 #for $transcripts in $transcriptome.fields.path.split(",") 20 #for $transcripts in $transcriptome.fields.path.split(",")
20 (zcat '$transcripts' 2>/dev/null || cat '$transcripts') >> gentrome.fa && 21 (zcat '$transcripts' 2>/dev/null || cat '$transcripts') >> gentrome.fa &&
21 #end for 22 #end for
22 (zcat '$all_fasta_source.fields.path' 2>/dev/null || cat '$all_fasta_source.fields.path') >> gentrome.fa && 23 (zcat '$all_fasta_source.fields.path' 2>/dev/null || cat '$all_fasta_source.fields.path') >> gentrome.fa &&
23 24
24 (zcat '$all_fasta_source.fields.path' 2>/dev/null || cat '$all_fasta_source.fields.path') | awk '{if($1 ~ /^>/) print $1}' | cut -c2- | tr -d " " > decoys.txt && 25 (zcat '$all_fasta_source.fields.path' 2>/dev/null || cat '$all_fasta_source.fields.path') | awk '{if($1 ~ /^>/) print $1}' | cut -c2- | tr -d " " > decoys.txt &&
25 26
26 mkdir '$out_file.extra_files_path' && 27 mkdir '$out_file.extra_files_path' &&
27 28
28 salmon index 29 salmon --no-version-check index
29 -k $kmer_size 30 -k $kmer_size
30 -t gentrome.fa 31 -t gentrome.fa
31 -d decoys.txt 32 -d decoys.txt
32 -i '$out_file.extra_files_path' 33 -i '$out_file.extra_files_path'
33 -p "\$SLOTS" 34 -p "\$SLOTS"
35 && 36 &&
36 37
37 cp '$dmjson' '$out_file' 38 cp '$dmjson' '$out_file'
38 ]]></command> 39 ]]></command>
39 <configfiles> 40 <configfiles>
40 <configfile name="dmjson"><![CDATA[{ 41 <configfile name="dmjson"><![CDATA[#slurp
42 #import os
43 #def combine(strings, sep):
44 #set lcp = os.path.commonprefix(strings)
45 #set value = lcp + sep.join([s[len(lcp):] for s in strings])
46 #return $value
47 #end def
41 #if str($sequence_id).strip() == "" 48 #if str($sequence_id).strip() == ""
42 #set sequence_id = $transcriptome.fields.value 49 #set sequence_id = $combine($transcriptome.fields.value.split(","), "_")
43 #end if 50 #end if
44 #if str($sequence_name).strip() == "" 51 #if str($sequence_name).strip() == ""
45 #set sequence_name = $transcriptome.fields.name 52 #set sequence_name = $combine($transcriptome.fields.name.split(","), " + ")
46 #end if 53 #end if
47 54 {
48 "data_tables":{ 55 "data_tables":{
49 "salmon_indexes_versioned":[ 56 "salmon_indexes_versioned":[
50 { 57 {
51 "value": "$sequence_id", 58 "value": "$sequence_id",
52 "dbkey": "$all_fasta_source.fields.dbkey", 59 "dbkey": "$all_fasta_source.fields.dbkey",
57 ] 64 ]
58 } 65 }
59 }]]></configfile> 66 }]]></configfile>
60 </configfiles> 67 </configfiles>
61 <inputs> 68 <inputs>
62 <param label="Transcriptome sequences" name="transcriptome" optional="false" type="select"> 69 <param label="Transcriptome sequences" name="transcriptome" optional="false" multiple="true" type="select">
63 <options from_data_table="transcriptomes" /> 70 <options from_data_table="transcriptomes" />
64 </param> 71 </param>
65 <param label="Genome" name="all_fasta_source" optional="false" type="select"> 72 <param label="Genome" name="all_fasta_source" optional="false" type="select">
66 <options from_data_table="all_fasta" /> 73 <options from_data_table="all_fasta"/>
67 </param> 74 </param>
68 <param name="sequence_name" type="text" value="" label="Name of sequence" /> 75 <param name="sequence_name" type="text" value="" label="Name of sequence" help="default: common prefix of the transcriptome names plus the non-common parts joined by ' + '" />
69 <param name="sequence_id" type="text" value="" label="ID for sequence" /> 76 <param name="sequence_id" type="text" value="" label="ID for sequence" help="default: common prefix of the transcriptome IDs plus the non-common parts joined by '_'"/>
70 <param name="kmer_size" type="integer" optional='true' value="31" max="32" label="The size of the k-mer on which the index is built" 77 <param name="kmer_size" type="integer" optional='true' value="31" max="32" label="The size of the k-mer on which the index is built"
71 help="There is a tradeoff here between the distinctiveness of the k-mers and their robustness to errors. The shorter the k-mers, the more robust they will be to errors in the reads, but the longer the k-mers, the more distinct they will be. We generally recommend using a k-mer size of at least 20. MUST BE AN ODD VALUE "> 78 help="There is a tradeoff here between the distinctiveness of the k-mers and their robustness to errors. The shorter the k-mers, the more robust they will be to errors in the reads, but the longer the k-mers, the more distinct they will be. We generally recommend using a k-mer size of at least 20. MUST BE AN ODD VALUE ">
72 <validator type="expression" message="Only odd values">value % 2 == 1</validator> 79 <validator type="expression" message="Only odd values">value % 2 == 1</validator>
73 </param> 80 </param>
74 <param name="gencode" type="boolean" label="Transcript sequences are in gencode format" truevalue="--gencode" falsevalue="" checked="false" help="Will split the transcript name at the first '|' character. These reduced names will be used in the output and when looking for these transcripts in a gene to transcript GTF."/> 81 <param name="gencode" type="boolean" label="Transcript sequences are in gencode format" truevalue="--gencode" falsevalue="" checked="false" help="Will split the transcript name at the first '|' character. These reduced names will be used in the output and when looking for these transcripts in a gene to transcript GTF."/>
76 <outputs> 83 <outputs>
77 <data name="out_file" format="data_manager_json" /> 84 <data name="out_file" format="data_manager_json" />
78 </outputs> 85 </outputs>
79 <tests> 86 <tests>
80 <test> 87 <test>
81 <param name="transcriptome" value="phiX174"/> 88 <param name="transcriptome" value="phiX1741,phiX1742"/>
82 <param name="all_fasta_source" value="phiX174"/> 89 <param name="all_fasta_source" value="phiX174"/>
83 <param name="sequence_name" value="sequence_name"/>
84 <param name="sequence_id" value="sequence_id"/>
85 <output name="out_file"> 90 <output name="out_file">
86 <assert_contents> 91 <assert_contents>
87 <has_text text='"salmon_indexes_versioned"' /> 92 <has_text text='"salmon_indexes_versioned"' />
88 <has_text text='"dbkey": "phiX174"' /> 93 <has_text text='"dbkey": "phiX174"' />
89 <has_text text='"name": "sequence_name"' /> 94 <has_text text='"name": "phiX174: 1 + 2"' />
90 <has_text text='"value": "sequence_id"' /> 95 <has_text text='"value": "phiX1741_2"' />
91 <has_text text='"version": "q7"' /> 96 <has_text text='"version": "q7"' />
92 <has_text text='"path":' /> 97 <has_text text='"path":' />
93 </assert_contents> 98 </assert_contents>
94 </output> 99 </output>
95 </test> 100 </test>
96 <test> 101 <test>
97 <param name="transcriptome" value="phiX174"/> 102 <param name="transcriptome" value="phiX1741"/>
98 <param name="all_fasta_source" value="phiX174"/> 103 <param name="all_fasta_source" value="phiX174"/>
99 <param name="sequence_name" value=""/>
100 <param name="sequence_id" value=""/>
101 <output name="out_file"> 104 <output name="out_file">
102 <assert_contents> 105 <assert_contents>
103 <has_text text='"salmon_indexes_versioned"' /> 106 <has_text text='"salmon_indexes_versioned"' />
104 <has_text text='"dbkey": "phiX174"' /> 107 <has_text text='"dbkey": "phiX174"' />
105 <has_text text='"name": "phiX174"' /> 108 <has_text text='"name": "phiX174: 1"' />
106 <has_text text='"value": "phiX174"' /> 109 <has_text text='"value": "phiX1741"' />
110 <has_text text='"version": "q7"' />
111 <has_text text='"path":' />
112 </assert_contents>
113 </output>
114 </test>
115 <test>
116 <param name="transcriptome" value="phiX1741"/>
117 <param name="all_fasta_source" value="phiX174"/>
118 <param name="sequence_name" value="name_override"/>
119 <param name="sequence_id" value="value_override"/>
120 <output name="out_file">
121 <assert_contents>
122 <has_text text='"salmon_indexes_versioned"' />
123 <has_text text='"dbkey": "phiX174"' />
124 <has_text text='"name": "name_override"' />
125 <has_text text='"value": "value_override"' />
107 <has_text text='"version": "q7"' /> 126 <has_text text='"version": "q7"' />
108 <has_text text='"path":' /> 127 <has_text text='"path":' />
109 </assert_contents> 128 </assert_contents>
110 </output> 129 </output>
111 </test> 130 </test>