comparison bamCompare.xml @ 26:2ad3b027dfcd draft

Uploaded
author bgruening
date Thu, 06 Feb 2014 06:40:05 -0500
parents
children bf1b1dcdd67b
comparison
equal deleted inserted replaced
25:d2898b81b912 26:2ad3b027dfcd
1 <tool id="deeptools_bamCompare" name="bamCompare" version="1.0.4">
2 <description>normalizes and compares two BAM files to obtain the ratio, log2ratio or difference. (bam2bigwig)</description>
3 <expand macro="requirements" />
4 <expand macro="stdio" />
5 <macros>
6 <token name="@BINARY@">bamCompare</token>
7 <import>deepTools_macros.xml</import>
8 </macros>
9 <command>
10 bamCompare
11
12 @THREADS@
13
14 --bamfile1 '$bamFile1'
15 -bai1 '${bamFile1.metadata.bam_index}'
16 --bamfile2 '$bamFile2'
17 -bai2 '${bamFile2.metadata.bam_index}'
18
19 --outFileName '$outFileName'
20 --outFileFormat '$outFileFormat'
21
22 --fragmentLength $fragmentLength
23 --binSize $binSize
24
25 #if $scaling.method == 'SES':
26 --scaleFactorsMethod SES
27 --sampleLength $scaling.sampleLength
28 #elif $scaling.method == 'readCount':
29 --scaleFactorsMethod readCount
30 #elif $scaling.method == 'own':
31 --scaleFactors '$scaling.scaleFactor1:$scaling.scaleFactor2'
32 #end if
33
34 --ratio $comparison.type
35
36 #if $comparison.type=='subtract':
37 #if $comparison.normalization.type=='rpkm':
38 --normalizeUsingRPKM
39 #elif $comparison.normalization.type=='1x':
40
41 #if $comparison.normalization.effectiveGenomeSize.effectiveGenomeSize_opt == "specific":
42 --normalizeTo1x $comparison.normalization.effectiveGenomeSize.effectiveGenomeSize
43 #else:
44 --normalizeTo1x $comparison.normalization.effectiveGenomeSize.effectiveGenomeSize_opt
45 #end if
46
47 #end if
48 #end if
49
50 #if str($region).strip() != '':
51 --region '$region'
52 #end if
53
54 #if $advancedOpt.showAdvancedOpt == "yes":
55 #if $advancedOpt.smoothLength:
56 --smoothLength '$advancedOpt.smoothLength'
57 #end if
58
59 $advancedOpt.doNotExtendPairedEnds
60 $advancedOpt.ignoreDuplicates
61
62 #if $advancedOpt.minMappingQuality:
63 --minMappingQuality '$advancedOpt.minMappingQuality'
64 #end if
65
66 --missingDataAsZero $advancedOpt.missingDataAsZero
67
68 #if str($advancedOpt.ignoreForNormalization).strip() != '':
69 --ignoreForNormalization $advancedOpt.ignoreForNormalization
70 #end if
71
72 #end if
73
74 </command>
75
76 <inputs>
77 <param name="bamFile1" format="bam" type="data" label="First BAM file (e.g. treated sample)"
78 help="The BAM file must be sorted."/>
79
80 <param name="bamFile2" format="bam" type="data" label="Second BAM file (e.g. control sample)"
81 help="The BAM file must be sorted."/>
82
83 <param name="fragmentLength" type="integer" value="300" min="1"
84 label="Length of the average fragment size"
85 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 &quot;normalize coverage to 1x&quot;). 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."/>
86
87 <param name="binSize" type="integer" value="50" min="1"
88 label="Bin size in bp"
89 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. "/>
90
91 <conditional name="scaling">
92 <param name="method" type="select"
93 label="Method to use for scaling the largest sample to the smallest">
94 <option value="readCount" selected="true">read count</option>
95 <option value="SES">signal extraction scaling (SES), check the bamFingerprint plot before using it!</option>
96 <option value="own">enter own scaling factors</option>
97 </param>
98 <when value="SES">
99 <param name="sampleLength" type="integer" value="1000" min="10"
100 label="Length in base pairs used to sample the genome and compute the size or scaling factors to compare the two BAM files "
101 help="The default is fine. Only change it if you know what you are doing" />
102 </when>
103 <when value="readCount" />
104 <when value="own">
105 <param name="scaleFactor1" type="float" value="1"
106 label="Scale factor for treatment"/>
107
108 <param name="scaleFactor2" type="float" value="1"
109 label="Scale factor for input"/>
110 </when>
111 </conditional>
112
113 <conditional name="comparison">
114 <param name="type" type="select"
115 label="How to compare the two files">
116 <option value="log2" selected="true">compute log2 of the number of reads ratio</option>
117 <option value="ratio">compute the ratio of the number of reads</option>
118 <option value="subtract">compute difference (subtract input from treatment) of the number of reads</option>
119 </param>
120 <when value="log2" />
121 <when value="ratio" />
122 <when value="subtract">
123 <conditional name="normalization">
124 <param name="type" type="select" label="Normalization method" >
125 <option value="1x">Normalize coverage to 1x</option>
126 <option value="rpkm">Normalize to fragments (reads) per kilobase per million (RPKM)</option>
127 <option value="no">Do not normalize or scale</option>
128 </param>
129 <when value="rpkm" />
130 <when value="no" />
131 <when value="1x">
132 <expand macro="effectiveGenomeSize" />
133 </when>
134 </conditional>
135 </when>
136 </conditional>
137
138 <param name="outFileFormat" type="select" label="Coverage file format">
139 <option value="bigwig" selected="true">bigwig</option>
140 <option value="bedgraph">bedgraph</option>
141 </param>
142
143 <expand macro="region_limit_operation" />
144
145 <conditional name="advancedOpt">
146 <param name="showAdvancedOpt" type="select" label="Show advanced options" >
147 <option value="no" selected="true">no</option>
148 <option value="yes">yes</option>
149 </param>
150 <when value="no" />
151 <when value="yes">
152
153 <param name="smoothLength" type="integer" value="1" optional="true" min="1"
154 label="Smooth values using the following length (in bp)"
155 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."/>
156
157 <param name="doNotExtendPairedEnds" type="boolean" truevalue="--doNotExtendPairedEnds" falsevalue=""
158 label="Do not extend paired ends"
159 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."/>
160
161 <param name="ignoreDuplicates" type="boolean" truevalue="--ignoreDuplicates" falsevalue=""
162 label="Ignore duplicates"
163 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." />
164
165 <param name="minMappingQuality" type="integer" optional="true" value="1" min="1"
166 label="Minimum mapping quality (e.g. BOWTIE2 measures)"
167 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."/>
168
169 <param name="missingDataAsZero" type="boolean" truevalue="yes" falsevalue="no" checked="True"
170 label ="Treat missing data as zero"
171 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." />
172
173 <param name="ignoreForNormalization" type="text" value="" size="50"
174 label="regions that should be excluded for calculating the scaling factor"
175 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" />
176
177 </when>
178 </conditional>
179
180 </inputs>
181 <outputs>
182 <data format="bigwig" name="outFileName">
183 <change_format>
184 <when input="outFileFormat" value="bigwig" format="bigwig" />
185 <when input="outFileFormat" value="bedgraph" format="bedgraph" />
186 </change_format>
187 </data>
188 </outputs>
189 <help>
190
191 **What it does**
192
193 This tool compares two BAM files based on the number of mapped reads. To
194 compare the BAM files, the genome is partitioned into bins of equal size,
195 the reads are counted for each bin and each BAM file and finally, a summarizing value is reported.
196 This value can be the ratio of the number of reads per bin, the log2 of the ratio or the difference.
197 This tool can normalize the number of reads on each BAM file using the SES method
198 proposed by Diaz et al. (2012). Stat Appl Genet Mol Biol 11(3). Normalization based on read counts is also available. The
199 output is either a bedGraph or a bigWig file containing the bin location and
200 the resulting comparison values.
201 If paired-end reads are present, the fragment
202 length reported in the BAM file is used by default.
203
204
205 .. image:: $PATH_TO_IMAGES/norm_IGVsnapshot_indFiles.png
206
207
208 You can find more details on the bamCompare wiki page: https://github.com/fidelram/deepTools/wiki/Normalizations#wiki-bamCompare
209
210
211 **Output files**:
212
213 - same as for bamCoverage, except that you now obtain 1 coverage file that is based on 2 BAM files.
214
215 -----
216
217 @REFERENCES@
218
219 </help>
220 </tool>