jpayne@69
|
1 <tool id="csp2-snp" name="CSP2 (SNP Pipeline Mode)" version="0.9.7_Dev21">
|
jpayne@69
|
2 <description>Run SNP Pipeline analysis on isolates using one or more references.</description>
|
jpayne@69
|
3 <requirements>
|
jpayne@69
|
4 <requirement type="package" version="24.10.1">nextflow</requirement>
|
jpayne@69
|
5 <requirement type="package" version="1.5.8">micromamba</requirement>
|
jpayne@69
|
6 </requirements>
|
jpayne@69
|
7 <version_command>nextflow -version</version_command>
|
jpayne@69
|
8 <command detect_errors="aggressive"><![CDATA[
|
jpayne@69
|
9 mkdir -p queries references
|
jpayne@69
|
10 #set readext=""
|
jpayne@69
|
11 #for $reads in $query.coll
|
jpayne@69
|
12 #if $hasattr($reads, "is_of_type") and $reads.is_of_type("fasta")
|
jpayne@69
|
13 && ln -sf '${reads}' 'queries/${reads.element_identifier}.fasta'
|
jpayne@69
|
14 #else if $reads.forward.is_of_type("fastq.gz","fastqsanger.gz")
|
jpayne@69
|
15 #set readext="fastq.gz"
|
jpayne@69
|
16 && ln -sf '${reads.forward}' 'queries/${reads.forward.element_identifier}_1.fastq.gz'
|
jpayne@69
|
17 && ln -sf '${reads.reverse}' 'queries/${reads.reverse.element_identifier}_2.fastq.gz'
|
jpayne@69
|
18 #else if $reads.forward.is_of_type("fastq.bz2", "fastqsanger.bz2")
|
jpayne@69
|
19 #set readext="fastq.bz2"
|
jpayne@69
|
20 && ln -sf '${reads.forward}' 'queries/${reads.forward.element_identifier}_1.fastq.bz2'
|
jpayne@69
|
21 && ln -sf '${reads.reverse}' 'queries/${reads.reverse.element_identifier}_2.fastq.bz2'
|
jpayne@69
|
22 #else
|
jpayne@69
|
23 #set readext="fastq"
|
jpayne@69
|
24 && ln -sf '${reads.forward}' 'queries/${reads.forward.element_identifier}_1.fastq'
|
jpayne@69
|
25 && ln -sf '${reads.reverse}' 'queries/${reads.reverse.element_identifier}_2.fastq'
|
jpayne@69
|
26 #end if
|
jpayne@69
|
27 #end for
|
jpayne@69
|
28 && echo "*** Files in queries directory: ***"
|
jpayne@69
|
29 && ln -sf '$source.reference' 'references/${source.reference.element_identifier}.fasta'
|
jpayne@69
|
30 && nextflow run
|
jpayne@69
|
31 ${__tool_directory__}/CSP2/CSP2.nf -profile csp2_galaxy
|
jpayne@69
|
32 --runmode snp
|
jpayne@69
|
33 #if $query.query_select == 'reads'
|
jpayne@69
|
34 --reads queries
|
jpayne@69
|
35 --readext $readext
|
jpayne@69
|
36 --forward "_1.${readext}"
|
jpayne@69
|
37 --reverse "_2.${readext}"
|
jpayne@69
|
38 #else
|
jpayne@69
|
39 --fasta queries
|
jpayne@69
|
40 #end if
|
jpayne@69
|
41 --ref_fasta 'references/${source.reference.element_identifier}.fasta'
|
jpayne@69
|
42 --min_cov $opt.min_cov
|
jpayne@69
|
43 --min_iden $opt.min_iden
|
jpayne@69
|
44 --min_len $opt.min_len
|
jpayne@69
|
45 --ref_edge $opt.ref_edge
|
jpayne@69
|
46 --query_edge $opt.query_edge
|
jpayne@69
|
47 --dwin $opt.dwin
|
jpayne@69
|
48 --wsnps $opt.wsnps
|
jpayne@69
|
49 --out CSP2_SNP_Output
|
jpayne@69
|
50 && echo "*** Files in output directory: ***"
|
jpayne@69
|
51 && ls -lah CSP2_SNP_Output
|
jpayne@69
|
52 && echo "*** Nextflow log follows: ***"
|
jpayne@69
|
53 && cat .nextflow.log
|
jpayne@69
|
54 ]]>
|
jpayne@69
|
55 </command>
|
jpayne@69
|
56 <inputs>
|
jpayne@69
|
57 <conditional name="source">
|
jpayne@69
|
58 <param name="source_select" type="select" label="Use a curated GalaxyTrakr reference or a reference from your history">
|
jpayne@69
|
59 <option value="curated">Use a GalaxyTrakr reference</option>
|
jpayne@69
|
60 <option value="history">Use a reference from your history</option>
|
jpayne@69
|
61 </param>
|
jpayne@69
|
62 <when value="curated">
|
jpayne@69
|
63 <param name="reference" type="select" label="Select reference fasta">
|
jpayne@69
|
64 <options from_data_table="all_fasta">
|
jpayne@69
|
65 <filter type="sort_by" column="2"/>
|
jpayne@69
|
66 <validator type="no_options" message="No assemblies are available for the selected input dataset"/>
|
jpayne@69
|
67 </options>
|
jpayne@69
|
68 </param>
|
jpayne@69
|
69 </when>
|
jpayne@69
|
70 <when value="history">
|
jpayne@69
|
71 <param type="data" name="reference" format="fasta" label="Select reference FASTA"/>
|
jpayne@69
|
72 </when>
|
jpayne@69
|
73 </conditional>
|
jpayne@69
|
74 <conditional name="query">
|
jpayne@69
|
75 <param name="query_select" type="select" label="Screen a list of paired-reads or a list of assemblies">
|
jpayne@69
|
76 <option value="reads">Screen a list of paired reads</option>
|
jpayne@69
|
77 <option value="assemblies">Screen a list of assemblies</option>
|
jpayne@69
|
78 </param>
|
jpayne@69
|
79 <when value="reads">
|
jpayne@69
|
80 <param label="Paired reads" name="coll" type="data_collection" format="fastq,fastqsanger,fastq.gz,fastqsanger.gz,fastq.bz2,fastqsanger.bz2" collection_type="list:paired" />
|
jpayne@69
|
81 </when>
|
jpayne@69
|
82 <when value="assemblies">
|
jpayne@69
|
83 <param label="Assemblies" name="coll" type="data_collection" format="fasta" collection_type="list" />
|
jpayne@69
|
84 </when>
|
jpayne@69
|
85 </conditional>
|
jpayne@69
|
86 <section name="opt" title="Advanced options...">
|
jpayne@69
|
87 <param name="min_cov" type="float" value="85" label="Minimum reference genome coverage to proceed with distance estimation" optional="true" />
|
jpayne@69
|
88 <param name="min_iden" type="float" value="99" label="Minimum alignment percent identity to detect SNPs" optional="true" />
|
jpayne@69
|
89 <param name="min_len" type="integer" value="500" label="Minimum alignment length to detect SNPs" optional="true" />
|
jpayne@69
|
90 <param name="ref_edge" type="integer" value="150" label="Prune SNPs within this many bases of reference contig edge" optional="true" />
|
jpayne@69
|
91 <param name="query_edge" type="integer" value="150" label="Prune SNPs within this many bases of query contig edge" optional="true" />
|
jpayne@69
|
92 <param name="dwin" type="text" value="1000,125,15" label="Comma-separated set of window sizes for SNP density filtration (Set to 0 to disable density filtration)" optional="true" />
|
jpayne@69
|
93 <param name="wsnps" type="text" value="3,2,1" label="Comma-separated list of maximum SNP counts per density window" optional="true" />
|
jpayne@69
|
94 </section>
|
jpayne@69
|
95 </inputs>
|
jpayne@69
|
96 <outputs>
|
jpayne@69
|
97 <!-- <data name="nextflow_log" format="txt" label="Nextflow Log" from_work_dir="Nextflow_Log.txt" /> -->
|
jpayne@69
|
98 <data name="isolate_data" format="tabular" label="Isolate Data" from_work_dir="CSP2_SNP_Output/Isolate_Data.tsv" />
|
jpayne@69
|
99 <data name="raw_mummer" format="tabular" label="Raw MUMmer Output" from_work_dir="CSP2_SNP_Output/Raw_MUMmer_Summary.tsv" />
|
jpayne@69
|
100 <!-- <data name="csp2_zip" format="zip" label="Zipped Output" from_work_dir="CSP2_Output.zip" /> -->
|
jpayne@69
|
101 <collection name="reference_results" type="list:list">
|
jpayne@69
|
102 <discover_datasets pattern="(?P<name>.+)/CSP2_SNP_Pipeline\.log" format="txt" visible="true" directory="./CSP2_SNP_Output/SNP_Analysis" />
|
jpayne@69
|
103 <discover_datasets pattern="(?P<name>.+)/Reference_Screening\.tsv" format="tabular" visible="true" directory="./CSP2_SNP_Output/SNP_Analysis" />
|
jpayne@69
|
104 <discover_datasets pattern="(?P<name>.+)/snp_distance_matrix_preserved\.tsv" format="tabular" visible="true" directory="./CSP2_SNP_Output/SNP_Analysis" />
|
jpayne@69
|
105 <discover_datasets pattern="(?P<name>.+)/snp_distance_pairwise_preserved\.tsv" format="tabular" visible="true" directory="./CSP2_SNP_Output/SNP_Analysis" />
|
jpayne@69
|
106 <discover_datasets pattern="(?P<name>.+)/snpma_preserved\.fasta" format="fasta" visible="true" directory="./CSP2_SNP_Output/SNP_Analysis" />
|
jpayne@69
|
107 </collection>
|
jpayne@69
|
108 </outputs>
|
jpayne@69
|
109 <tests>
|
jpayne@69
|
110 <test>
|
jpayne@69
|
111 <param name="source_select" value="history" />
|
jpayne@69
|
112 <param name="reference" value="assemblies/Sample_A.fasta" />
|
jpayne@69
|
113 <param name="query_select" value="assemblies" />
|
jpayne@69
|
114 <param name="coll">
|
jpayne@69
|
115 <collection type="list">
|
jpayne@69
|
116 <!-- <element name="Sample_A" value="assemblies/Sample_A.fasta" /> -->
|
jpayne@69
|
117 <element name="Sample_B" value="assemblies/Sample_B.fasta" />
|
jpayne@69
|
118 <element name="Sample_C" value="assemblies/Sample_C.fasta" />
|
jpayne@69
|
119 <element name="Sample_D" value="assemblies/Sample_D.fasta" />
|
jpayne@69
|
120 <element name="Sample_E" value="assemblies/Sample_E.fasta" />
|
jpayne@69
|
121 <element name="Sample_F" value="assemblies/Sample_F.fasta" />
|
jpayne@69
|
122 <element name="Sample_G" value="assemblies/Sample_G.fasta" />
|
jpayne@69
|
123 <element name="Sample_H" value="assemblies/Sample_H.fasta" />
|
jpayne@69
|
124 <element name="Sample_I" value="assemblies/Sample_I.fasta" />
|
jpayne@69
|
125 <element name="Sample_J" value="assemblies/Sample_J.fasta" />
|
jpayne@69
|
126 <element name="Sample_K" value="assemblies/Sample_K.fasta" />
|
jpayne@69
|
127 <element name="Sample_L" value="assemblies/Sample_L.fasta" />
|
jpayne@69
|
128 <element name="Sample_M" value="assemblies/Sample_M.fasta" />
|
jpayne@69
|
129 <element name="Sample_N" value="assemblies/Sample_N.fasta" />
|
jpayne@69
|
130 <element name="Sample_O" value="assemblies/Sample_O.fasta" />
|
jpayne@69
|
131 </collection>
|
jpayne@69
|
132 </param>
|
jpayne@69
|
133
|
jpayne@69
|
134 <output name="isolate_data" value="Isolate_Data.tsv" />
|
jpayne@69
|
135 </test>
|
jpayne@69
|
136 <test>
|
jpayne@69
|
137 <param name="source_select" value="history" />
|
jpayne@69
|
138 <param name="reference" value="assemblies/Sample_A.fasta" ftype="fasta" />
|
jpayne@69
|
139 <param name="query_select" value="reads" />
|
jpayne@69
|
140 <param name="coll">
|
jpayne@69
|
141 <collection type="list:paired">
|
jpayne@69
|
142 <element name="Sample_A">
|
jpayne@69
|
143 <collection type="paired">
|
jpayne@69
|
144 <element name="forward" value="reads/Week_42_Reads_1.fq.gz" ftype="fastqsanger.gz" />
|
jpayne@69
|
145 <element name="reverse" value="reads/Week_42_Reads_2.fq.gz" ftype="fastqsanger.gz" />
|
jpayne@69
|
146 </collection>
|
jpayne@69
|
147 </element>
|
jpayne@69
|
148 </collection>
|
jpayne@69
|
149 </param>
|
jpayne@69
|
150 <output name="screening_results" value="Screening_Results.tsv" />
|
jpayne@69
|
151 <output name="isolate_data" value="Isolate_Data.tsv" />
|
jpayne@69
|
152 </test>
|
jpayne@69
|
153 </tests>
|
jpayne@69
|
154 <help>
|
jpayne@69
|
155 This tool takes query assemblies and reference assemblies and calculates the pairwise distance between each query/reference combination. If no reference is provided, all queries are compared to all other queries.
|
jpayne@69
|
156 </help>
|
jpayne@69
|
157 <citations>
|
jpayne@69
|
158 <citation type="doi">10.XXXX/placeholder.doi</citation>
|
jpayne@69
|
159 <citation type="bibtex">@article{example2024,title={CFSAN SNP Pipeline 2 (CSP2): a pipeline for fast and accurate SNP distance estimation from bacterial genome assemblies.},author={Doe, John and Smith, Jane},journal={Submitted},year={2024}}
|
jpayne@69
|
160 </citation>
|
jpayne@69
|
161 </citations>
|
jpayne@69
|
162 </tool>
|