# HG changeset patch # User galaxytrakr # Date 1777578727 0 # Node ID 36d49a2e6bbe71ca339b44ac3fb8134d0711c9e8 # Parent 706b2bbc64edbbf4d9b87698b8ecf944624a8ec6 planemo upload commit cf01f51a17a43906355f9545ece73a4e671e258b diff -r 706b2bbc64ed -r 36d49a2e6bbe plasmidtrakr.xml --- a/plasmidtrakr.xml Thu Apr 30 19:40:55 2026 +0000 +++ b/plasmidtrakr.xml Thu Apr 30 19:52:07 2026 +0000 @@ -1,4 +1,4 @@ - + Screens assemblies against a Mash database and predicts isolate source using a trained machine learning model @@ -9,7 +9,7 @@ mash_results.tabular + > '${input_name}_mash.tabular' && ## 3. Conditional Logic: Check if Mash produced hits - ## [ -s file ] checks if file exists and has size > 0 - if [ -s mash_results.tabular ]; then - ## Run the prediction script only if there is data - python $__tool_directory__/predict_source.py - -i mash_results.tabular - -b '$model_selection.fields.path' - -t $threshold - -o '$prediction_output'; + if [ \$(wc -l < '${input_name}_mash.tabular') -ge 2 ]; then + python $__tool_directory__/predict_source.py + -i '${input_name}_mash.tabular' + -b '$model_selection.fields.path' + -t $threshold + -o '$prediction_output'; ## Optional: If the script ran but produced no results (e.g. filtered out) ## ensure we still provide the "No Prediction" fallback - if [ \$(wc -l < '$prediction_output') -le 1 ]; then + if [ ! -s '$prediction_output' ] || [ \$(wc -l < '$prediction_output') -le 1 ]; then echo -e "Run\tPredicted_Source\tConfidence_Score" > '$prediction_output'; echo -e "${input_name}\tNo Prediction\t0.0" >> '$prediction_output'; fi