Mercurial > repos > galaxytrakr > plasmidtrakr
comparison plasmidtrakr.xml @ 17:36d49a2e6bbe draft default tip
planemo upload commit cf01f51a17a43906355f9545ece73a4e671e258b
| author | galaxytrakr |
|---|---|
| date | Thu, 30 Apr 2026 19:52:07 +0000 |
| parents | 706b2bbc64ed |
| children |
comparison
equal
deleted
inserted
replaced
| 16:706b2bbc64ed | 17:36d49a2e6bbe |
|---|---|
| 1 <tool id="plasmidtrakr" name="PlasmidTrakr" version="0.2.2"> | 1 <tool id="plasmidtrakr" name="PlasmidTrakr" version="0.2.3"> |
| 2 <description>Screens assemblies against a Mash database and predicts isolate source using a trained machine learning model</description> | 2 <description>Screens assemblies against a Mash database and predicts isolate source using a trained machine learning model</description> |
| 3 | 3 |
| 4 <requirements> | 4 <requirements> |
| 5 <requirement type="package" version="2.3">mash</requirement> | 5 <requirement type="package" version="2.3">mash</requirement> |
| 6 <requirement type="package" version="2.3.3">pandas</requirement> | 6 <requirement type="package" version="2.3.3">pandas</requirement> |
| 7 <requirement type="package" version="1.6.1">scikit-learn</requirement> | 7 <requirement type="package" version="1.6.1">scikit-learn</requirement> |
| 8 </requirements> | 8 </requirements> |
| 9 | 9 |
| 10 <command detect_errors="exit_code"><![CDATA[ | 10 <command detect_errors="exit_code"><![CDATA[ |
| 11 ## 1. Setup names and database | 11 ## 1. Setup names and database |
| 12 #set $input_name = $assembly_input.element_identifier.replace(" ", "_") | 12 #set $input_name = $assembly_input.element_identifier.replace(" ", "_").replace(".", "_") |
| 13 ln -s '$mash_database.fields.path' queries.msh && | 13 ln -s '$mash_database.fields.path' queries.msh && |
| 14 | 14 |
| 15 ## 2. Run Mash Screen | 15 ## 2. Run Mash Screen |
| 16 mash screen | 16 mash screen |
| 17 -w | 17 -w |
| 18 -i $threshold | 18 -i $threshold |
| 19 queries.msh | 19 queries.msh |
| 20 '$assembly_input' | 20 '$assembly_input' |
| 21 > mash_results.tabular | 21 > '${input_name}_mash.tabular' |
| 22 && | 22 && |
| 23 | 23 |
| 24 ## 3. Conditional Logic: Check if Mash produced hits | 24 ## 3. Conditional Logic: Check if Mash produced hits |
| 25 ## [ -s file ] checks if file exists and has size > 0 | 25 if [ \$(wc -l < '${input_name}_mash.tabular') -ge 2 ]; then |
| 26 if [ -s mash_results.tabular ]; then | 26 python $__tool_directory__/predict_source.py |
| 27 ## Run the prediction script only if there is data | 27 -i '${input_name}_mash.tabular' |
| 28 python $__tool_directory__/predict_source.py | 28 -b '$model_selection.fields.path' |
| 29 -i mash_results.tabular | 29 -t $threshold |
| 30 -b '$model_selection.fields.path' | 30 -o '$prediction_output'; |
| 31 -t $threshold | |
| 32 -o '$prediction_output'; | |
| 33 | 31 |
| 34 ## Optional: If the script ran but produced no results (e.g. filtered out) | 32 ## Optional: If the script ran but produced no results (e.g. filtered out) |
| 35 ## ensure we still provide the "No Prediction" fallback | 33 ## ensure we still provide the "No Prediction" fallback |
| 36 if [ \$(wc -l < '$prediction_output') -le 1 ]; then | 34 if [ ! -s '$prediction_output' ] || [ \$(wc -l < '$prediction_output') -le 1 ]; then |
| 37 echo -e "Run\tPredicted_Source\tConfidence_Score" > '$prediction_output'; | 35 echo -e "Run\tPredicted_Source\tConfidence_Score" > '$prediction_output'; |
| 38 echo -e "${input_name}\tNo Prediction\t0.0" >> '$prediction_output'; | 36 echo -e "${input_name}\tNo Prediction\t0.0" >> '$prediction_output'; |
| 39 fi | 37 fi |
| 40 else | 38 else |
| 41 ## Skip Python and create the fallback file immediately | 39 ## Skip Python and create the fallback file immediately |
