0
|
1 <tool id="ideas" name="IDEAS" version="1.2.0">
|
|
2 <description>accounts for position dependent epigenetic events and detects local cell type relationships</description>
|
|
3 <requirements>
|
|
4 <requirement type="package" version="2.26.0">bedtools</requirement>
|
|
5 <requirement type="package" version="332">ucsc-bedgraphtobigwig</requirement>
|
|
6 <requirement type="package" version="332">ucsc-bedsort</requirement>
|
|
7 <requirement type="package" version="332">ucsc-bigwigaverageoverbed</requirement>
|
|
8 <requirement type="package" version="1.20">ideas</requirement>
|
|
9 <requirement type="package" version="1.10.4">r-data.table</requirement>
|
|
10 <requirement type="package" version="1.4.4">r-optparse</requirement>
|
|
11 </requirements>
|
|
12 <command detect_errors="exit_code"><![CDATA[
|
|
13 #import os
|
|
14 #set perform_training = $perform_training_cond.perform_training
|
|
15
|
|
16 ## Extract the input's compressed tmp directory archive.
|
|
17 tar -xzf $input.metadata.tmp_archive &&
|
|
18
|
|
19 ## Define and create output directories.
|
|
20 #set output_pdf_dir = "output_pdf_dir"
|
|
21 #set output_txt_dir = "output_txt_dir"
|
|
22 #set output_training_dir = "output_training_dir"
|
|
23 #if str($output_heatmaps) == "yes":
|
|
24 mkdir '$output_pdf_dir' &&
|
|
25 #end if
|
|
26 #if str($perform_training) == "yes":
|
|
27 #set output_dir = $output_training_dir
|
|
28 mkdir '$output_training_dir' &&
|
|
29 #else:
|
|
30 #set output_dir = $output_txt_dir
|
|
31 mkdir '$output_txt_dir' &&
|
|
32 #end if
|
|
33
|
|
34 Rscript '$__tool_directory__/ideas.R'
|
|
35 --burnin_num $burnin_num
|
|
36 #if str($bychr) == "true":
|
|
37 --bychr true
|
|
38 #end if
|
|
39 #if str($input.metadata.chrom_bed) not in ['', 'None']:
|
|
40 --chrom_bed_input $input.metadata.chrom_bed
|
|
41 #end if
|
|
42 #if str($input.metadata.chrom_windows) not in ['' 'None']:
|
|
43 --chromosome_windows $input.metadata.chrom_windows
|
|
44 #end if
|
|
45 #if str($hp) == "true":
|
|
46 --hp true
|
|
47 #end if
|
|
48 #if str($initial_states) != "0":
|
|
49 --initial_states $initial_states
|
|
50 #end if
|
|
51 --ideas_input_config $input.metadata.input_config
|
|
52 #if str($log2) != "0.0":
|
|
53 --log2 $log2
|
|
54 #end if
|
|
55 #if str($maxerr) != "0.0":
|
|
56 --maxerr $maxerr
|
|
57 #end if
|
|
58 #if str($max_cell_type_clusters) != "0":
|
|
59 --max_cell_type_clusters $max_cell_type_clusters
|
|
60 #end if
|
|
61 #if str($max_position_classes) != "0":
|
|
62 --max_position_classes $max_position_classes
|
|
63 #end if
|
|
64 #if str($max_states) != "0.0":
|
|
65 --max_states $max_states
|
|
66 #end if
|
|
67 --mcmc_num $mcmc_num
|
|
68 #if str($minerr) != "0.0":
|
|
69 --minerr $minerr
|
|
70 #end if
|
|
71 --output_dir $output_dir
|
|
72 #if str($prior_concentration) != "0.0":
|
|
73 --prior_concentration $prior_concentration
|
|
74 #end if
|
|
75 --project_name '$project_name'
|
|
76 #if str($save_ideas_log) == "yes":
|
|
77 --save_ideas_log $save_ideas_log
|
|
78 --output_log '$output_log'
|
|
79 #end if
|
|
80 #if str($standardize_datasets) == "true":
|
|
81 --standardize_datasets true
|
|
82 #end if
|
|
83 --rseed $rseed
|
|
84 --thread \${GALAXY_SLOTS:-4}
|
|
85 #if str($perform_training) == "yes":
|
|
86 --training_iterations $perform_training_cond.training_iterations
|
|
87 --training_windows $perform_training_cond.training_windows
|
|
88 #end if
|
|
89 #if str($perform_training) == "yes":
|
|
90 && mv ./*.para0 '$output_dir'
|
|
91 && mv ./*.profile0 '$output_dir'
|
|
92 #else:
|
|
93 && mv ./*.para '$output_dir'
|
|
94 && mv ./*.profile '$output_dir'
|
|
95 #end if
|
|
96 && mv ./*.cluster '$output_dir'
|
|
97 && mv ./*.state '$output_dir'
|
|
98 #if str($output_heatmaps) == "yes":
|
|
99 && Rscript '$__tool_directory__/create_heatmaps.R'
|
|
100 --input_dir '$output_dir'
|
|
101 --output_dir '$output_pdf_dir'
|
|
102 --script_dir '$__tool_directory__'
|
|
103 #if str($perform_training) == "yes":
|
|
104 --in_training_mode true
|
|
105 #end if
|
|
106 #end if
|
|
107 ]]></command>
|
|
108 <inputs>
|
|
109 <conditional name="perform_training_cond">
|
|
110 <param name="perform_training" type="select" label="Perform training?">
|
|
111 <option value="yes" selected="true">Yes</option>
|
|
112 <option value="no">No</option>
|
|
113 </param>
|
|
114 <when value="yes">
|
|
115 <param name="training_iterations" type="integer" value="20" min="3" label="Number of training iterations"/>
|
|
116 <param name="training_windows" type="integer" value="10000" min="2" label="Number of randomly selected windows for training"/>
|
|
117 </when>
|
|
118 <when value="no"/>
|
|
119 </conditional>
|
|
120 <param name="input" type="data" format="ideaspre" label="Select IDEAS input"/>
|
|
121 <param name="project_name" type="text" value="myProject" label="Project name" help="Outputs will have this base name">
|
|
122 <validator type="empty_field"/>
|
|
123 </param>
|
|
124 <param name="rseed" type="integer" value="1234" min="0" max="1000000" label="Seed for IDEAS model initialization" help="Zero value generates a random seed, and this seed will be different for each job run."/>
|
|
125 <param name="bychr" type="boolean" truevalue="true" falsevalue="" checked="False" label="Output chromosomes in separate files"/>
|
|
126 <param name="reads_per_bp" type="select" display="radio" label="Calculate the signal in each window using">
|
|
127 <option value="6" selected="true">mean</option>
|
|
128 <option value="8">max</option>
|
|
129 </param>
|
|
130 <param name="hp" type="boolean" truevalue="true" falsevalue="" checked="False" label="Discourage state transition across chromosomes"/>
|
|
131 <param name="log2" type="float" value="0" min="0" label="Use log2(x+number) transformation" help="Zero means no log2 transformation"/>
|
|
132 <param name="max_states" type="float" value="0" min="0" label="Maximum number of states to be inferred" help="Zero sets the maximum to a large number"/>
|
|
133 <param name="initial_states" type="integer" value="20" min="0" label="Initial number of states" help="Positive integer"/>
|
|
134 <param name="max_position_classes" type="integer" value="0" min="0" label="Maximum number of position classes to be inferred" help="Zero sets the maximum to a large number"/>
|
|
135 <param name="max_cell_type_clusters" type="integer" value="0" min="0" label="Maximum number of cell type clusters allowed" help="Zero sets the maximum to a large number"/>
|
|
136 <param name="prior_concentration" type="float" value="1" min="0" label="Prior concentration" help="Zero value results in the default: sqrt(number of cell types)"/>
|
|
137 <param name="standardize_datasets" type="boolean" truevalue="true" falsevalue="" checked="False" label="Standardize all datasets"/>
|
|
138 <param name="burnin_num" type="integer" value="20" min="1" label="Number of burnin steps"/>
|
|
139 <param name="mcmc_num" type="integer" value="20" min="1" label="Number of maximization steps"/>
|
|
140 <param name="minerr" type="float" value="0.5" min="0" label="Minimum standard deviation for the emission Gaussian distribution" help="Zero value results in the default: 0.5"/>
|
|
141 <param name="maxerr" type="float" value="1000000" min="0" label="Maximum standard deviation for the emission Gaussian distribution" help="Zero sets the maximum to a large number"/>
|
|
142 <param name="output_heatmaps" type="select" display="radio" label="Output heatmaps?">
|
|
143 <option value="yes" selected="true">Yes</option>
|
|
144 <option value="no">No</option>
|
|
145 </param>
|
|
146 <param name="save_ideas_log" type="select" display="radio" label="Save IDEAS log in an additional history item">
|
|
147 <option value="no" selected="true">No</option>
|
|
148 <option value="yes">Yes</option>
|
|
149 </param>
|
|
150 </inputs>
|
|
151 <outputs>
|
|
152 <data name="output_log" format="txt" label="${tool.name} (output log) on ${on_string}">
|
|
153 <filter>save_ideas_log == 'yes'</filter>
|
|
154 </data>
|
|
155 <collection name="output_pdf_collection" type="list" label="${tool.name} (heatmaps) on ${on_string}">
|
|
156 <discover_datasets pattern="__name__" directory="output_pdf_dir" format="pdf"/>
|
|
157 <filter>output_heatmaps == 'yes'</filter>
|
|
158 </collection>
|
|
159 <collection name="output_txt_collection" type="list">
|
|
160 <discover_datasets pattern="__name__" directory="output_txt_dir" format="txt"/>
|
|
161 <filter>perform_training_cond['perform_training'] == 'no'</filter>
|
|
162 </collection>
|
|
163 <collection name="output_training_collection" type="list">
|
|
164 <discover_datasets pattern="__name__" directory="output_training_dir" format="txt"/>
|
|
165 <filter>perform_training_cond['perform_training'] == 'yes'</filter>
|
|
166 </collection>
|
|
167 </outputs>
|
|
168 <tests>
|
|
169 <test>
|
|
170 <param name="perform_training" value="yes"/>
|
|
171 <param name="training_iterations" value="3"/>
|
|
172 <param name="input" value="ideas_test1/input.html" dbkey="hg19" ftype="ideaspre">
|
|
173 <!--
|
|
174 The order is critical here - it must be the same as is displayed on the upload form!
|
|
175 Also, there seems to be a bug with the composite upload form tab. All datasets must
|
|
176 be selected whether they are optional or not. Here the chromosome_windows.txt file
|
|
177 was generated during a manual execution of ideas_preprocessor tool, specifying chrom
|
|
178 windows.
|
|
179 -->
|
|
180 <composite_data value='ideas_test1/chromosome_windows.txt'/>
|
|
181 <composite_data value='ideas_test1/chromosomes.bed'/>
|
|
182 <composite_data value='ideas_test1/IDEAS_input_config.txt'/>
|
|
183 <composite_data value='ideas_test1/tmp.tar.gz'/>
|
|
184 </param>
|
|
185 <param name="output_heatmaps" value="yes"/>
|
|
186 <param name="project_name" value="IDEAS_out"/>
|
|
187 <output_collection name="output_training_collection" type="list">
|
|
188 <element name="IDEAS_out.chr1.cluster" file="IDEAS_out.chr1.cluster" ftype="txt"/>
|
|
189 <element name="IDEAS_out.chr2.cluster" file="IDEAS_out.chr2.cluster" ftype="txt"/>
|
|
190 <element name="IDEAS_out.chr1.state" file="IDEAS_out.chr1.state" ftype="txt"/>
|
|
191 <element name="IDEAS_out.chr2.state" file="IDEAS_out.chr2.state" ftype="txt"/>
|
|
192 <element name="IDEAS_out.para0" file="IDEAS_out.para0" ftype="txt"/>
|
|
193 <element name="IDEAS_out.profile0" file="IDEAS_out.profile0" ftype="txt" compare="contains"/>
|
|
194 </output_collection>
|
|
195 <output_collection name="output_pdf_collection" type="list">
|
|
196 <element name="IDEAS_out.state.1.pdf" file="IDEAS_out.state.1.pdf" ftype="pdf" compare="contains"/>
|
|
197 </output_collection>
|
|
198 </test>
|
|
199 </tests>
|
|
200 <help>
|
|
201 **What it does**
|
|
202
|
|
203 IDEAS (an **I**\ ntegrative and **D**\ iscriminative **E**\ pigenome **A**\ nnotation **S**\ ystem) identifies
|
|
204 de novo regulatory functions from epigenetic data in multiple cell types jointly. It is a full probabilistic
|
|
205 model defined on all data, and it combines signals across both the genome and cell types to boost power. The
|
|
206 underlying assumption of IDEAS is that, because all cell types share the same underlying DNA sequences,
|
|
207 **functions of each DNA segment should be correlated**. Also, cell type specific regulation is locus-dependent,
|
|
208 and so IDEAS uses local epigenetic landscape to **identify de novo and local cell type clusters** without
|
|
209 assuming or requiring a known global cell type relationship.
|
|
210
|
|
211 The input is a single dataset with the **IdeasPre** datatype, which is produced by the IDEAS Preprocessor tool.
|
|
212
|
|
213 .. image:: $PATH_TO_IMAGES/ideas.png
|
|
214
|
|
215 IDEAS predicts regulatory functions, denoted by epigenetic states, at each position in each cell type by
|
|
216 **combining information simultaneously learned from other cell types** at the same positions in cell types with
|
|
217 similar local epigenetic landscapes. Size of genomic intervals for determining the similarity are also learned.
|
|
218 All of the inferences are done through parallel infinite-state hidden Markov models (iHMM), which is a Bayesian
|
|
219 non-parametric technique to automatically determine the number of local cell type clusters and the number of
|
|
220 epigenetic states.
|
|
221
|
|
222 In addition to its improved power, IDEAS has two unique advantages:
|
|
223
|
|
224 1) applies **linear time inference** with respect to the number of cell types, which allows it to study hundreds or more cell types jointly
|
|
225 2) uses mini-batch training to **improve reproducibility** of the predicted epigenetic states, which is important because genome segmentation is not convex and hence cannot guarantee a global optimal solution.
|
|
226
|
|
227 -----
|
|
228
|
|
229 **Options**
|
|
230
|
|
231 * **Perform training** - select "Yes" to run the specified number of training iterations, running IDEAS with the parameter values and producing outputs. After training, these outputs are combined into a single dataset which is then used in conjunction with the inputs for the actual analysis. This process improves the accuracy of the final results.
|
|
232
|
|
233 * **Number of training iterations** - the number of times to execute IDEAS with the specified parameter values on the selected inputs to produce the training results. The minimum number of iterations is 3.
|
|
234 * **Number of randomly selected windows for training** - the number of chromosome windows within the input datasets from which to randomly select data for training.
|
|
235
|
|
236 * **Set cell type and epigenetic factor names by** - cell type and epigenetic factor names can be set manually or by extracting them from the names of the selected input datasets. The latter case requires all selected datasets to have names that contain a "-" character.
|
|
237
|
|
238 * **BAM or BigWig files** - select one or more Bam or Bigwig files from your history, making sure that the name of every selected input include a "-" character (e.g., e001-h3k4me3.bigwig).
|
|
239 * **Cell type, Epigenetic factor and Input** - manually select any number of inputs, setting the cell type and epigenetic factor name for each. The combination of "cell type name" and "epigenetic factor name" must be unique for each input. For example, if you have replicate data you may want to specify the cell name as "rep1", "rep2", etc and the factor name as "rep1", "rep2", etc.
|
|
240
|
|
241 * **Cell type name** - cell type name
|
|
242 * **Epigenetic factor name** - epigenetic factor name
|
|
243 * **BAM or BigWig file** - BAM or BigWig file
|
|
244
|
|
245 * **Project name** - datasets produced by IDEAS will have this base name.
|
|
246 * **Seed for IDEAS model initialization** - enter an integer to be used as the seed for the IDEAS model initialization. A zero value causes IDEAS to automatically generate a random seed, and this seed will be different for each job run.
|
|
247 * **Output chromosomes in separate files** - select "Yes" to produce separate files for each chromosome, allowing you to run IDEAS on different chromosomes separately.
|
|
248 * **Calculate the signal in each window using** - use the bigWigAverageOverBed utility from the UCSC genome browser to calculate the signal (i.e., the number of reads per bp) in each window.
|
|
249 * **Standardize all datasets** - select "Yes" to standardize all datasets (e.g., reads / total_reads * 20 million) so that the signals from different cell types become comparable - your datasets can be read counts, logp-values or fold change.
|
|
250 * **Discourage state transition across chromosomes** - select "Yes" to produce similar states in adjacent windows, making the annotation smoother, but at risk of reducing precision.
|
|
251 * **Use log2(x+number) transformation** - perform Log2-transformation of the input data by log2(x+number) (recommended for read count data to reduce skewness). You can enter a number that is representative of the noise level in your data (e.g., a number less than 1). If this number is at a similar scale or larger than the signal in your data, it will lose power. For example, if your input data is mean read count per window, using 0.1 may produce better results.
|
|
252 * **Maximum number of states to be inferred** - restrict the maximum number of states to be generated by IDEAS; the final number of inferred states may be smaller than the number you specified
|
|
253 * **Initial number of states** - while IDEAS may infer 30 states or more by starting from just 20 states, it may not do so if it is trapped in a local mode. We recommend setting the initial number of states slightly larger than the number of states you expect.
|
|
254 * **Maximum number of position classes to be inferred** - Set this value only if:
|
|
255
|
|
256 * you do not want position classes (e.g., for testing purposes), in this case set the value to 1
|
|
257 * IDEAS runs slow because there are too many position classes, generally less than 100 position classes will run fine
|
|
258
|
|
259 * **Maximum number of cell type clusters allowed** - If you set the value to 1, then all cell types will be clustered in one group, which may be desirable if all cell types are homogeneous and you want IDEAS to use information in all cell types equally.
|
|
260 * **Prior concentration** - specify the prior concentration parameter; default is A=sqrt(number of cell types). A smaller concentration parameter (e.g., 1 or less) will emphasize more on position specificity and a larger concentration parameter (e.g., 10 * number of cell types) will emphasize more on global homogeneity.
|
|
261 * **Number of burnin steps** - specify the number of burnin steps; default is 20. Increasing the burnin and maximization steps will increase computing and only slightly increase accuracy, while decreasing them will reduce computing resources but may also reduce accuracy. We recommend to run IDEAS with at least 20 burnins and 20 maximizations. IDEAS will not stop even if it reaches a maximum mode.
|
|
262 * **Number of maximization steps** - specify the number of maximization steps; default is 20.
|
|
263 * **Minimum standard deviation for the emission Gaussian distribution** - This number multiplied by the overall standard deviation of your data will be used as a lower bound for the standard deviation for each factor in each epigenetic state (the default is 0.5). This number is useful for removing very subtle clusters in the data. Setting this value near 0 will allow IDEAS to discover many subtle states, while setting it greater than 1 will result in IDEAS losing the ability to detect meaningful states.
|
|
264 * **Maximim standard deviation for the emission Gaussian distribution** - if you want to find fine-grained states you may use this option (if not used, IDEAS uses infinity), but it is rearely used unless you need more states to be inferred.
|
|
265 * **Output heatmaps** - select "Yes" to produce an additional dataset collection consisting of PDF datasets, one for each dataset with a .para extension in the primary IDEAS output dataset collection.
|
|
266 * **Save IDEAS log in an additional history item** - select "Yes" to produce an additional history item that contains the entire IDEAS processing log.
|
|
267 </help>
|
|
268 <citations>
|
|
269 <citation type="doi">10.1093/nar/gkw278</citation>
|
|
270 </citations>
|
|
271 </tool>
|