annotate 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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
17
36d49a2e6bbe planemo upload commit cf01f51a17a43906355f9545ece73a4e671e258b
galaxytrakr
parents: 16
diff changeset
1 <tool id="plasmidtrakr" name="PlasmidTrakr" version="0.2.3">
14
9a84b8511fc2 planemo upload commit 6681312523efb1b57807ea244c63f9cbb02c574e
galaxytrakr
parents: 13
diff changeset
2 <description>Screens assemblies against a Mash database and predicts isolate source using a trained machine learning model</description>
9a84b8511fc2 planemo upload commit 6681312523efb1b57807ea244c63f9cbb02c574e
galaxytrakr
parents: 13
diff changeset
3
0
f25631df0e9f planemo upload commit 25e4c800a5358b8615dac18ea5e908e31c534020
galaxytrakr
parents:
diff changeset
4 <requirements>
14
9a84b8511fc2 planemo upload commit 6681312523efb1b57807ea244c63f9cbb02c574e
galaxytrakr
parents: 13
diff changeset
5 <requirement type="package" version="2.3">mash</requirement>
13
6eaad34862cb planemo upload commit 74ae4c98abbbea693de70e76434089d1d58ff87a
galaxytrakr
parents: 12
diff changeset
6 <requirement type="package" version="2.3.3">pandas</requirement>
6eaad34862cb planemo upload commit 74ae4c98abbbea693de70e76434089d1d58ff87a
galaxytrakr
parents: 12
diff changeset
7 <requirement type="package" version="1.6.1">scikit-learn</requirement>
0
f25631df0e9f planemo upload commit 25e4c800a5358b8615dac18ea5e908e31c534020
galaxytrakr
parents:
diff changeset
8 </requirements>
f25631df0e9f planemo upload commit 25e4c800a5358b8615dac18ea5e908e31c534020
galaxytrakr
parents:
diff changeset
9
f25631df0e9f planemo upload commit 25e4c800a5358b8615dac18ea5e908e31c534020
galaxytrakr
parents:
diff changeset
10 <command detect_errors="exit_code"><![CDATA[
16
706b2bbc64ed planemo upload commit e5fa85f6befc345ab8f2b0af283f96834038cefd
galaxytrakr
parents: 15
diff changeset
11 ## 1. Setup names and database
17
36d49a2e6bbe planemo upload commit cf01f51a17a43906355f9545ece73a4e671e258b
galaxytrakr
parents: 16
diff changeset
12 #set $input_name = $assembly_input.element_identifier.replace(" ", "_").replace(".", "_")
14
9a84b8511fc2 planemo upload commit 6681312523efb1b57807ea244c63f9cbb02c574e
galaxytrakr
parents: 13
diff changeset
13 ln -s '$mash_database.fields.path' queries.msh &&
15
58006290e654 planemo upload commit 07e8ec488fa1fb8323b5e90bfc9842aa7337b950
galaxytrakr
parents: 14
diff changeset
14
16
706b2bbc64ed planemo upload commit e5fa85f6befc345ab8f2b0af283f96834038cefd
galaxytrakr
parents: 15
diff changeset
15 ## 2. Run Mash Screen
14
9a84b8511fc2 planemo upload commit 6681312523efb1b57807ea244c63f9cbb02c574e
galaxytrakr
parents: 13
diff changeset
16 mash screen
9a84b8511fc2 planemo upload commit 6681312523efb1b57807ea244c63f9cbb02c574e
galaxytrakr
parents: 13
diff changeset
17 -w
9a84b8511fc2 planemo upload commit 6681312523efb1b57807ea244c63f9cbb02c574e
galaxytrakr
parents: 13
diff changeset
18 -i $threshold
9a84b8511fc2 planemo upload commit 6681312523efb1b57807ea244c63f9cbb02c574e
galaxytrakr
parents: 13
diff changeset
19 queries.msh
9a84b8511fc2 planemo upload commit 6681312523efb1b57807ea244c63f9cbb02c574e
galaxytrakr
parents: 13
diff changeset
20 '$assembly_input'
17
36d49a2e6bbe planemo upload commit cf01f51a17a43906355f9545ece73a4e671e258b
galaxytrakr
parents: 16
diff changeset
21 > '${input_name}_mash.tabular'
14
9a84b8511fc2 planemo upload commit 6681312523efb1b57807ea244c63f9cbb02c574e
galaxytrakr
parents: 13
diff changeset
22 &&
15
58006290e654 planemo upload commit 07e8ec488fa1fb8323b5e90bfc9842aa7337b950
galaxytrakr
parents: 14
diff changeset
23
16
706b2bbc64ed planemo upload commit e5fa85f6befc345ab8f2b0af283f96834038cefd
galaxytrakr
parents: 15
diff changeset
24 ## 3. Conditional Logic: Check if Mash produced hits
17
36d49a2e6bbe planemo upload commit cf01f51a17a43906355f9545ece73a4e671e258b
galaxytrakr
parents: 16
diff changeset
25 if [ \$(wc -l < '${input_name}_mash.tabular') -ge 2 ]; then
36d49a2e6bbe planemo upload commit cf01f51a17a43906355f9545ece73a4e671e258b
galaxytrakr
parents: 16
diff changeset
26 python $__tool_directory__/predict_source.py
36d49a2e6bbe planemo upload commit cf01f51a17a43906355f9545ece73a4e671e258b
galaxytrakr
parents: 16
diff changeset
27 -i '${input_name}_mash.tabular'
36d49a2e6bbe planemo upload commit cf01f51a17a43906355f9545ece73a4e671e258b
galaxytrakr
parents: 16
diff changeset
28 -b '$model_selection.fields.path'
36d49a2e6bbe planemo upload commit cf01f51a17a43906355f9545ece73a4e671e258b
galaxytrakr
parents: 16
diff changeset
29 -t $threshold
36d49a2e6bbe planemo upload commit cf01f51a17a43906355f9545ece73a4e671e258b
galaxytrakr
parents: 16
diff changeset
30 -o '$prediction_output';
16
706b2bbc64ed planemo upload commit e5fa85f6befc345ab8f2b0af283f96834038cefd
galaxytrakr
parents: 15
diff changeset
31
706b2bbc64ed planemo upload commit e5fa85f6befc345ab8f2b0af283f96834038cefd
galaxytrakr
parents: 15
diff changeset
32 ## Optional: If the script ran but produced no results (e.g. filtered out)
706b2bbc64ed planemo upload commit e5fa85f6befc345ab8f2b0af283f96834038cefd
galaxytrakr
parents: 15
diff changeset
33 ## ensure we still provide the "No Prediction" fallback
17
36d49a2e6bbe planemo upload commit cf01f51a17a43906355f9545ece73a4e671e258b
galaxytrakr
parents: 16
diff changeset
34 if [ ! -s '$prediction_output' ] || [ \$(wc -l < '$prediction_output') -le 1 ]; then
16
706b2bbc64ed planemo upload commit e5fa85f6befc345ab8f2b0af283f96834038cefd
galaxytrakr
parents: 15
diff changeset
35 echo -e "Run\tPredicted_Source\tConfidence_Score" > '$prediction_output';
706b2bbc64ed planemo upload commit e5fa85f6befc345ab8f2b0af283f96834038cefd
galaxytrakr
parents: 15
diff changeset
36 echo -e "${input_name}\tNo Prediction\t0.0" >> '$prediction_output';
706b2bbc64ed planemo upload commit e5fa85f6befc345ab8f2b0af283f96834038cefd
galaxytrakr
parents: 15
diff changeset
37 fi
706b2bbc64ed planemo upload commit e5fa85f6befc345ab8f2b0af283f96834038cefd
galaxytrakr
parents: 15
diff changeset
38 else
706b2bbc64ed planemo upload commit e5fa85f6befc345ab8f2b0af283f96834038cefd
galaxytrakr
parents: 15
diff changeset
39 ## Skip Python and create the fallback file immediately
706b2bbc64ed planemo upload commit e5fa85f6befc345ab8f2b0af283f96834038cefd
galaxytrakr
parents: 15
diff changeset
40 echo -e "Run\tPredicted_Source\tConfidence_Score" > '$prediction_output';
706b2bbc64ed planemo upload commit e5fa85f6befc345ab8f2b0af283f96834038cefd
galaxytrakr
parents: 15
diff changeset
41 echo -e "${input_name}\tNo Prediction\t0.0" >> '$prediction_output';
706b2bbc64ed planemo upload commit e5fa85f6befc345ab8f2b0af283f96834038cefd
galaxytrakr
parents: 15
diff changeset
42 fi
0
f25631df0e9f planemo upload commit 25e4c800a5358b8615dac18ea5e908e31c534020
galaxytrakr
parents:
diff changeset
43 ]]></command>
f25631df0e9f planemo upload commit 25e4c800a5358b8615dac18ea5e908e31c534020
galaxytrakr
parents:
diff changeset
44
f25631df0e9f planemo upload commit 25e4c800a5358b8615dac18ea5e908e31c534020
galaxytrakr
parents:
diff changeset
45 <inputs>
14
9a84b8511fc2 planemo upload commit 6681312523efb1b57807ea244c63f9cbb02c574e
galaxytrakr
parents: 13
diff changeset
46 <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."/>
9a84b8511fc2 planemo upload commit 6681312523efb1b57807ea244c63f9cbb02c574e
galaxytrakr
parents: 13
diff changeset
47
9a84b8511fc2 planemo upload commit 6681312523efb1b57807ea244c63f9cbb02c574e
galaxytrakr
parents: 13
diff changeset
48 <param name="mash_database" type="select" label="Select Mash Database" help="Choose the pre-computed Mash sketch database to screen against.">
9a84b8511fc2 planemo upload commit 6681312523efb1b57807ea244c63f9cbb02c574e
galaxytrakr
parents: 13
diff changeset
49 <options from_data_table="mash_sketches">
9a84b8511fc2 planemo upload commit 6681312523efb1b57807ea244c63f9cbb02c574e
galaxytrakr
parents: 13
diff changeset
50 <validator type="no_options" message="No Mash databases are configured. Please contact your Galaxy administrator." />
9a84b8511fc2 planemo upload commit 6681312523efb1b57807ea244c63f9cbb02c574e
galaxytrakr
parents: 13
diff changeset
51 </options>
9a84b8511fc2 planemo upload commit 6681312523efb1b57807ea244c63f9cbb02c574e
galaxytrakr
parents: 13
diff changeset
52 </param>
9a84b8511fc2 planemo upload commit 6681312523efb1b57807ea244c63f9cbb02c574e
galaxytrakr
parents: 13
diff changeset
53
0
f25631df0e9f planemo upload commit 25e4c800a5358b8615dac18ea5e908e31c534020
galaxytrakr
parents:
diff changeset
54 <param name="model_selection" type="select" label="Select Prediction Model" help="Choose which trained model to use for prediction.">
f25631df0e9f planemo upload commit 25e4c800a5358b8615dac18ea5e908e31c534020
galaxytrakr
parents:
diff changeset
55 <options from_data_table="plasmidtrakr_models">
f25631df0e9f planemo upload commit 25e4c800a5358b8615dac18ea5e908e31c534020
galaxytrakr
parents:
diff changeset
56 <validator type="no_options" message="No prediction models are configured. Please contact your Galaxy administrator." />
f25631df0e9f planemo upload commit 25e4c800a5358b8615dac18ea5e908e31c534020
galaxytrakr
parents:
diff changeset
57 </options>
f25631df0e9f planemo upload commit 25e4c800a5358b8615dac18ea5e908e31c534020
galaxytrakr
parents:
diff changeset
58 </param>
14
9a84b8511fc2 planemo upload commit 6681312523efb1b57807ea244c63f9cbb02c574e
galaxytrakr
parents: 13
diff changeset
59
9a84b8511fc2 planemo upload commit 6681312523efb1b57807ea244c63f9cbb02c574e
galaxytrakr
parents: 13
diff changeset
60 <param name="threshold" type="float" value="0.95" min="0.0" max="1.0" label="Mash Identity Threshold" help="Filter plasmid hits below this identity. Must match the threshold used for model training."/>
0
f25631df0e9f planemo upload commit 25e4c800a5358b8615dac18ea5e908e31c534020
galaxytrakr
parents:
diff changeset
61 </inputs>
f25631df0e9f planemo upload commit 25e4c800a5358b8615dac18ea5e908e31c534020
galaxytrakr
parents:
diff changeset
62
f25631df0e9f planemo upload commit 25e4c800a5358b8615dac18ea5e908e31c534020
galaxytrakr
parents:
diff changeset
63 <outputs>
8
17b409c9320d planemo upload commit 8fe81cc450c2773ca4183b693341de07ff0337e9
galaxytrakr
parents: 7
diff changeset
64 <data name="prediction_output" format="tabular" label="Prediction for ${on_string}" />
0
f25631df0e9f planemo upload commit 25e4c800a5358b8615dac18ea5e908e31c534020
galaxytrakr
parents:
diff changeset
65 </outputs>
f25631df0e9f planemo upload commit 25e4c800a5358b8615dac18ea5e908e31c534020
galaxytrakr
parents:
diff changeset
66
f25631df0e9f planemo upload commit 25e4c800a5358b8615dac18ea5e908e31c534020
galaxytrakr
parents:
diff changeset
67 <help><![CDATA[
f25631df0e9f planemo upload commit 25e4c800a5358b8615dac18ea5e908e31c534020
galaxytrakr
parents:
diff changeset
68 **What it does**
f25631df0e9f planemo upload commit 25e4c800a5358b8615dac18ea5e908e31c534020
galaxytrakr
parents:
diff changeset
69
14
9a84b8511fc2 planemo upload commit 6681312523efb1b57807ea244c63f9cbb02c574e
galaxytrakr
parents: 13
diff changeset
70 This tool performs a complete workflow in a single step: it screens a genome assembly or read set against a built-in plasmid database using **mash screen**, and then feeds those plasmid hits into a pre-trained **machine learning model** to predict the original source of the isolate.
0
f25631df0e9f planemo upload commit 25e4c800a5358b8615dac18ea5e908e31c534020
galaxytrakr
parents:
diff changeset
71
14
9a84b8511fc2 planemo upload commit 6681312523efb1b57807ea244c63f9cbb02c574e
galaxytrakr
parents: 13
diff changeset
72 **Workflow**
9a84b8511fc2 planemo upload commit 6681312523efb1b57807ea244c63f9cbb02c574e
galaxytrakr
parents: 13
diff changeset
73 1. Provide your **genome assembly (FASTA)** or raw reads.
9a84b8511fc2 planemo upload commit 6681312523efb1b57807ea244c63f9cbb02c574e
galaxytrakr
parents: 13
diff changeset
74 2. Select your **Mash database** from the server's configured list.
9a84b8511fc2 planemo upload commit 6681312523efb1b57807ea244c63f9cbb02c574e
galaxytrakr
parents: 13
diff changeset
75 3. Select the desired prediction model.
9a84b8511fc2 planemo upload commit 6681312523efb1b57807ea244c63f9cbb02c574e
galaxytrakr
parents: 13
diff changeset
76 4. Execute to screen and predict in one step.
0
f25631df0e9f planemo upload commit 25e4c800a5358b8615dac18ea5e908e31c534020
galaxytrakr
parents:
diff changeset
77
f25631df0e9f planemo upload commit 25e4c800a5358b8615dac18ea5e908e31c534020
galaxytrakr
parents:
diff changeset
78 **Output**
f25631df0e9f planemo upload commit 25e4c800a5358b8615dac18ea5e908e31c534020
galaxytrakr
parents:
diff changeset
79 A tabular file containing the isolate ID, the predicted source, and a confidence score.
f25631df0e9f planemo upload commit 25e4c800a5358b8615dac18ea5e908e31c534020
galaxytrakr
parents:
diff changeset
80 ]]></help>
f25631df0e9f planemo upload commit 25e4c800a5358b8615dac18ea5e908e31c534020
galaxytrakr
parents:
diff changeset
81
f25631df0e9f planemo upload commit 25e4c800a5358b8615dac18ea5e908e31c534020
galaxytrakr
parents:
diff changeset
82 <citations>
f25631df0e9f planemo upload commit 25e4c800a5358b8615dac18ea5e908e31c534020
galaxytrakr
parents:
diff changeset
83 <citation type="bibtex">
f25631df0e9f planemo upload commit 25e4c800a5358b8615dac18ea5e908e31c534020
galaxytrakr
parents:
diff changeset
84 @misc{strain_2026_plasmidtrakr,
f25631df0e9f planemo upload commit 25e4c800a5358b8615dac18ea5e908e31c534020
galaxytrakr
parents:
diff changeset
85 author = {Strain, Errol},
f25631df0e9f planemo upload commit 25e4c800a5358b8615dac18ea5e908e31c534020
galaxytrakr
parents:
diff changeset
86 title = {PlasmidTrakr: A tool for predicting isolate source from plasmid profiles},
f25631df0e9f planemo upload commit 25e4c800a5358b8615dac18ea5e908e31c534020
galaxytrakr
parents:
diff changeset
87 year = {2026},
f25631df0e9f planemo upload commit 25e4c800a5358b8615dac18ea5e908e31c534020
galaxytrakr
parents:
diff changeset
88 publisher = {GitHub},
f25631df0e9f planemo upload commit 25e4c800a5358b8615dac18ea5e908e31c534020
galaxytrakr
parents:
diff changeset
89 journal = {GitHub repository},
f25631df0e9f planemo upload commit 25e4c800a5358b8615dac18ea5e908e31c534020
galaxytrakr
parents:
diff changeset
90 howpublished = {\url{https://github.com/estrain/plasmidtrakr}}
f25631df0e9f planemo upload commit 25e4c800a5358b8615dac18ea5e908e31c534020
galaxytrakr
parents:
diff changeset
91 }
f25631df0e9f planemo upload commit 25e4c800a5358b8615dac18ea5e908e31c534020
galaxytrakr
parents:
diff changeset
92 </citation>
f25631df0e9f planemo upload commit 25e4c800a5358b8615dac18ea5e908e31c534020
galaxytrakr
parents:
diff changeset
93 </citations>
f25631df0e9f planemo upload commit 25e4c800a5358b8615dac18ea5e908e31c534020
galaxytrakr
parents:
diff changeset
94 </tool>