comparison bamCompare.xml @ 0:105b9da2445c draft

planemo upload for repository https://github.com/fidelram/deepTools/tree/master/galaxy/wrapper/ commit 0a9265a12a303b54cdaa974e82e87c2ac60962ee-dirty
author bgruening
date Mon, 25 Jan 2016 20:25:37 -0500
parents
children e237a134059a
comparison
equal deleted inserted replaced
-1:000000000000 0:105b9da2445c
1 <tool id="deeptools_bam_compare" name="bamCompare" version="@WRAPPER_VERSION@.0">
2 <description>normalizes and compares two BAM files to obtain the ratio, log2ratio or difference between them</description>
3 <macros>
4 <token name="@BINARY@">bamCompare</token>
5 <import>deepTools_macros.xml</import>
6 </macros>
7 <expand macro="requirements" />
8 <command>
9 <![CDATA[
10 ln -s '$bamFile1' one.bam &&
11 ln -s '${bamFile1.metadata.bam_index}' one.bam.bai &&
12 ln -s '$bamFile2' two.bam &&
13 ln -s '${bamFile2.metadata.bam_index}' two.bam.bai &&
14
15 @BINARY@
16 @THREADS@
17 --bamfile1 one.bam
18 --bamfile2 two.bam
19
20 --outFileName '$outFileName'
21 --outFileFormat '$outFileFormat'
22
23 --binSize $binSize
24
25 #if $scaling.method == 'SES':
26 --scaleFactorsMethod SES
27 --sampleLength $scaling.sampleLength
28 --numberOfSamples $scaling.numberOfSamples
29 #elif $scaling.method == 'readCount':
30 --scaleFactorsMethod readCount
31 #elif $scaling.method == 'own':
32 --scaleFactors '$scaling.scaleFactor1:$scaling.scaleFactor2'
33 #end if
34
35 --ratio $comparison.type
36
37 #if $comparison.type == 'subtract':
38 #if $comparison.normalization.type == 'rpkm':
39 --normalizeUsingRPKM
40 #elif $comparison.normalization.type == '1x':
41
42 #if $comparison.normalization.effectiveGenomeSize.effectiveGenomeSize_opt == "specific":
43 --normalizeTo1x $comparison.normalization.effectiveGenomeSize.effectiveGenomeSize
44 #else:
45 --normalizeTo1x $comparison.normalization.effectiveGenomeSize.effectiveGenomeSize_opt
46 #end if
47
48 #end if
49 #elif $comparison.type in ['ratio','log2']:
50 --pseudocount $comparison.pseudocount
51 #end if
52
53 #if str($region).strip() != '':
54 --region '$region'
55 #end if
56
57 #if $advancedOpt.showAdvancedOpt == "yes":
58 #if $advancedOpt.smoothLength:
59 --smoothLength '$advancedOpt.smoothLength'
60 #end if
61
62 @ADVANCED_OPTS_READ_PROCESSING@
63 $advancedOpt.skipNAs
64
65 #if str($advancedOpt.ignoreForNormalization).strip() != '':
66 --ignoreForNormalization '$advancedOpt.ignoreForNormalization'
67 #end if
68 #end if
69 ]]>
70 </command>
71 <inputs>
72 <param argument="--bamFile1" format="bam" type="data" label="First BAM file (e.g. treated sample)"
73 help="The BAM file must be sorted."/>
74 <param argument="--bamFile2" format="bam" type="data" label="Second BAM file (e.g. control sample)"
75 help="The BAM file must be sorted."/>
76
77 <param argument="--binSize" type="integer" value="50" min="1"
78 label="Bin size in bases"
79 help="The genome will be divided into bins of the specified size. For each bin, the overlaping number of fragments (or reads) will be reported.
80 If only half a fragment overlaps then this fraction will be reported."/>
81
82 <conditional name="scaling">
83 <param name="method" type="select"
84 label="Method to use for scaling the largest sample to the smallest">
85 <option value="readCount" selected="true">read count</option>
86 <option value="SES">signal extraction scaling (SES), check with plotFingerprint before using it!</option>
87 <option value="own">enter own scaling factors</option>
88 </param>
89 <when value="SES">
90 <param argument="--sampleLength" type="integer" value="1000" min="10"
91 label="Length in bases used to sample the genome and compute the size or scaling factors."
92 help="The default is fine. Only change it if you know what you are doing." />
93 <param argument="--numberOfSamples" type="integer" value="100000" min="0"
94 label="Number of samplings taken from the genome to compute the scaling factors"
95 help="" />
96 </when>
97 <when value="readCount" />
98 <when value="own">
99 <expand macro="scaleFactors" />
100 </when>
101 </conditional>
102
103 <conditional name="comparison">
104 <param name="type" type="select"
105 label="How to compare the two files"
106 help="The default is to output the log2ratio between the two samples.
107 The reciprocal ratio returns the negative of the inverse of the ratio if
108 the ratio is less than 0. The resulting values are interpreted as negative fold changes.">
109 <option value="log2" selected="true">Compute log2 of the number of reads ratio</option>
110 <option value="ratio">Compute the ratio of the number of reads</option>
111 <option value="subtract">Compute difference (subtract input from treatment) of the number of reads</option>
112 <option value="add">Compute the sum of number of reads</option>
113 <option value="reciprocal_ratio">Computes the fold change. If the fold change is less than 1, the negative of the inverse is reported. E.g. A fold change of 10 to 5 would be reported not as 0.5 but as -2</option>
114 </param>
115 <when value="log2">
116 <expand macro="pseudocount" />
117 </when>
118 <when value="ratio">
119 <expand macro="pseudocount" />
120 </when>
121 <when value="add" />
122 <when value="reciprocal_ratio">
123 <expand macro="pseudocount" />
124 </when>
125 <when value="subtract">
126 <conditional name="normalization">
127 <param name="type" type="select" label="Normalization method" >
128 <option value="1x">Normalize coverage to 1x</option>
129 <option value="rpkm">Normalize to fragments (reads) per kilobase per million (RPKM)</option>
130 <option value="no">Do not normalize or scale</option>
131 </param>
132 <when value="rpkm" />
133 <when value="no" />
134 <when value="1x">
135 <expand macro="effectiveGenomeSize" />
136 </when>
137 </conditional>
138 </when>
139 </conditional>
140
141 <param name="outFileFormat" type="select" label="Coverage file format">
142 <option value="bigwig" selected="true">bigwig</option>
143 <option value="bedgraph">bedgraph</option>
144 </param>
145 <expand macro="region_limit_operation" />
146 <conditional name="advancedOpt">
147 <param name="showAdvancedOpt" type="select" label="Show advanced options" >
148 <option value="no" selected="true">no</option>
149 <option value="yes">yes</option>
150 </param>
151 <when value="no" />
152 <when value="yes">
153 <expand macro="smoothLength" />
154 <expand macro="read_processing_options" />
155
156 <expand macro="skipNAs" />
157 <param argument="--ignoreForNormalization" type="text" value="" size="50"
158 label="regions that should be excluded for calculating the scaling factor"
159 help="Sometimes it makes sense to exclude certain regions when calculating the scaling factor.
160 For example, if you know of copy number variations between samples then you may want to exclude these.
161 Another typical example is the difference in chromosome X copies between males and females in many species.
162 Example inputs are chrX,chrY,chr3 or chr10:12220-128932" />
163 </when>
164 </conditional>
165 </inputs>
166 <outputs>
167 <data format="bigwig" name="outFileName">
168 <change_format>
169 <when input="outFileFormat" value="bigwig" format="bigwig" />
170 <when input="outFileFormat" value="bedgraph" format="bedgraph" />
171 </change_format>
172 </data>
173 </outputs>
174 <tests>
175 <test>
176 <param name="bamFile1" value="bowtie2-test1.bam" ftype="bam" />
177 <param name="bamFile2" value="bowtie2-test1.bam" ftype="bam" />
178 <param name="showAdvancedOpt" value="no" />
179 <param name="outFileFormat" value="bigwig" />
180 <param name="outFileFormat" value="bedgraph" />
181 <param name="binSize" value="5" />
182 <param name="type" value="ratio" />
183 <output name="outFileName" file="bamCompare_result1.bg" ftype="bedgraph" />
184 </test>
185 <test>
186 <param name="bamFile1" value="bowtie2-test1.bam" ftype="bam" />
187 <param name="bamFile2" value="bowtie2-test1.bam" ftype="bam" />
188 <param name="showAdvancedOpt" value="yes" />
189 <param name="outFileFormat" value="bigwig" />
190 <param name="outFileFormat" value="bigwig" />
191 <param name="binSize" value="10" />
192 <param name="type" value="ratio" />
193 <output name="outFileName" file="bamCompare_result2.bw" ftype="bigwig" />
194 </test>
195 </tests>
196 <help>
197 <![CDATA[
198
199 **What it does**
200
201 This tool compares two BAM files based on the number of mapped reads. To
202 compare the BAM files, the genome is partitioned into bins of equal size, then
203 the number of reads found in each BAM file is counted per bin and
204 finally a summary value reported. This value can be the ratio of the
205 number of reads per bin, the log2 of the ratio or the difference. This tool
206 can normalize the number of reads in each BAM file using the SES method
207 proposed in Diaz et al. (2012). "Normalization, bias correction, and peak
208 calling for ChIP-seq". Statistical applications in genetics and molecular
209 biology, 11(3). Normalization based on read counts is also available. The
210 output is either a bedgraph or a bigwig file containing the bin location and
211 the resulting comparison values. By default, if reads are mated, the fragment
212 length reported in the BAM file is used. In the case of paired-end mapping,
213 each read mate is treated independently to avoid a bias when a mixture of
214 concordant and discordant pairs are present. This means that *each end* will be
215 extended to match the fragment length.
216
217
218 .. image:: $PATH_TO_IMAGES/norm_IGVsnapshot_indFiles.png
219
220
221 You can find more details on the bamCompare doc page: https://deeptools.readthedocs.org/en/master/content/tools/bamCompare.html
222
223
224 **Output files**:
225
226 - same as for bamCoverage, except that you now obtain 1 coverage file that is based on 2 BAM files.
227
228 -----
229
230 @REFERENCES@
231 ]]>
232 </help>
233 <expand macro="citations" />
234 </tool>