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