Mercurial > repos > galaxytrakr > plasmidtrakr
comparison plasmidtrakr.xml @ 16:706b2bbc64ed draft
planemo upload commit e5fa85f6befc345ab8f2b0af283f96834038cefd
| author | galaxytrakr |
|---|---|
| date | Thu, 30 Apr 2026 19:40:55 +0000 |
| parents | 58006290e654 |
| children | 36d49a2e6bbe |
comparison
equal
deleted
inserted
replaced
| 15:58006290e654 | 16:706b2bbc64ed |
|---|---|
| 1 <tool id="plasmidtrakr" name="PlasmidTrakr" version="0.2.1"> | 1 <tool id="plasmidtrakr" name="PlasmidTrakr" version="0.2.2"> |
| 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. Create a sanitized variable for the input name (removes spaces/special chars for the shell) | 11 ## 1. Setup names and database |
| 12 #set $input_name = $assembly_input.element_identifier.replace(" ", "_") | 12 #set $input_name = $assembly_input.element_identifier.replace(" ", "_") |
| 13 | |
| 14 ## 2. Symlink the Mash database | |
| 15 ln -s '$mash_database.fields.path' queries.msh && | 13 ln -s '$mash_database.fields.path' queries.msh && |
| 16 | 14 |
| 17 ## 3. Run Mash Screen | 15 ## 2. Run Mash Screen |
| 18 ## We redirect the output to a file named after the original input | |
| 19 mash screen | 16 mash screen |
| 20 -w | 17 -w |
| 21 -i $threshold | 18 -i $threshold |
| 22 queries.msh | 19 queries.msh |
| 23 '$assembly_input' | 20 '$assembly_input' |
| 24 > '${input_name}.tabular' | 21 > mash_results.tabular |
| 25 && | 22 && |
| 26 | 23 |
| 27 ## 4. Run PlasmidTrakr prediction | 24 ## 3. Conditional Logic: Check if Mash produced hits |
| 28 ## We pass the newly named file to the python script | 25 ## [ -s file ] checks if file exists and has size > 0 |
| 29 python $__tool_directory__/predict_source.py | 26 if [ -s mash_results.tabular ]; then |
| 30 -i '${input_name}.tabular' | 27 ## Run the prediction script only if there is data |
| 31 -b '$model_selection.fields.path' | 28 python $__tool_directory__/predict_source.py |
| 32 -t $threshold | 29 -i mash_results.tabular |
| 33 -o '$prediction_output' | 30 -b '$model_selection.fields.path' |
| 31 -t $threshold | |
| 32 -o '$prediction_output'; | |
| 33 | |
| 34 ## Optional: If the script ran but produced no results (e.g. filtered out) | |
| 35 ## ensure we still provide the "No Prediction" fallback | |
| 36 if [ \$(wc -l < '$prediction_output') -le 1 ]; then | |
| 37 echo -e "Run\tPredicted_Source\tConfidence_Score" > '$prediction_output'; | |
| 38 echo -e "${input_name}\tNo Prediction\t0.0" >> '$prediction_output'; | |
| 39 fi | |
| 40 else | |
| 41 ## Skip Python and create the fallback file immediately | |
| 42 echo -e "Run\tPredicted_Source\tConfidence_Score" > '$prediction_output'; | |
| 43 echo -e "${input_name}\tNo Prediction\t0.0" >> '$prediction_output'; | |
| 44 fi | |
| 34 ]]></command> | 45 ]]></command> |
| 35 | |
| 36 | 46 |
| 37 <inputs> | 47 <inputs> |
| 38 <param name="assembly_input" type="data" format="fasta,fasta.gz,fastq,fastq.gz" label="Genome Assembly / Reads" help="The FASTA/FASTQ file containing the isolate sequence."/> | 48 <param name="assembly_input" type="data" format="fasta,fasta.gz,fastq,fastq.gz" label="Genome Assembly / Reads" help="The FASTA/FASTQ file containing the isolate sequence."/> |
| 39 | 49 |
| 40 <param name="mash_database" type="select" label="Select Mash Database" help="Choose the pre-computed Mash sketch database to screen against."> | 50 <param name="mash_database" type="select" label="Select Mash Database" help="Choose the pre-computed Mash sketch database to screen against."> |
