Mercurial > repos > galaxytrakr > plasmidtrakr
annotate plasmidtrakr.xml @ 16:706b2bbc64ed draft
planemo upload commit e5fa85f6befc345ab8f2b0af283f96834038cefd
| author | galaxytrakr |
|---|---|
| date | Thu, 30 Apr 2026 19:40:55 +0000 |
| parents | 58006290e654 |
| children | 36d49a2e6bbe |
| rev | line source |
|---|---|
|
16
706b2bbc64ed
planemo upload commit e5fa85f6befc345ab8f2b0af283f96834038cefd
galaxytrakr
parents:
15
diff
changeset
|
1 <tool id="plasmidtrakr" name="PlasmidTrakr" version="0.2.2"> |
|
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 |
|
15
58006290e654
planemo upload commit 07e8ec488fa1fb8323b5e90bfc9842aa7337b950
galaxytrakr
parents:
14
diff
changeset
|
12 #set $input_name = $assembly_input.element_identifier.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' |
|
16
706b2bbc64ed
planemo upload commit e5fa85f6befc345ab8f2b0af283f96834038cefd
galaxytrakr
parents:
15
diff
changeset
|
21 > mash_results.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 |
|
706b2bbc64ed
planemo upload commit e5fa85f6befc345ab8f2b0af283f96834038cefd
galaxytrakr
parents:
15
diff
changeset
|
25 ## [ -s file ] checks if file exists and has size > 0 |
|
706b2bbc64ed
planemo upload commit e5fa85f6befc345ab8f2b0af283f96834038cefd
galaxytrakr
parents:
15
diff
changeset
|
26 if [ -s mash_results.tabular ]; then |
|
706b2bbc64ed
planemo upload commit e5fa85f6befc345ab8f2b0af283f96834038cefd
galaxytrakr
parents:
15
diff
changeset
|
27 ## Run the prediction script only if there is data |
|
706b2bbc64ed
planemo upload commit e5fa85f6befc345ab8f2b0af283f96834038cefd
galaxytrakr
parents:
15
diff
changeset
|
28 python $__tool_directory__/predict_source.py |
|
706b2bbc64ed
planemo upload commit e5fa85f6befc345ab8f2b0af283f96834038cefd
galaxytrakr
parents:
15
diff
changeset
|
29 -i mash_results.tabular |
|
706b2bbc64ed
planemo upload commit e5fa85f6befc345ab8f2b0af283f96834038cefd
galaxytrakr
parents:
15
diff
changeset
|
30 -b '$model_selection.fields.path' |
|
706b2bbc64ed
planemo upload commit e5fa85f6befc345ab8f2b0af283f96834038cefd
galaxytrakr
parents:
15
diff
changeset
|
31 -t $threshold |
|
706b2bbc64ed
planemo upload commit e5fa85f6befc345ab8f2b0af283f96834038cefd
galaxytrakr
parents:
15
diff
changeset
|
32 -o '$prediction_output'; |
|
706b2bbc64ed
planemo upload commit e5fa85f6befc345ab8f2b0af283f96834038cefd
galaxytrakr
parents:
15
diff
changeset
|
33 |
|
706b2bbc64ed
planemo upload commit e5fa85f6befc345ab8f2b0af283f96834038cefd
galaxytrakr
parents:
15
diff
changeset
|
34 ## Optional: If the script ran but produced no results (e.g. filtered out) |
|
706b2bbc64ed
planemo upload commit e5fa85f6befc345ab8f2b0af283f96834038cefd
galaxytrakr
parents:
15
diff
changeset
|
35 ## ensure we still provide the "No Prediction" fallback |
|
706b2bbc64ed
planemo upload commit e5fa85f6befc345ab8f2b0af283f96834038cefd
galaxytrakr
parents:
15
diff
changeset
|
36 if [ \$(wc -l < '$prediction_output') -le 1 ]; then |
|
706b2bbc64ed
planemo upload commit e5fa85f6befc345ab8f2b0af283f96834038cefd
galaxytrakr
parents:
15
diff
changeset
|
37 echo -e "Run\tPredicted_Source\tConfidence_Score" > '$prediction_output'; |
|
706b2bbc64ed
planemo upload commit e5fa85f6befc345ab8f2b0af283f96834038cefd
galaxytrakr
parents:
15
diff
changeset
|
38 echo -e "${input_name}\tNo Prediction\t0.0" >> '$prediction_output'; |
|
706b2bbc64ed
planemo upload commit e5fa85f6befc345ab8f2b0af283f96834038cefd
galaxytrakr
parents:
15
diff
changeset
|
39 fi |
|
706b2bbc64ed
planemo upload commit e5fa85f6befc345ab8f2b0af283f96834038cefd
galaxytrakr
parents:
15
diff
changeset
|
40 else |
|
706b2bbc64ed
planemo upload commit e5fa85f6befc345ab8f2b0af283f96834038cefd
galaxytrakr
parents:
15
diff
changeset
|
41 ## Skip Python and create the fallback file immediately |
|
706b2bbc64ed
planemo upload commit e5fa85f6befc345ab8f2b0af283f96834038cefd
galaxytrakr
parents:
15
diff
changeset
|
42 echo -e "Run\tPredicted_Source\tConfidence_Score" > '$prediction_output'; |
|
706b2bbc64ed
planemo upload commit e5fa85f6befc345ab8f2b0af283f96834038cefd
galaxytrakr
parents:
15
diff
changeset
|
43 echo -e "${input_name}\tNo Prediction\t0.0" >> '$prediction_output'; |
|
706b2bbc64ed
planemo upload commit e5fa85f6befc345ab8f2b0af283f96834038cefd
galaxytrakr
parents:
15
diff
changeset
|
44 fi |
|
0
f25631df0e9f
planemo upload commit 25e4c800a5358b8615dac18ea5e908e31c534020
galaxytrakr
parents:
diff
changeset
|
45 ]]></command> |
|
f25631df0e9f
planemo upload commit 25e4c800a5358b8615dac18ea5e908e31c534020
galaxytrakr
parents:
diff
changeset
|
46 |
|
f25631df0e9f
planemo upload commit 25e4c800a5358b8615dac18ea5e908e31c534020
galaxytrakr
parents:
diff
changeset
|
47 <inputs> |
|
14
9a84b8511fc2
planemo upload commit 6681312523efb1b57807ea244c63f9cbb02c574e
galaxytrakr
parents:
13
diff
changeset
|
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."/> |
|
9a84b8511fc2
planemo upload commit 6681312523efb1b57807ea244c63f9cbb02c574e
galaxytrakr
parents:
13
diff
changeset
|
49 |
|
9a84b8511fc2
planemo upload commit 6681312523efb1b57807ea244c63f9cbb02c574e
galaxytrakr
parents:
13
diff
changeset
|
50 <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
|
51 <options from_data_table="mash_sketches"> |
|
9a84b8511fc2
planemo upload commit 6681312523efb1b57807ea244c63f9cbb02c574e
galaxytrakr
parents:
13
diff
changeset
|
52 <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
|
53 </options> |
|
9a84b8511fc2
planemo upload commit 6681312523efb1b57807ea244c63f9cbb02c574e
galaxytrakr
parents:
13
diff
changeset
|
54 </param> |
|
9a84b8511fc2
planemo upload commit 6681312523efb1b57807ea244c63f9cbb02c574e
galaxytrakr
parents:
13
diff
changeset
|
55 |
|
0
f25631df0e9f
planemo upload commit 25e4c800a5358b8615dac18ea5e908e31c534020
galaxytrakr
parents:
diff
changeset
|
56 <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
|
57 <options from_data_table="plasmidtrakr_models"> |
|
f25631df0e9f
planemo upload commit 25e4c800a5358b8615dac18ea5e908e31c534020
galaxytrakr
parents:
diff
changeset
|
58 <validator type="no_options" message="No prediction models are configured. Please contact your Galaxy administrator." /> |
|
f25631df0e9f
planemo upload commit 25e4c800a5358b8615dac18ea5e908e31c534020
galaxytrakr
parents:
diff
changeset
|
59 </options> |
|
f25631df0e9f
planemo upload commit 25e4c800a5358b8615dac18ea5e908e31c534020
galaxytrakr
parents:
diff
changeset
|
60 </param> |
|
14
9a84b8511fc2
planemo upload commit 6681312523efb1b57807ea244c63f9cbb02c574e
galaxytrakr
parents:
13
diff
changeset
|
61 |
|
9a84b8511fc2
planemo upload commit 6681312523efb1b57807ea244c63f9cbb02c574e
galaxytrakr
parents:
13
diff
changeset
|
62 <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
|
63 </inputs> |
|
f25631df0e9f
planemo upload commit 25e4c800a5358b8615dac18ea5e908e31c534020
galaxytrakr
parents:
diff
changeset
|
64 |
|
f25631df0e9f
planemo upload commit 25e4c800a5358b8615dac18ea5e908e31c534020
galaxytrakr
parents:
diff
changeset
|
65 <outputs> |
|
8
17b409c9320d
planemo upload commit 8fe81cc450c2773ca4183b693341de07ff0337e9
galaxytrakr
parents:
7
diff
changeset
|
66 <data name="prediction_output" format="tabular" label="Prediction for ${on_string}" /> |
|
0
f25631df0e9f
planemo upload commit 25e4c800a5358b8615dac18ea5e908e31c534020
galaxytrakr
parents:
diff
changeset
|
67 </outputs> |
|
f25631df0e9f
planemo upload commit 25e4c800a5358b8615dac18ea5e908e31c534020
galaxytrakr
parents:
diff
changeset
|
68 |
|
f25631df0e9f
planemo upload commit 25e4c800a5358b8615dac18ea5e908e31c534020
galaxytrakr
parents:
diff
changeset
|
69 <help><![CDATA[ |
|
f25631df0e9f
planemo upload commit 25e4c800a5358b8615dac18ea5e908e31c534020
galaxytrakr
parents:
diff
changeset
|
70 **What it does** |
|
f25631df0e9f
planemo upload commit 25e4c800a5358b8615dac18ea5e908e31c534020
galaxytrakr
parents:
diff
changeset
|
71 |
|
14
9a84b8511fc2
planemo upload commit 6681312523efb1b57807ea244c63f9cbb02c574e
galaxytrakr
parents:
13
diff
changeset
|
72 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
|
73 |
|
14
9a84b8511fc2
planemo upload commit 6681312523efb1b57807ea244c63f9cbb02c574e
galaxytrakr
parents:
13
diff
changeset
|
74 **Workflow** |
|
9a84b8511fc2
planemo upload commit 6681312523efb1b57807ea244c63f9cbb02c574e
galaxytrakr
parents:
13
diff
changeset
|
75 1. Provide your **genome assembly (FASTA)** or raw reads. |
|
9a84b8511fc2
planemo upload commit 6681312523efb1b57807ea244c63f9cbb02c574e
galaxytrakr
parents:
13
diff
changeset
|
76 2. Select your **Mash database** from the server's configured list. |
|
9a84b8511fc2
planemo upload commit 6681312523efb1b57807ea244c63f9cbb02c574e
galaxytrakr
parents:
13
diff
changeset
|
77 3. Select the desired prediction model. |
|
9a84b8511fc2
planemo upload commit 6681312523efb1b57807ea244c63f9cbb02c574e
galaxytrakr
parents:
13
diff
changeset
|
78 4. Execute to screen and predict in one step. |
|
0
f25631df0e9f
planemo upload commit 25e4c800a5358b8615dac18ea5e908e31c534020
galaxytrakr
parents:
diff
changeset
|
79 |
|
f25631df0e9f
planemo upload commit 25e4c800a5358b8615dac18ea5e908e31c534020
galaxytrakr
parents:
diff
changeset
|
80 **Output** |
|
f25631df0e9f
planemo upload commit 25e4c800a5358b8615dac18ea5e908e31c534020
galaxytrakr
parents:
diff
changeset
|
81 A tabular file containing the isolate ID, the predicted source, and a confidence score. |
|
f25631df0e9f
planemo upload commit 25e4c800a5358b8615dac18ea5e908e31c534020
galaxytrakr
parents:
diff
changeset
|
82 ]]></help> |
|
f25631df0e9f
planemo upload commit 25e4c800a5358b8615dac18ea5e908e31c534020
galaxytrakr
parents:
diff
changeset
|
83 |
|
f25631df0e9f
planemo upload commit 25e4c800a5358b8615dac18ea5e908e31c534020
galaxytrakr
parents:
diff
changeset
|
84 <citations> |
|
f25631df0e9f
planemo upload commit 25e4c800a5358b8615dac18ea5e908e31c534020
galaxytrakr
parents:
diff
changeset
|
85 <citation type="bibtex"> |
|
f25631df0e9f
planemo upload commit 25e4c800a5358b8615dac18ea5e908e31c534020
galaxytrakr
parents:
diff
changeset
|
86 @misc{strain_2026_plasmidtrakr, |
|
f25631df0e9f
planemo upload commit 25e4c800a5358b8615dac18ea5e908e31c534020
galaxytrakr
parents:
diff
changeset
|
87 author = {Strain, Errol}, |
|
f25631df0e9f
planemo upload commit 25e4c800a5358b8615dac18ea5e908e31c534020
galaxytrakr
parents:
diff
changeset
|
88 title = {PlasmidTrakr: A tool for predicting isolate source from plasmid profiles}, |
|
f25631df0e9f
planemo upload commit 25e4c800a5358b8615dac18ea5e908e31c534020
galaxytrakr
parents:
diff
changeset
|
89 year = {2026}, |
|
f25631df0e9f
planemo upload commit 25e4c800a5358b8615dac18ea5e908e31c534020
galaxytrakr
parents:
diff
changeset
|
90 publisher = {GitHub}, |
|
f25631df0e9f
planemo upload commit 25e4c800a5358b8615dac18ea5e908e31c534020
galaxytrakr
parents:
diff
changeset
|
91 journal = {GitHub repository}, |
|
f25631df0e9f
planemo upload commit 25e4c800a5358b8615dac18ea5e908e31c534020
galaxytrakr
parents:
diff
changeset
|
92 howpublished = {\url{https://github.com/estrain/plasmidtrakr}} |
|
f25631df0e9f
planemo upload commit 25e4c800a5358b8615dac18ea5e908e31c534020
galaxytrakr
parents:
diff
changeset
|
93 } |
|
f25631df0e9f
planemo upload commit 25e4c800a5358b8615dac18ea5e908e31c534020
galaxytrakr
parents:
diff
changeset
|
94 </citation> |
|
f25631df0e9f
planemo upload commit 25e4c800a5358b8615dac18ea5e908e31c534020
galaxytrakr
parents:
diff
changeset
|
95 </citations> |
|
f25631df0e9f
planemo upload commit 25e4c800a5358b8615dac18ea5e908e31c534020
galaxytrakr
parents:
diff
changeset
|
96 </tool> |
