10
|
1 <tool id="deeptools_bamCompare" name="bamCompare" version="1.0.2">
|
0
|
2 <description>normalizes and compares two BAM files to obtain the ratio, log2ratio or difference. (bam2bigwig)</description>
|
|
3 <expand macro="requirements" />
|
10
|
4 <expand macro="stdio" />
|
0
|
5 <macros>
|
|
6 <import>deepTools_macros.xml</import>
|
|
7 </macros>
|
|
8 <command>
|
|
9 bamCompare
|
|
10
|
|
11 @THREADS@
|
|
12
|
|
13 --bamfile1 '$bamFile1'
|
|
14 -bai1 '${bamFile1.metadata.bam_index}'
|
|
15 --bamfile2 '$bamFile2'
|
|
16 -bai2 '${bamFile2.metadata.bam_index}'
|
|
17
|
|
18 --outFileName '$outFileName'
|
|
19 --outFileFormat '$outFileFormat'
|
|
20
|
|
21 --fragmentLength $fragmentLength
|
|
22 --binSize $binSize
|
|
23
|
|
24 #if $scaling.method == 'SES':
|
|
25 --scaleFactorsMethod SES
|
|
26 --sampleLength $scaling.sampleLength
|
|
27 #elif $scaling.method == 'readCount':
|
|
28 --scaleFactorsMethod readCount
|
|
29 #elif $scaling.method == 'own':
|
|
30 --scaleFactors '$scaling.scaleFactor1:$scaling.scaleFactor2'
|
|
31 #end if
|
|
32
|
|
33 --ratio $comparison.type
|
|
34
|
|
35 #if $comparison.type=='subtract':
|
|
36 #if $comparison.normalization.type=='rpkm':
|
|
37 --normalizeUsingRPKM
|
|
38 #elif $comparison.normalization.type=='1x':
|
|
39 --normalizeTo1x $comparison.normalization.normalizeTo1x
|
|
40 #end if
|
|
41
|
|
42 #if str($comparison.ignoreForNormalization).strip() != '':
|
|
43 --ignoreForNormalization $comparison.ignoreForNormalization
|
|
44 #end if
|
|
45
|
|
46 #end if
|
|
47
|
|
48 #if $advancedOpt.showAdvancedOpt == "yes":
|
|
49 #if $advancedOpt.smoothLength:
|
|
50 --smoothLength '$advancedOpt.smoothLength'
|
|
51 #end if
|
|
52
|
|
53 #if str($advancedOpt.region.value) != '':
|
|
54 --region '$advancedOpt.region'
|
|
55 #end if
|
|
56
|
|
57 $advancedOpt.doNotExtendPairedEnds
|
|
58 $advancedOpt.ignoreDuplicates
|
|
59
|
|
60 #if $advancedOpt.minMappingQuality:
|
|
61 --minMappingQuality '$advancedOpt.minMappingQuality'
|
|
62 #end if
|
|
63
|
|
64 --missingDataAsZero $advancedOpt.missingDataAsZero
|
|
65
|
|
66 #end if
|
|
67
|
|
68 </command>
|
|
69
|
|
70 <inputs>
|
|
71 <param name="bamFile1" format="bam" type="data" label="Treatment BAM file"
|
|
72 help="The BAM file must be sorted."/>
|
|
73
|
9
|
74 <param name="bamFile2" format="bam" type="data" label="BAM file"
|
0
|
75 help="The BAM file must be sorted."/>
|
|
76
|
|
77 <param name="fragmentLength" type="integer" value="300" min="1"
|
|
78 label="Length of the average fragment size"
|
|
79 help ="Reads will be extended to match this length unless they are paired-end, in which case they will be extended to match the fragment length. If this value is set to the read length or smaller, the read will not be extended. *Warning* the fragment length affects the normalization to 1x (see "normalize coverage to 1x"). The formula to normalize using the sequencing depth is genomeSize/(number of mapped reads * fragment length). *NOTE*: If the BAM files contain mated and unmated paired-end reads, unmated reads will be extended to match the fragment length."/>
|
|
80
|
|
81 <param name="binSize" type="integer" value="50" min="1"
|
|
82 label="Bin size in bp"
|
|
83 help="The genome will be divided in bins (also called tiles) of the specified length. For each bin the overlaping number of fragments (or reads) will be reported. If only half a fragment overlaps, this fraction will be reported. "/>
|
|
84
|
|
85 <conditional name="scaling">
|
|
86 <param name="method" type="select"
|
|
87 label="Method to use for scaling the largest sample to the smallest">
|
|
88 <option value="readCount" selected="true">read count</option>
|
|
89 <option value="SES">signal extraction scaling (SES)</option>
|
|
90 <option value="own">enter own scaling factors</option>
|
|
91 </param>
|
|
92 <when value="SES">
|
|
93 <param name="sampleLength" type="integer" value="1000" min="10"
|
|
94 label="Length in base pairs used to sample the genome and compute the size or scaling factors to compare the two BAM files "
|
|
95 help="The default is fine. Only change it if you know what you are doing" />
|
|
96 </when>
|
|
97 <when value="readCount" />
|
|
98 <when value="own">
|
|
99 <param name="scaleFactor1" type="float" value="1"
|
|
100 label="Scale factor for treatment"/>
|
|
101
|
|
102 <param name="scaleFactor2" type="float" value="1"
|
|
103 label="Scale factor for input"/>
|
|
104 </when>
|
|
105 </conditional>
|
|
106
|
|
107 <conditional name="comparison">
|
|
108 <param name="type" type="select"
|
|
109 label="How to compare the two files">
|
|
110 <option value="log2" selected="true">compute log2 of the number of reads ratio</option>
|
|
111 <option value="ratio">compute the ratio of the number of reads</option>
|
|
112 <option value="subtract">compute difference (subtract input from treatment) of the number of reads</option>
|
|
113 </param>
|
|
114 <when value="log2" />
|
|
115 <when value="ratio" />
|
|
116 <when value="subtract">
|
|
117 <conditional name="normalization">
|
|
118 <param name="type" type="select" label="Normalization method" >
|
|
119 <option value="1x">Normalize coverage to 1x</option>
|
|
120 <option value="rpkm">Normalize to fragments (reads) per kilobase per million (RPKM)</option>
|
|
121 <option value="no">Do not normalize or scale</option>
|
|
122 </param>
|
|
123 <when value="rpkm" />
|
|
124 <when value="no" />
|
|
125 <when value="1x">
|
|
126 <param name="normalizeTo1x" type="integer" value="2150570000"
|
|
127 label="Report normalized coverage to 1x sequenceing depth"
|
|
128 help ="Sequencing depth is defined as the total number of mapped reads * fragment length / effective genome size. To use this option, the effective genome size has to be given. Common values are: mm9: 2150570000, hg19:2451960000, dm3:121400000 and ce10:93260000."/>
|
|
129 </when>
|
|
130 </conditional>
|
|
131 <param name="ignoreForNormalization" type="text" value="" size="50"
|
|
132 label="regions that should be excluded for calculating the scaling factor"
|
|
133 help="Sometimes it makes sense to exclude certain regions when calculating the scaling factor. For example, if you know some regions that you suspect to be present more often in your sample's genome than in the reference genome that will therefore accumulate reads (CNV). Another typical example is the single X chromosome in male samples that should be scaled separately from the diploid autosomes. For example chrX,chrY,chr3. or chr10:12220-128932" />
|
|
134 </when>
|
|
135 </conditional>
|
|
136
|
|
137 <param name="outFileFormat" type="select" label="Coverage file format">
|
|
138 <option value="bigwig" selected="true">bigwig</option>
|
|
139 <option value="bedgraph">bedgraph</option>
|
|
140 </param>
|
|
141
|
|
142 <conditional name="advancedOpt">
|
|
143 <param name="showAdvancedOpt" type="select" label="Show advanced options" >
|
|
144 <option value="no" selected="true">no</option>
|
|
145 <option value="yes">yes</option>
|
|
146 </param>
|
|
147 <when value="no" />
|
|
148 <when value="yes">
|
|
149
|
|
150 <param name="smoothLength" type="integer" value="1" optional="true" min="1"
|
|
151 label="Smooth values using the following length (in bp)"
|
|
152 help ="The smooth length defines a window, larger than the bin size, to average the number of reads. For example, if the bin size is set to 20 bp and the smooth length is set to 60 bp, then, for each bin size the average of it and its left and right neighbors is considered. Any value smaller than the bin size will be ignored and no smoothing will be applied."/>
|
|
153
|
|
154 <param name="region" type="text" value=""
|
|
155 label="Region of the genome to limit the operation to"
|
|
156 help="This is useful when testing parameters to reduce the computing time. The format is chr:start:end, for example "chr10" or "chr10:456700:891000"" />
|
|
157
|
|
158 <param name="doNotExtendPairedEnds" type="boolean" truevalue="--doNotExtendPairedEnds" falsevalue=""
|
|
159 label="Do not extend paired ends"
|
|
160 help="If set, reads are not extended to match the fragment length reported in the BAM file, instead they will be extended to match the fragment length. Default is to extend the reads if paired end information is available."/>
|
|
161
|
|
162 <param name="ignoreDuplicates" type="boolean" truevalue="--ignoreDuplicates" falsevalue=""
|
|
163 label="Ignore duplicates"
|
|
164 help="If set, reads that have the same orientation and start position will be considered only once. If reads are paired, the mate position also has to coincide to ignore a read." />
|
|
165
|
|
166 <param name="minMappingQuality" type="integer" optional="true" value="1" min="1"
|
|
167 label="Minimum mapping quality (e.g. BOWTIE2 measures)"
|
|
168 help= "If set, only reads that have a mapping quality score higher than the given value are considered. *Note* Bowtie's Mapping quality is related to uniqueness: the higher the score, the more unique is a read. A mapping quality defined by Bowtie of 10 or less indicates that there is at least a 1 in 10 chance that the read truly originated elsewhere."/>
|
|
169
|
|
170 <param name="missingDataAsZero" type="boolean" truevalue="yes" falsevalue="no" checked="True"
|
|
171 label ="Treat missing data as zero"
|
|
172 help ="This parameter determines if missing data should be treated as zeros. If unchecked, missing data will be ignored and not included in the output file. Missing data is defined as those regions for which both BAM files have 0 reads." />
|
|
173 </when>
|
|
174 </conditional>
|
|
175
|
|
176 </inputs>
|
|
177 <outputs>
|
|
178 <data format="bigwig" name="outFileName">
|
|
179 <change_format>
|
|
180 <when input="outFileFormat" value="bigwig" format="bigwig" />
|
|
181 <when input="outFileFormat" value="bedgraph" format="bedgraph" />
|
|
182 </change_format>
|
|
183 </data>
|
|
184 </outputs>
|
|
185 <help>
|
|
186
|
|
187 **What it does**
|
|
188
|
|
189 This tool compares two BAM files based on the number of mapped reads. To
|
|
190 compare the BAM files, the genome is partitioned into bins of equal size,
|
|
191 the reads are counted for each bin and each BAM file and finally, a summarizing value is reported.
|
|
192 This value can be the ratio of the number of reads per bin, the log2 of the ratio or the difference.
|
|
193 This tool can normalize the number of reads on each BAM file using the SES method
|
|
194 proposed by Diaz et al. (2012). Stat Appl Genet Mol Biol 11(3). Normalization based on read counts is also available. The
|
|
195 output is either a bedGraph or a bigWig file containing the bin location and
|
|
196 the resulting comparison values.
|
|
197 If paired-end reads are present, the fragment
|
|
198 length reported in the BAM file is used by default.
|
|
199
|
|
200
|
|
201 .. image:: $PATH_TO_IMAGES/norm_IGVsnapshot_indFiles.png
|
|
202
|
|
203
|
|
204 **Output files**:
|
|
205
|
|
206 - same as for bamCoverage, except that you now obtain 1 coverage file that is based on 2 BAM files.
|
|
207
|
|
208 -----
|
|
209
|
|
210 .. class:: infomark
|
|
211
|
|
212 </help>
|
|
213 </tool>
|