jpayne@0
|
1 <tool id="map_reads" name="1. Map Reads" version="1.0.1" profile="16.10">
|
jpayne@0
|
2 <description>to index, or lookup cached alignment</description>
|
jpayne@0
|
3 <requirements>
|
jpayne@62
|
4 <container type="docker">quay.io/staphb/cfsan-snp-pipeline</container>
|
jpayne@62
|
5 <!-- <requirement type="package" version="1.0.8">bzip2</requirement>
|
jpayne@58
|
6 <requirement type="package" version="2.4.5">bowtie2</requirement>
|
jpayne@62
|
7 <requirement type="package" version="1.9.134">boto3</requirement> -->
|
jpayne@58
|
8 <!-- <requirement type="package" version="3.6.8">python</requirement> -->
|
jpayne@0
|
9 </requirements>
|
jpayne@0
|
10 <command detect_errors="exit_code"><![CDATA[
|
jpayne@40
|
11 export LD_LIBRARY_PATH="\$CONDA_DEFAULT_ENV/lib" &&
|
jpayne@0
|
12 #if $reads.reads_select == 'collection'
|
jpayne@44
|
13 #set forward=$reads.coll.forward
|
jpayne@44
|
14 #set reverse=$reads.coll.reverse
|
jpayne@0
|
15 #end if
|
jpayne@9
|
16 python ${__tool_directory__}/snp-cache.py snp_mapped_reads
|
jpayne@0
|
17 "\$(md5sum $reference
|
jpayne@44
|
18 $forward
|
jpayne@44
|
19 $reverse
|
jpayne@0
|
20 | cut -c -32 | md5sum | cut -c -32)"
|
jpayne@0
|
21 -c "
|
jpayne@0
|
22 cp $reference ./reference.fasta
|
jpayne@44
|
23 #if $forward.is_of_type("fastq.gz","fastqsanger.gz")
|
jpayne@44
|
24 && cp $forward ./forward.gz
|
jpayne@44
|
25 #set $forward="./forward.gz"
|
jpayne@44
|
26 #else if $forward.is_of_type("fastq.bz2", "fastqsanger.bz2")
|
jpayne@44
|
27 && cp $forward ./forward.bz2
|
jpayne@44
|
28 #set $forward="./forward.bz2"
|
jpayne@44
|
29 #end if
|
jpayne@44
|
30 #if $reverse.is_of_type("fastq.gz","fastqsanger.gz")
|
jpayne@44
|
31 && cp $reverse ./reverse.gz
|
jpayne@44
|
32 #set $reverse="./reverse.gz"
|
jpayne@44
|
33 #else if $reverse.is_of_type("fastq.bz2", "fastqsanger.bz2")
|
jpayne@44
|
34 && cp $reverse ./reverse.bz2
|
jpayne@44
|
35 #set $reverse="./reverse.bz2"
|
jpayne@44
|
36 #end if
|
jpayne@0
|
37 && bowtie2-build ./reference.fasta --quiet --threads \${GALAXY_SLOTS:-4} ./reference
|
jpayne@44
|
38 && bowtie2 -q -x ./reference -1 $forward -2 $reverse -p \${GALAXY_SLOTS:-4} --reorder -X 1000
|
jpayne@0
|
39 "
|
jpayne@0
|
40 #if $reads.reads_select == 'collection'
|
jpayne@0
|
41 -o ${align_from_collection}
|
jpayne@0
|
42 #else
|
jpayne@0
|
43 -o ${align_from_history}
|
jpayne@0
|
44 #end if
|
jpayne@0
|
45 -l $cache_log
|
jpayne@0
|
46 && cat $cache_log
|
jpayne@0
|
47 #if $source.source_select == 'curated'
|
jpayne@0
|
48 && cp $reference $ref_out
|
jpayne@0
|
49 #end if
|
jpayne@0
|
50 ]]></command>
|
jpayne@0
|
51 <inputs>
|
jpayne@0
|
52 <!-- <conditional name="source">
|
jpayne@0
|
53 <param name="source_select" type="select" label="Use the reference associated with a provided BioProject, a curated GalaxyTrakr reference, or a reference from your history">
|
jpayne@0
|
54 <option value="bioproject">Provide a BioProject</option>
|
jpayne@0
|
55 <option value="curated">Use a GalaxyTrakr reference</option>
|
jpayne@0
|
56 <option value="history">Use a reference from your history</option>
|
jpayne@0
|
57 </param>
|
jpayne@0
|
58 <when value="bioproject">
|
jpayne@0
|
59 <param type="data" name="bioproject" format="text" />
|
jpayne@0
|
60 </when>
|
jpayne@0
|
61 <when value="curated">
|
jpayne@0
|
62 <param name="input" type="select" label="Select reference fasta">
|
jpayne@0
|
63 <options from_data_table="all_fasta">
|
jpayne@0
|
64 <filter type="sort_by" column="2"/>
|
jpayne@0
|
65 <validator type="no_options" message="No assemblies are available for the selected input dataset"/>
|
jpayne@0
|
66 </options>
|
jpayne@0
|
67 </param>
|
jpayne@0
|
68 </when>
|
jpayne@0
|
69 <when value="history">
|
jpayne@0
|
70 <param type="data" name="input" format="fasta" label="Select reference FASTA"/>
|
jpayne@0
|
71 </when>
|
jpayne@0
|
72 </conditional> -->
|
jpayne@0
|
73 <conditional name="source">
|
jpayne@0
|
74 <param name="source_select" type="select" label="Use a curated GalaxyTrakr reference or a reference from your history">
|
jpayne@0
|
75 <option value="curated">Use a GalaxyTrakr reference</option>
|
jpayne@0
|
76 <option value="history">Use a reference from your history</option>
|
jpayne@0
|
77 </param>
|
jpayne@0
|
78 <when value="curated">
|
jpayne@0
|
79 <param name="reference" type="select" label="Select reference fasta">
|
jpayne@0
|
80 <options from_data_table="all_fasta">
|
jpayne@0
|
81 <filter type="sort_by" column="2"/>
|
jpayne@0
|
82 <validator type="no_options" message="No assemblies are available for the selected input dataset"/>
|
jpayne@0
|
83 </options>
|
jpayne@0
|
84 </param>
|
jpayne@0
|
85 </when>
|
jpayne@0
|
86 <when value="history">
|
jpayne@0
|
87 <param type="data" name="reference" format="fasta" label="Select reference FASTA"/>
|
jpayne@0
|
88 </when>
|
jpayne@0
|
89 </conditional>
|
jpayne@0
|
90 <conditional name="reads">
|
jpayne@0
|
91 <param name="reads_select" type="select" label="Paired-end collection, or two datasets from your history">
|
jpayne@0
|
92 <option value="collection">Paired collection from your history</option>
|
jpayne@0
|
93 <option value="history">Two FASTQ datasets from your history</option>
|
jpayne@0
|
94 </param>
|
jpayne@0
|
95 <when value="collection">
|
jpayne@44
|
96 <param label="Paired reads" name="coll" type="data_collection" format="fastq,fastqsanger,fastq.gz,fastqsanger.gz,fastq.bz2,fastqsanger.bz2" collection_type="paired" />
|
jpayne@0
|
97 </when>
|
jpayne@0
|
98 <when value="history">
|
jpayne@44
|
99 <param label="Forward reads" type="data" name="forward" format="fastq,fastqsanger,fastq.gz,fastqsanger.gz,fastq.bz2,fastqsanger.bz2" />
|
jpayne@44
|
100 <param label="Reverse reads" type="data" name="reverse" format="fastq,fastqsanger,fastq.gz,fastqsanger.gz,fastq.bz2,fastqsanger.bz2" />
|
jpayne@0
|
101 </when>
|
jpayne@0
|
102 </conditional>
|
jpayne@0
|
103 </inputs>
|
jpayne@0
|
104 <outputs>
|
jpayne@0
|
105 <data label="${reads.coll.name} alignment" name="align_from_collection" format="sam">
|
jpayne@0
|
106 <filter>reads['reads_select'] == 'collection'</filter>
|
jpayne@0
|
107 </data>
|
jpayne@0
|
108 <data label="${reads.forward.name.split('_')[0]} alignment" name="align_from_history" format="sam">
|
jpayne@0
|
109 <filter>reads['reads_select'] == 'history'</filter>
|
jpayne@0
|
110 </data>
|
jpayne@0
|
111 <data label="S3 Cache log" name="cache_log" format="txt" hidden="true" />
|
jpayne@0
|
112 <data label="Reference" name="ref_out" format="fasta" hidden="true">
|
jpayne@0
|
113 <filter>source['source_select'] == curated</filter>
|
jpayne@0
|
114 </data>
|
jpayne@0
|
115 </outputs>
|
jpayne@0
|
116 <tests>
|
jpayne@0
|
117 <test>
|
jpayne@0
|
118 <param name="source_select" value="history" />
|
jpayne@0
|
119 <param name="reference" value="reference/lambda_virus.fasta" ftype="fasta" />
|
jpayne@0
|
120 <param name="reads_select" value="history" />
|
jpayne@0
|
121 <param name="forward" value="samples/sample1/sample1_1.fastq" ftype="fastqsanger" />
|
jpayne@0
|
122 <param name="reverse" value="samples/sample1/sample1_2.fastq" ftype="fastqsanger" />
|
jpayne@0
|
123 <output name="align_from_history" value="samples/sample1/reads.sam" lines_diff="3" />
|
jpayne@0
|
124 </test>
|
jpayne@0
|
125 <test>
|
jpayne@0
|
126 <param name="source_select" value="history" />
|
jpayne@0
|
127 <param name="reference" value="reference/lambda_virus.fasta" ftype="fasta" />
|
jpayne@0
|
128 <param name="reads_select" value="collection" />
|
jpayne@0
|
129 <param name="coll">
|
jpayne@0
|
130 <collection type="paired">
|
jpayne@0
|
131 <element name="forward" value="samples/sample1/sample1_1.fastq" ftype="fastqsanger" />
|
jpayne@0
|
132 <element name="reverse" value="samples/sample1/sample1_2.fastq" ftype="fastqsanger" />
|
jpayne@0
|
133 </collection>
|
jpayne@0
|
134 </param>
|
jpayne@0
|
135 <output name="align_from_collection" value="samples/sample1/reads.sam" lines_diff="3" />
|
jpayne@0
|
136 </test>
|
jpayne@44
|
137 <test>
|
jpayne@44
|
138 <param name="source_select" value="history" />
|
jpayne@44
|
139 <param name="reference" value="reference/lambda_virus.fasta" ftype="fasta" />
|
jpayne@44
|
140 <param name="reads_select" value="history" />
|
jpayne@44
|
141 <param name="forward" value="samples/sample1/sample1_1.fastq.gz" ftype="fastqsanger.gz" />
|
jpayne@44
|
142 <param name="reverse" value="samples/sample1/sample1_2.fastq.gz" ftype="fastqsanger.gz" />
|
jpayne@44
|
143 <output name="align_from_history" value="samples/sample1/reads.sam" lines_diff="3" />
|
jpayne@44
|
144 </test>
|
jpayne@0
|
145 </tests>
|
jpayne@0
|
146 <help><![CDATA[
|
jpayne@0
|
147 <a href="http://snp-pipeline.readthedocs.io/en/latest/index.html">http://snp-pipeline.readthedocs.io/en/latest/index.html</a>
|
jpayne@0
|
148 ]]></help>
|
jpayne@0
|
149 <citations>
|
jpayne@0
|
150 <citation type="doi">10.7717/peerj-cs.20</citation>
|
jpayne@0
|
151 <!-- <citation type="bibtex">
|
jpayne@0
|
152 @misc{cfsan-snp-pipeline,
|
jpayne@0
|
153 author = {Steve Davis and James Pettengill and Yan Luo and Justin Payne and Albert Shpuntoff and Rugh Rand and Errol Strain},
|
jpayne@0
|
154 year = {2015},
|
jpayne@0
|
155 title = {CFSAN SNP Pipeline: an automated method for constructing SNP matrices from next-generation sequence data},
|
jpayne@0
|
156 url = {https://doi.org/10.7717/peerj-cs.20},
|
jpayne@0
|
157 journal = {PeerJ Computer Science},
|
jpayne@0
|
158 }</citation> -->
|
jpayne@0
|
159 </citations>
|
jpayne@0
|
160 </tool> |