0
|
1 <tool id="bamCompare" name="bamCompare" version="1.0">
|
|
2 <description>Normalize and compare two BAM files to output ratio, log2ratio or difference.</description>
|
|
3 <requirements>
|
|
4 <requirement type="package" version="1.5.1_98e5d8a61431ea8605c0643d991a1a5d8999b4dc">deepTools</requirement>
|
|
5 <requirement type="package" version="1.7.1">numpy</requirement>
|
|
6 <requirement type="package" version="0.1">ucsc_tools</requirement>
|
|
7 </requirements>
|
|
8 <command>
|
|
9 bamCompare
|
|
10 --bamfile1 '$bamFile1'
|
|
11 -bai1 '${bamFile1.metadata.bam_index}'
|
|
12 --bamfile2 '$bamFile2'
|
|
13 -bai2 '${bamFile2.metadata.bam_index}'
|
|
14
|
|
15 --outFileName '$outFileName'
|
|
16 --outFileFormat '$outFileFormat'
|
|
17
|
|
18 --fragmentLength $fragmentLength
|
|
19 --binSize $binSize
|
|
20
|
|
21 #if $scaling.method == 'SES':
|
|
22 --scaleFactorsMethod SES
|
|
23 --sampleLength $scaling.sampleLength
|
|
24 #elif $scaling.method == 'readCount':
|
|
25 --scaleFactorsMethod readCount
|
|
26 #elif $scaling.method == 'own':
|
|
27 --scaleFactors '$scaling.scaleFactor1:$scaling.scaleFactor2'
|
|
28 #end if
|
|
29
|
|
30 --ratio $comparison.type
|
|
31
|
|
32
|
|
33 #if $comparison.type=='subtract':
|
|
34 #if $comparison.normalization.type=='rpkm':
|
|
35 --normalizeUsingRPKM
|
|
36 #elif $comparison.normalization.type=='1x':
|
|
37 --normalizeTo1x $comparison.normalization.normalizeTo1x
|
|
38 #end if
|
|
39 #end if
|
|
40
|
|
41 #if $advancedOpt.showAdvancedOpt == "yes":
|
|
42 #if $advancedOpt.smoothLength:
|
|
43 --smoothLength '$advancedOpt.smoothLength'
|
|
44 #end if
|
|
45
|
|
46 #if str($advancedOpt.region.value) != '':
|
|
47 --region '$advancedOpt.region'
|
|
48 #end if
|
|
49 $advancedOpt.doNotExtendPairedEnds
|
|
50 $advancedOpt.ignoreDuplicates
|
|
51
|
|
52 #if $advancedOpt.minMappingQuality:
|
|
53 --minMappingQuality '$advancedOpt.minMappingQuality'
|
|
54 #end if
|
|
55
|
|
56 --missingDataAsZero $advancedOpt.missingDataAsZero
|
|
57
|
|
58 #end if
|
|
59 --numberOfProcessors 4
|
|
60
|
|
61
|
|
62 </command>
|
|
63
|
|
64 <inputs>
|
|
65 <param name="bamFile1" format="bam" type="data" label="Treatment BAM file"
|
|
66 help="The BAM file must be sorted and indexed."/>
|
|
67
|
|
68 <param name="bamFile2" format="bam" type="data" label="Input BAM file"
|
|
69 help="The BAM file must be sorted and indexed."/>
|
|
70
|
|
71 <param name="fragmentLength" type="integer" value="300" min="1"
|
|
72 label="Length of the average fragment size"
|
|
73 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."/>
|
|
74
|
|
75 <param name="binSize" type="integer" value="50" min="1"
|
|
76 label="Bin size in bp"
|
|
77 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. "/>
|
|
78
|
|
79
|
|
80 <conditional name="scaling">
|
|
81 <param name="method" type="select"
|
|
82 label="Method to use for scaling the largest sample to the smallest">
|
|
83 <option value="readCount" selected="true">read count</option>
|
|
84 <option value="SES">signal extraction scaling (SES)</option>
|
|
85 <option value="own">enter own scaling factors</option>
|
|
86 </param>
|
|
87 <when value="SES">
|
|
88 <param name="sampleLength" type="integer" value="1000" min="10"
|
|
89 label="Length in base pairs used to sample the genome and compute the size or scaling factors to compare the two BAM files "
|
|
90 help="The default is fine. Only change it if you know what you are doing" />
|
|
91 </when>
|
|
92 <when value="readCount" />
|
|
93 <when value="own">
|
|
94 <param name="scaleFactor1" type="float" value="1"
|
|
95 label="Scale factor for treatment"/>
|
|
96
|
|
97 <param name="scaleFactor2" type="float" value="1"
|
|
98 label="Scale factor for input"/>
|
|
99 </when>
|
|
100 </conditional>
|
|
101
|
|
102 <conditional name="comparison">
|
|
103 <param name="type" type="select"
|
|
104 label="How to compare the two files">
|
|
105 <option value="log2" selected="true">compute log2 of the number of reads ratio</option>
|
|
106 <option value="ratio">compute the ratio of the number of reads</option>
|
|
107 <option value="subtract">compute difference (subtract input from treatment) of the number of reads</option>
|
|
108 </param>
|
|
109 <when value="log2" />
|
|
110 <when value="ratio" />
|
|
111 <when value="subtract">
|
|
112 <conditional name="normalization">
|
|
113 <param name="type" type="select" label="Normalization method" >
|
|
114 <option value="1x">Normalize coverage to 1x</option>
|
|
115 <option value="rpkm">Normalize to fragments (reads) per kilobase per million (RPKM)</option>
|
|
116 <option value="no">Do not normalize or scale</option>
|
|
117 </param>
|
|
118 <when value="rpkm" />
|
|
119 <when value="no" />
|
|
120 <when value="1x">
|
|
121 <param name="normalizeTo1x" type="integer" value="2150570000"
|
|
122 label="Report normalized coverage to 1x sequenceing depth"
|
|
123 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."/>
|
|
124 </when>
|
|
125 </conditional>
|
|
126 </when>
|
|
127 </conditional>
|
|
128
|
|
129 <param name="outFileFormat" type="select" label="Coverage file format">
|
|
130 <option value="bigwig" selected="true">bigwig</option>
|
|
131 <option value="bedgraph">bedgraph</option>
|
|
132 </param>
|
|
133
|
|
134 <conditional name="advancedOpt">
|
|
135 <param name="showAdvancedOpt" type="select" label="Show advanced options" >
|
|
136 <option value="no" selected="true">no</option>
|
|
137 <option value="yes">yes</option>
|
|
138 </param>
|
|
139 <when value="no" />
|
|
140 <when value="yes">
|
|
141
|
|
142 <param name="smoothLength" type="integer" value="1" optional="true" min="1"
|
|
143 label="Smooth values using the following length (in bp)"
|
|
144 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."/>
|
|
145
|
|
146 <param name="region" type="text" value=""
|
|
147 label="Region of the genome to limit the operation to"
|
|
148 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"" />
|
|
149
|
|
150 <param name="doNotExtendPairedEnds" type="boolean" truevalue="--doNotExtendPairedEnds" falsevalue=""
|
|
151 label="Do not extend paired ends"
|
|
152 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."/>
|
|
153
|
|
154 <param name="ignoreDuplicates" type="boolean" truevalue="--ignoreDuplicates" falsevalue=""
|
|
155 label="Ignore duplicates"
|
|
156 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." />
|
|
157
|
|
158 <param name="minMappingQuality" type="integer" optional="true" value="1" min="1"
|
|
159 label="Minimum mapping quality"
|
|
160 help= "If set, only reads that have a mapping quality score higher than the given value are considered"/>
|
|
161
|
|
162 <param name="missingDataAsZero" type="boolean" truevalue="yes" falsevalue="no" checked="True"
|
|
163 label ="Treat missing data as zero"
|
|
164 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." />
|
|
165
|
|
166 </when>
|
|
167 </conditional>
|
|
168
|
|
169 </inputs>
|
|
170 <outputs>
|
|
171 <data format="bigwig" name="outFileName">
|
|
172 <change_format>
|
|
173 <when input="outFileFormat" value="bigwig" format="bigwig" />
|
|
174 <when input="outFileFormat" value="bedgraph" format="bedgraph" />
|
|
175 </change_format>
|
|
176 </data>
|
|
177 </outputs>
|
|
178 <help>
|
|
179
|
|
180 **What it does**
|
|
181
|
|
182 This tool compares two BAM files based on the number of mapped reads. To
|
|
183 compare the BAM files the genome is partitioned into bins of equal size, then
|
|
184 the number of reads found in each BAM file are counted for such bins and
|
|
185 finally a summarizing value is reported. This vaule can be the ratio of the
|
|
186 number of reads per bin, the log2 of the ratio or the difference. This tool
|
|
187 can normalize the number of reads on each BAM file using the SES method
|
|
188 proposed by Diaz et al. (2012). "Normalization, bias correction, and peak
|
|
189 calling for ChIP-seq". Statistical applications in genetics and molecular
|
|
190 biology, 11(3). Normalization based on read counts is also available. The
|
|
191 output is either a bedgraph or a bigwig file containing the bin location and
|
|
192 the resulting comparison values. By default if reads are mated the fragment
|
|
193 length reported in the BAM file is used.
|
|
194
|
|
195 -----
|
|
196
|
|
197 .. class:: infomark
|
|
198
|
|
199 Please acknowledge that this tool **is still in development** and we will be very happy to receive feedback from the users. If you run into any trouble please sent an email to `Fidel Ramirez`_.
|
|
200
|
|
201 This tool is developed by the `Bioinformatics and Deep-Sequencing Unit`_ at the `Max Planck Institute for Immunobiology and Epigenetics`_.
|
|
202
|
|
203
|
|
204 .. _Bioinformatics and Deep-Sequencing Unit: http://www3.ie-freiburg.mpg.de/facilities/research-facilities/bioinformatics-and-deep-sequencing-unit/
|
|
205 .. _Max Planck Institute for Immunobiology and Epigenetics: http://www3.ie-freiburg.mpg.de
|
|
206 .. _Fidel Ramirez: ramirez@ie-freiburg.mpg.de
|
|
207
|
|
208 </help>
|
|
209
|
|
210 </tool>
|