15
|
1 <tool id="rna_star" name="RNA-STAR" version="0.23">
|
|
2 <description>Gapped-read mapper for RNA-seq data</description>
|
|
3 <requirements>
|
23
|
4 <requirement type="package" version="2.3.1z">rnastar</requirement>
|
19
|
5 <requirement type="package" version="0.1.19">samtools</requirement>
|
15
|
6 </requirements>
|
|
7 <command>
|
|
8 ##
|
|
9 ## Run STAR.
|
|
10 ##
|
|
11
|
|
12 STAR
|
|
13 ## Can adjust this as appropriate for the system.
|
|
14 --genomeLoad NoSharedMemory
|
|
15
|
|
16 --genomeDir ${refGenomeSource.index.fields.path}
|
|
17 --readFilesIn $input1
|
|
18 #if $singlePaired.sPaired == "paired"
|
|
19 $singlePaired.input2
|
|
20 #end if
|
|
21 --runThreadN 4
|
|
22 #if $params.settingsType == "full":
|
|
23 --chimSegmentMin $params.chim_segment_min
|
|
24 --chimScoreMin $params.chim_score_min
|
|
25 #end if
|
|
26
|
|
27 ## may or may not need to generate SAM tags and handle non-canonicals for Cufflinks tools.
|
|
28 ${outSAMstrandField} ${outFilterIntronMotifs} ${outSAMattributes}
|
|
29
|
|
30 ;
|
|
31
|
|
32 ##
|
|
33 ## BAM conversion.
|
|
34 ##
|
|
35
|
|
36 ## Convert aligned reads.
|
|
37 samtools view -Shb Aligned.out.sam | samtools sort - Aligned.out
|
|
38
|
|
39 ## Convert chimeric reads.
|
|
40 #if $params.settingsType == "full" and $params.chim_segment_min > 0:
|
|
41 ; samtools view -Shb Chimeric.out.sam | samtools sort - Chimeric.out
|
|
42 #end if
|
|
43 </command>
|
|
44
|
|
45 <stdio>
|
|
46 <regex match=".*" source="both" level="warning" description="generic stdout/err chatter"/>
|
|
47 </stdio>
|
|
48
|
|
49 <inputs>
|
|
50 <param name="jobName" type="text" size="120" value="rna-star run" label="Job narrative (added to output names)"
|
|
51 help="Only letters, numbers and underscores (_) will be retained in this field">
|
|
52 <sanitizer invalid_char="">
|
|
53 <valid initial="string.letters,string.digits"><add value="_" /> </valid>
|
|
54 </sanitizer>
|
|
55 </param>
|
|
56 <!-- FASTQ input(s) and options specifically for paired-end data. -->
|
|
57 <conditional name="singlePaired">
|
|
58 <param name="sPaired" type="select" label="Single ended or mate-pair ended reads in this library?">
|
|
59 <option value="single" selected="true">Single-end</option>
|
|
60 <option value="paired">Paired-end</option>
|
|
61 </param>
|
|
62 <when value="single">
|
|
63 <param format="fastqsanger,fastq,fasta" name="input1" type="data" label="RNA-Seq FASTQ file" help="Nucleotide-space: Must have Sanger-scaled quality values with ASCII offset 33"/>
|
|
64 </when>
|
|
65 <when value="paired">
|
|
66 <param format="fastqsanger,fastq,fasta" name="input1" type="data" label="RNA-Seq FASTQ file, forward reads" help="Nucleotide-space: Must have Sanger-scaled quality values with ASCII offset 33" />
|
|
67 <param format="fastqsanger,fastq,fasta" name="input2" type="data" label="RNA-Seq FASTQ file, reverse reads" help="Nucleotide-space: Must have Sanger-scaled quality values with ASCII offset 33" />
|
|
68 </when>
|
|
69 </conditional>
|
|
70
|
|
71 <!-- Genome source. -->
|
|
72 <conditional name="refGenomeSource">
|
|
73 <param name="genomeSource" type="select" label="Will you select a reference genome from your history or use a built-in index?" help="Built-ins were indexed using default options">
|
|
74 <option value="indexed">Use a built-in index</option>
|
|
75 <option value="history">Use one from the history</option>
|
|
76 </param>
|
|
77 <when value="indexed">
|
|
78 <param name="index" type="select" label="Select a reference genome">
|
|
79 <options from_data_table="rnastar_indexes">
|
|
80 <filter type="sort_by" column="2"/>
|
|
81 <validator type="no_options" message="No indexes are available for the selected input dataset"/>
|
|
82 </options>
|
|
83 </param>
|
|
84 </when>
|
|
85 <when value="history">
|
|
86 <param name="ownFile" type="data" format="fasta" metadata_name="dbkey" label="Select the reference genome" />
|
|
87 </when>
|
|
88 </conditional>
|
|
89 <param name="outSAMattributes" type="select" label="Include extra sam attributes for downstream processing">
|
|
90 <option value="--outSAMattributes Standard">Standard - eg for old Samtools downstream</option>
|
|
91 <option value="--outSAMattributes All" selected="true">All modern Samtools attributes - see below</option>
|
|
92 </param>
|
|
93 <param name="outSAMstrandField" type="select" label="Include extra sam attributes for downstream processing">
|
|
94 <option value="--outSAMstrandField intronMotif" selected="true">Add XS for cufflinks</option>
|
|
95 <option value="">No XS added to sam output</option>
|
|
96 </param>
|
|
97 <param name="outFilterIntronMotifs" type="select" label="Canonical junction preparation for unstranded data">
|
|
98 <option value="">No special handling - all non-canonical junctions passed through</option>
|
|
99 <option value="--outFilterIntronMotifs RemoveNoncanonical" selected="true">Remove all non-canonical junctions for eg cufflinks</option>
|
|
100 <option value="--outFilterIntronMotifs RemoveNoncanonicalUnannotated">Remove only unannotated non-canonical junctions for eg cufflinks</option>
|
|
101 </param>
|
|
102 <!-- Parameter settings. -->
|
|
103 <conditional name="params">
|
|
104 <param name="settingsType" type="select" label="Settings to use" help="You can use the default settings or set custom values for any STAR parameter.">
|
|
105 <option value="preSet" selected="true">Use Defaults</option>
|
|
106 <option value="full">Full parameter list</option>
|
|
107 </param>
|
|
108 <when value="preSet" />
|
|
109 <!-- Full/advanced params. -->
|
|
110 <when value="full">
|
|
111 <param name="chim_segment_min" type="integer" min="0" value="0" label="Minimum chimeric segment length" />
|
|
112 <param name="chim_score_min" type="integer" min="0" value="0" label="Minimum total (summed) score of the chimeric segments" />
|
|
113
|
|
114 </when>
|
|
115 </conditional>
|
|
116 </inputs>
|
|
117
|
|
118 <outputs>
|
|
119 <data format="txt" name="output_log" label="${on_string}_{jobName}.log" from_work_dir="Log.final.out"/>
|
|
120 <data format="interval" name="chimeric_junctions" label="${on_string}_{jobName}_starchimjunc.bed" from_work_dir="Chimeric.out.junction">
|
|
121 <filter>(params['settingsType'] == 'full' and params['chim_segment_min'] > 0)</filter>
|
|
122 <actions>
|
|
123 <conditional name="refGenomeSource.genomeSource">
|
|
124 <when value="indexed">
|
|
125 <action type="metadata" name="dbkey">
|
|
126 <option type="from_data_table" name="star_indexes" column="1" offset="0">
|
|
127 <filter type="param_value" column="0" value="#" compare="startswith" keep="False"/>
|
|
128 <filter type="param_value" ref="refGenomeSource.index" column="0"/>
|
|
129 </option>
|
|
130 </action>
|
|
131 </when>
|
|
132 <when value="history">
|
|
133 <action type="metadata" name="dbkey">
|
|
134 <option type="from_param" name="refGenomeSource.ownFile" param_attribute="dbkey" />
|
|
135 </action>
|
|
136 </when>
|
|
137 </conditional>
|
|
138 </actions>
|
|
139 </data>
|
|
140 <data format="bam" name="chimeric_reads" label="${on_string}_${jobName}_starmappedchim.bam"
|
|
141 from_work_dir="Chimeric.out.bam">
|
|
142 <filter>(params['settingsType'] == 'full' and params['chim_segment_min'] > 0)</filter>
|
|
143 <actions>
|
|
144 <conditional name="refGenomeSource.genomeSource">
|
|
145 <when value="indexed">
|
|
146 <action type="metadata" name="dbkey">
|
|
147 <option type="from_data_table" name="star_indexes" column="1" offset="0">
|
|
148 <filter type="param_value" column="0" value="#" compare="startswith" keep="False"/>
|
|
149 <filter type="param_value" ref="refGenomeSource.index" column="0"/>
|
|
150 </option>
|
|
151 </action>
|
|
152 </when>
|
|
153 <when value="history">
|
|
154 <action type="metadata" name="dbkey">
|
|
155 <option type="from_param" name="refGenomeSource.ownFile" param_attribute="dbkey" />
|
|
156 </action>
|
|
157 </when>
|
|
158 </conditional>
|
|
159 </actions>
|
|
160 </data>
|
|
161 <data format="interval" name="splice_junctions" label="${on_string}_${jobName}_starsplicejunct.bed"
|
|
162 from_work_dir="SJ.out.tab">
|
|
163 <actions>
|
|
164 <conditional name="refGenomeSource.genomeSource">
|
|
165 <when value="indexed">
|
|
166 <action type="metadata" name="dbkey">
|
|
167 <option type="from_data_table" name="star_indexes" column="1" offset="0">
|
|
168 <filter type="param_value" column="0" value="#" compare="startswith" keep="False"/>
|
|
169 <filter type="param_value" ref="refGenomeSource.index" column="0"/>
|
|
170 </option>
|
|
171 </action>
|
|
172 </when>
|
|
173 <when value="history">
|
|
174 <action type="metadata" name="dbkey">
|
|
175 <option type="from_param" name="refGenomeSource.ownFile" param_attribute="dbkey" />
|
|
176 </action>
|
|
177 </when>
|
|
178 </conditional>
|
|
179 </actions>
|
|
180 </data>
|
|
181 <data format="bam" name="mapped_reads" label="${on_string}_${jobName}_starmapped.bam"
|
|
182 from_work_dir="Aligned.out.bam">
|
|
183 <actions>
|
|
184 <conditional name="refGenomeSource.genomeSource">
|
|
185 <when value="indexed">
|
|
186 <action type="metadata" name="dbkey">
|
|
187 <option type="from_data_table" name="star_indexes" column="1" offset="0">
|
|
188 <filter type="param_value" column="0" value="#" compare="startswith" keep="False"/>
|
|
189 <filter type="param_value" ref="refGenomeSource.index" column="0"/>
|
|
190 </option>
|
|
191 </action>
|
|
192 </when>
|
|
193 <when value="history">
|
|
194 <action type="metadata" name="dbkey">
|
|
195 <option type="from_param" name="refGenomeSource.ownFile" param_attribute="dbkey" />
|
|
196 </action>
|
|
197 </when>
|
|
198 </conditional>
|
|
199 </actions>
|
|
200 </data>
|
|
201 </outputs>
|
|
202 <help>
|
|
203
|
|
204 **What it does**
|
|
205 Runs the rna star gapped aligner. Suited to paired or single end rna-seq.
|
|
206
|
|
207 8.2: SAM alignments
|
|
208
|
|
209 The number of loci Nmap a read maps to (multi-mapping) is given by NH:i: field.
|
|
210 The mapping quality MAPQ (column 5) is 255 for uniquely mapping reads, and int(-10*log10(1-1/Nmap)) for
|
|
211 multi-mapping reads. This scheme is same as the one used by Tophat and is compatible with Cufflinks.
|
|
212
|
|
213 For multi-mappers, all alignments except one are marked with 0x100 (secondary alignment) in the FLAG
|
|
214 column 2. The un-marked alignment is either the best one (i.e. highest scoring), or is randomly selected from
|
|
215 the alignments of equal quality.
|
|
216
|
|
217 8.2.1: Standard SAM attributes
|
|
218 With default --outSAMattributes Standard option the following SAM attributes will be generated:
|
|
219
|
|
220 Column 12: NH: number of loci a read (pair) maps to
|
|
221 Column 13: IH: alignment index for all alignments of a read
|
|
222 Column 14: aS: alignment score
|
|
223 Column 15: nM: number of mismatches (does not include indels)
|
|
224
|
|
225 8.2.2: Extra SAM attrbiutes
|
|
226 If --outSAMattributes All option is used, the following additional attributes will be output:
|
|
227
|
|
228 Column 16: jM:B:c,M1,M2,... Intron motifs for all junctions (i.e. N in CIGAR):
|
|
229 0: non-canonical; 1:GT/AG, 2: CT/AC, 3: GC/AG, 4: CT/GC, 5: AT/AC, 6: GT/AT.
|
|
230
|
|
231 If splice junctions database is used, and a junction is annotated, 20 is added to its motif value.
|
|
232 Column 17: jI:B:I,Start1,End1,Start2,End2,... Start and End of introns for all junctions (1-based)
|
|
233
|
|
234 Note, that samtools 0.1.18 or later have to be used with these extra attributes.
|
|
235
|
|
236
|
|
237 8.2.3: XS SAM strand attribute for Cufflinks/Cuffdiff
|
|
238
|
|
239 If you have un-stranded RNA-seq data, and wish to run Cufflinks/Cuffdiff on STAR alignments, you will
|
|
240 need to run STAR with --outSAMstrandField intronMotif option, which will generate the XS
|
|
241 strand attribute for all alignments that contain splice junctions. The spliced alignments that have undefined
|
|
242 strand (i.e. containing only non-canonical junctions) will be suppressed.
|
|
243
|
|
244 If you have stranded RNA-seq data, you do not need to use any specific STAR options. Instead, you need
|
|
245 to run Cufflinks with the library option --library-type options. For example, cufflinks with
|
|
246 library-type fr-firststrand should be used for the “standard” dUTP protocol.
|
|
247 This option has to be used only for Cufflinks runs and not for STAR runs.
|
|
248
|
|
249 It is recommended to remove the non-canonical junctions for Cufflinks runs using –
|
|
250
|
|
251 --outFilterIntronMotifs RemoveNoncanonical
|
|
252 filter out alignments that contain non-canonical junctions
|
|
253
|
|
254 OR
|
|
255
|
|
256 --outFilterIntronMotifs RemoveNoncanonicalUnannotated
|
|
257 filter out alignments that contain non-canonical unannotated junctions
|
|
258 when using annotated splice junctions database. The annotated non-
|
|
259 canonical junctions will be kept.
|
|
260
|
|
261
|
|
262 **Attributions**
|
|
263
|
|
264 Note that each component has its own license. Good luck with figuring out your obligations.
|
|
265
|
|
266 rna_star - see the web site at rna_star_
|
|
267
|
|
268 For details, please see the rna_starMS_
|
|
269 "STAR: ultrafast universal RNA-seq aligner"
|
|
270 A. Dobin et al, Bioinformatics 2012; doi: 10.1093/bioinformatics/bts635
|
|
271
|
|
272 Galaxy_ (that's what you are using right now!) for gluing everything together
|
|
273
|
|
274 Most of the work for this wrapper XML is Jeremy Goecks' original STAR_ wrapper
|
|
275
|
|
276 Minor tweaks to output names to suit our downstream purposes, toolshed automated dependencies
|
|
277 and odds and ends of other code and documentation comprising this tool was
|
|
278 written by Ross Lazarus and that part is licensed_ the same way as other rgenetics artefacts
|
|
279
|
|
280 .. _STAR: https://bitbucket.org/jgoecks/jeremys-code/raw/fa1930a689b8e2f6b59cc1706e5ba0ed8ad357be/galaxy/tool-wrappers/star.xml
|
|
281 .. _licensed: http://creativecommons.org/licenses/by-nc-nd/3.0/
|
|
282 .. _rna_star: http://code.google.com/p/rna-star/
|
|
283 .. _rna_starMS: http://bioinformatics.oxfordjournals.org/content/29/1/15.full
|
|
284 .. _Galaxy: http://getgalaxy.org
|
|
285
|
|
286 </help>
|
|
287 </tool>
|