Mercurial > repos > iuc > lexicmap
comparison lexicmap.xml @ 3:73480ee77517 draft
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/lexicmap commit a9227295a4cebc34b17def7b5ca3e4506222b963
| author | iuc |
|---|---|
| date | Fri, 26 Sep 2025 20:46:49 +0000 |
| parents | 73accf8f68a9 |
| children | 0004a511baff |
comparison
equal
deleted
inserted
replaced
| 2:73accf8f68a9 | 3:73480ee77517 |
|---|---|
| 5 </macros> | 5 </macros> |
| 6 <expand macro="bio_tools"/> | 6 <expand macro="bio_tools"/> |
| 7 <expand macro="requirements"/> | 7 <expand macro="requirements"/> |
| 8 | 8 |
| 9 <command detect_errors="exit_code"><![CDATA[ | 9 <command detect_errors="exit_code"><![CDATA[ |
| 10 | 10 #if $db_opts.db_opts_selector == "histdb" |
| 11 lexicmap search | 11 #set INDICES = [db.extra_files_path for db in $db_opts.histdb] |
| 12 | 12 #else: |
| 13 --threads "\${GALAXY_SLOTS:-1}" | 13 #set INDICES = $db_opts.lexicmap_index.fields.path.split(",") |
| 14 | 14 #end if |
| 15 ${load_whole_seeds} | 15 |
| 16 ${all} | 16 extract_query_ids() { |
| 17 | 17 local input_files="\$1"; |
| 18 #if $db_opts.db_opts_selector == "histdb" | 18 local query_ids=""; |
| 19 --index '${db_opts.histdb.extra_files_path}' | 19 IFS=',' read -ra files <<< "\$input_files"; |
| 20 #else: | 20 query_ids=""; |
| 21 --index '${db_opts.lexicmap_index.fields.path}' | 21 for query_file in "\${files[@]}"; do |
| 22 #end if | 22 if file --mime-type "\$query_file" | grep -q "gzip"; then |
| 23 | 23 query_ids+=\$(zcat "\$query_file" | grep '^>' | while IFS= read -r line; do clean="\${line#>}"; echo "\${clean%% *}>"; done); |
| 24 #for $q in $query | 24 else |
| 25 '$q' | 25 query_ids+=\$(cat "\$query_file" | grep '^>' | while IFS= read -r line; do clean="\${line#>}"; echo "\${clean%% *}>"; done); |
| 26 #end for | 26 fi |
| 27 | 27 done; |
| 28 --out-file '$out_file' | 28 declare -g -a query_array=(); |
| 29 | 29 IFS='>' read -r -a query_array <<< "\$query_ids"; |
| 30 --top-n-genomes '$top_n_genomes' | 30 } |
| 31 | 31 && |
| 32 --align-band '$align_band' | 32 #for $counter, $index in enumerate($INDICES): |
| 33 --align-ext-len '$align_ext_len' | 33 lexicmap search |
| 34 --align-max-gap '$align_max_gap' | 34 |
| 35 --align-min-match-len '$align_min_match_len' | 35 --threads "\${GALAXY_SLOTS:-1}" |
| 36 --align-min-match-pident '$align_min_match_pident' | 36 |
| 37 --max-evalue '$max_evalue' | 37 ${load_whole_seeds} |
| 38 --max-query-conc '$max_query_conc' | 38 ${all} |
| 39 --seed-max-dist '$seed_max_dist' | 39 |
| 40 --seed-max-gap '$seed_max_gap' | 40 --index '${index}' |
| 41 --seed-min-prefix '$seed_min_prefix' | 41 |
| 42 --seed-min-single-prefix '$seed_min_single_prefix' | 42 #for $q in $query |
| 43 | 43 '$q' |
| 44 #if $min_qcov_per_genome | 44 #end for |
| 45 --min-qcov-per-genome '$min_qcov_per_genome' | 45 |
| 46 #end if | 46 --out-file 'lexicmap_search_result__index${counter}.tsv' |
| 47 | 47 |
| 48 #if $min_qcov_per_hsp | 48 --top-n-genomes '$top_n_genomes' |
| 49 --min-qcov-per-hsp '$min_qcov_per_hsp' | 49 |
| 50 #end if | 50 --align-band '$align_band' |
| 51 | 51 --align-ext-len '$align_ext_len' |
| 52 --align-max-gap '$align_max_gap' | |
| 53 --align-min-match-len '$align_min_match_len' | |
| 54 --align-min-match-pident '$align_min_match_pident' | |
| 55 --max-evalue '$max_evalue' | |
| 56 --max-query-conc '$max_query_conc' | |
| 57 --seed-max-dist '$seed_max_dist' | |
| 58 --seed-max-gap '$seed_max_gap' | |
| 59 --seed-min-prefix '$seed_min_prefix' | |
| 60 --seed-min-single-prefix '$seed_min_single_prefix' | |
| 61 | |
| 62 #if $min_qcov_per_genome | |
| 63 --min-qcov-per-genome '$min_qcov_per_genome' | |
| 64 #end if | |
| 65 | |
| 66 #if $min_qcov_per_hsp | |
| 67 --min-qcov-per-hsp '$min_qcov_per_hsp' | |
| 68 #end if | |
| 69 && | |
| 70 #end for | |
| 71 | |
| 72 #if len($INDICES) > 1 | |
| 73 counter=0 && | |
| 74 extract_query_ids '$query' && | |
| 75 for ((i=0; i<\${#query_array[@]}; i++)); do | |
| 76 counter=\$((counter + 1)); | |
| 77 lexicmap utils merge-search-results | |
| 78 --out-file "combined_result.\${counter}.tsv" | |
| 79 -q "\${query_array[\$i]}" lexicmap_search_result__index*.tsv | |
| 80 -j "\${GALAXY_SLOTS:-1}"; | |
| 81 done && | |
| 82 cat combined_result.*.tsv | awk 'NR==1 || $0 !~ /^query\tqlen\thits/' > '$out_file' | |
| 83 #else | |
| 84 mv lexicmap_search_result__index0.tsv '$out_file' | |
| 85 #end if | |
| 52 ]]></command> | 86 ]]></command> |
| 53 <inputs> | 87 <inputs> |
| 54 <param name="query" type="data" format="fasta.gz" label="LexicMap query file" multiple="true" help=""/> | 88 <param name="query" type="data" format="fasta.gz" label="LexicMap query file" multiple="true" help=""/> |
| 55 <conditional name="db_opts"> | 89 <conditional name="db_opts"> |
| 56 <param name="db_opts_selector" type="select" label="LexiMap index source"> | 90 <param name="db_opts_selector" type="select" label="LexiMap index source"> |
| 57 <option value="histdb" selected="true">From your history</option> | 91 <option value="histdb" selected="true">From your history</option> |
| 58 <option value="db">Locally installed LexicMap indexes</option> | 92 <option value="db">Locally installed LexicMap indexes</option> |
| 59 </param> | 93 </param> |
| 60 <when value="histdb"> | 94 <when value="histdb"> |
| 61 <param name="histdb" type="data" format="lexicmap_index" optional="false" label="LexicMap index" /> | 95 <param name="histdb" type="data" format="lexicmap_index" optional="false" multiple="true" label="LexicMap index" /> |
| 62 </when> | 96 </when> |
| 63 <when value="db"> | 97 <when value="db"> |
| 64 <param name="lexicmap_index" type="select" optional="false" label="LexicMap index file"> | 98 <param name="lexicmap_index" type="select" optional="false" multiple="true" label="LexicMap index file"> |
| 65 <options from_data_table="lexicmap_index"/> | 99 <options from_data_table="lexicmap_index"/> |
| 66 </param> | 100 </param> |
| 67 </when> | 101 </when> |
| 68 </conditional> | 102 </conditional> |
| 69 <param argument="--top-n-genomes" type="integer" value="0" label="Keep top N genome matches for a query (0 for all)" /> | 103 <param argument="--top-n-genomes" type="integer" value="0" label="Keep top N genome matches for a query (0 for all)" /> |
| 98 </conditional> | 132 </conditional> |
| 99 </actions> | 133 </actions> |
| 100 </data> | 134 </data> |
| 101 </outputs> | 135 </outputs> |
| 102 <tests> | 136 <tests> |
| 103 <!-- Test 1 - query a local index with one query --> | 137 <!-- Test 1 - query one local index with one query --> |
| 104 <test expect_num_outputs="1"> | 138 <test expect_num_outputs="1"> |
| 105 <conditional name="db_opts"> | 139 <conditional name="db_opts"> |
| 106 <param name="db_opts_selector" value="db"/> | 140 <param name="db_opts_selector" value="db"/> |
| 107 <param name="lexicmap_index" value="LexicMapIndex1" /> | 141 <param name="lexicmap_index" value="LexicMapIndex1" /> |
| 108 </conditional> | 142 </conditional> |
| 110 <section name="advanced_settings"> | 144 <section name="advanced_settings"> |
| 111 <param name="load_whole_seeds" value="true" /> | 145 <param name="load_whole_seeds" value="true" /> |
| 112 </section> | 146 </section> |
| 113 <output name="out_file" value="lexicmap_query_result.tsv" /> | 147 <output name="out_file" value="lexicmap_query_result.tsv" /> |
| 114 </test> | 148 </test> |
| 115 <!-- Test 2 - query a local index with multiple query files --> | 149 <!-- Test 2 - query one local index with multiple query files --> |
| 116 <test expect_num_outputs="1"> | 150 <test expect_num_outputs="1"> |
| 117 <conditional name="db_opts"> | 151 <conditional name="db_opts"> |
| 118 <param name="db_opts_selector" value="db"/> | 152 <param name="db_opts_selector" value="db"/> |
| 119 <param name="lexicmap_index" value="LexicMapIndex1" /> | 153 <param name="lexicmap_index" value="LexicMapIndex1" /> |
| 120 </conditional> | 154 </conditional> |
| 122 <section name="advanced_settings"> | 156 <section name="advanced_settings"> |
| 123 <param name="load_whole_seeds" value="true" /> | 157 <param name="load_whole_seeds" value="true" /> |
| 124 </section> | 158 </section> |
| 125 <output name="out_file" value="lexicmap_query_result2.tsv" /> | 159 <output name="out_file" value="lexicmap_query_result2.tsv" /> |
| 126 </test> | 160 </test> |
| 127 <!-- Test 3 - query a index found in the history with one query --> | 161 <!-- Test 3 - query two local index with one query file --> |
| 162 <test expect_num_outputs="1"> | |
| 163 <conditional name="db_opts"> | |
| 164 <param name="db_opts_selector" value="db"/> | |
| 165 <param name="lexicmap_index" value="LexicMapIndexCombined" /> | |
| 166 </conditional> | |
| 167 <param name="query" value="lexicmap_query.fasta.gz" /> | |
| 168 <section name="advanced_settings"> | |
| 169 <param name="load_whole_seeds" value="true" /> | |
| 170 </section> | |
| 171 <output name="out_file" value="lexicmap_query_result.tsv" /> | |
| 172 </test> | |
| 173 <!-- Test 4 - query two local index with multiple query files --> | |
| 174 <test expect_num_outputs="1"> | |
| 175 <conditional name="db_opts"> | |
| 176 <param name="db_opts_selector" value="db"/> | |
| 177 <param name="lexicmap_index" value="LexicMapIndexCombined" /> | |
| 178 </conditional> | |
| 179 <param name="query" value="lexicmap_query.fasta.gz,lexicmap_query2.fasta.gz,lexicmap_query3.fasta" /> | |
| 180 <section name="advanced_settings"> | |
| 181 <param name="load_whole_seeds" value="true" /> | |
| 182 </section> | |
| 183 <output name="out_file" value="lexicmap_query_result4.tsv" /> | |
| 184 </test> | |
| 185 <!-- Test 5 - query one local index with multiple query files, where only one query will get hits --> | |
| 186 <test expect_num_outputs="1"> | |
| 187 <conditional name="db_opts"> | |
| 188 <param name="db_opts_selector" value="db"/> | |
| 189 <param name="lexicmap_index" value="LexicMapIndex2" /> | |
| 190 </conditional> | |
| 191 <param name="query" value="lexicmap_query.fasta.gz,lexicmap_query2.fasta.gz,lexicmap_query3.fasta" /> | |
| 192 <section name="advanced_settings"> | |
| 193 <param name="load_whole_seeds" value="true" /> | |
| 194 </section> | |
| 195 <output name="out_file" value="lexicmap_query_result3.tsv" /> | |
| 196 </test> | |
| 197 <!-- Test 6 - query multiple local index with multiple query files --> | |
| 198 <test expect_num_outputs="1"> | |
| 199 <conditional name="db_opts"> | |
| 200 <param name="db_opts_selector" value="db"/> | |
| 201 <param name="lexicmap_index" value="LexicMapIndex1,LexicMapIndex2,LexicMapIndexCombined" /> | |
| 202 </conditional> | |
| 203 | |
| 204 <param name="query" value="lexicmap_query.fasta.gz,lexicmap_query2.fasta.gz,lexicmap_query3.fasta" /> | |
| 205 <section name="advanced_settings"> | |
| 206 <param name="load_whole_seeds" value="true" /> | |
| 207 </section> | |
| 208 <output name="out_file" value="lexicmap_query_result6.tsv" /> | |
| 209 </test> | |
| 210 <!-- Test 7 - query one index found in the history with one query --> | |
| 128 <test expect_num_outputs="1"> | 211 <test expect_num_outputs="1"> |
| 129 <conditional name="db_opts"> | 212 <conditional name="db_opts"> |
| 130 <param name="db_opts_selector" value="histdb"/> | 213 <param name="db_opts_selector" value="histdb"/> |
| 131 <param name="histdb" ftype="lexicmap_index" class="Directory" value="db.lmi" /> | 214 <param name="histdb" ftype="lexicmap_index" class="Directory" value="db.lmi" /> |
| 132 </conditional> | 215 </conditional> |
| 134 <param name="query" value="lexicmap_query.fasta.gz" /> | 217 <param name="query" value="lexicmap_query.fasta.gz" /> |
| 135 <section name="advanced_settings"> | 218 <section name="advanced_settings"> |
| 136 <param name="load_whole_seeds" value="true" /> | 219 <param name="load_whole_seeds" value="true" /> |
| 137 </section> | 220 </section> |
| 138 <output name="out_file" value="lexicmap_query_result.tsv" /> | 221 <output name="out_file" value="lexicmap_query_result.tsv" /> |
| 222 </test> | |
| 223 <!-- Test 8 - query two index found in the history with one query --> | |
| 224 <test expect_num_outputs="1"> | |
| 225 <conditional name="db_opts"> | |
| 226 <param name="db_opts_selector" value="histdb"/> | |
| 227 <param name="histdb" ftype="lexicmap_index" class="Directory" value="db.lmi,db2.lmi" /> | |
| 228 </conditional> | |
| 229 <param name="top_n_genomes" value="0" /> | |
| 230 <param name="query" value="lexicmap_query.fasta.gz,lexicmap_query3.fasta" /> | |
| 231 <section name="advanced_settings"> | |
| 232 <param name="load_whole_seeds" value="true" /> | |
| 233 </section> | |
| 234 <output name="out_file" value="lexicmap_query_result5.tsv" /> | |
| 139 </test> | 235 </test> |
| 140 </tests> | 236 </tests> |
| 141 <help><![CDATA[ | 237 <help><![CDATA[ |
| 142 | 238 |
| 143 Search sequences against an LexicMap index Database. For more information about settings | 239 Search sequences against an LexicMap index Database. For more information about settings |
| 170 21. cigar, CIGAR string of the alignment. (optional with --all) | 266 21. cigar, CIGAR string of the alignment. (optional with --all) |
| 171 22. qseq, Aligned part of query sequence. (optional with --all) | 267 22. qseq, Aligned part of query sequence. (optional with --all) |
| 172 23. sseq, Aligned part of subject sequence. (optional with --all) | 268 23. sseq, Aligned part of subject sequence. (optional with --all) |
| 173 24. align, Alignment text ("|" and " ") between qseq and sseq. (optional with --all) | 269 24. align, Alignment text ("|" and " ") between qseq and sseq. (optional with --all) |
| 174 | 270 |
| 271 When running against multiple indices lexicmap utils merge-search-results will be used to | |
| 272 merge the search results. For more information please visit: | |
| 273 https://bioinf.shenwei.me/LexicMap/usage/utils/merge-search-results/ | |
| 274 | |
| 275 Note: if the query id contains spaces, only the first part (before the first space) will be kept as the query id. | |
| 175 @info@ | 276 @info@ |
| 176 ]]></help> | 277 ]]></help> |
| 177 <expand macro="citations" /> | 278 <expand macro="citations" /> |
| 178 </tool> | 279 </tool> |
