comparison bamCompare.xml @ 0:d957e25e18a3 draft

Uploaded
author bgruening
date Thu, 14 Nov 2013 16:39:18 -0500
parents
children c53a73b8eef9
comparison
equal deleted inserted replaced
-1:000000000000 0:d957e25e18a3
1 <tool id="deeptools_bamCompare" name="bamCompare" version="1.0">
2 <description>normalizes and compares two BAM files to obtain the ratio, log2ratio or difference. (bam2bigwig)</description>
3 <expand macro="requirements" />
4 <macros>
5 <import>deepTools_macros.xml</import>
6 </macros>
7 <command>
8 bamCompare
9
10 @THREADS@
11
12 --bamfile1 '$bamFile1'
13 -bai1 '${bamFile1.metadata.bam_index}'
14 --bamfile2 '$bamFile2'
15 -bai2 '${bamFile2.metadata.bam_index}'
16
17 --outFileName '$outFileName'
18 --outFileFormat '$outFileFormat'
19
20 --fragmentLength $fragmentLength
21 --binSize $binSize
22
23 #if $scaling.method == 'SES':
24 --scaleFactorsMethod SES
25 --sampleLength $scaling.sampleLength
26 #elif $scaling.method == 'readCount':
27 --scaleFactorsMethod readCount
28 #elif $scaling.method == 'own':
29 --scaleFactors '$scaling.scaleFactor1:$scaling.scaleFactor2'
30 #end if
31
32 --ratio $comparison.type
33
34 #if $comparison.type=='subtract':
35 #if $comparison.normalization.type=='rpkm':
36 --normalizeUsingRPKM
37 #elif $comparison.normalization.type=='1x':
38 --normalizeTo1x $comparison.normalization.normalizeTo1x
39 #end if
40
41 #if str($comparison.ignoreForNormalization).strip() != '':
42 --ignoreForNormalization $comparison.ignoreForNormalization
43 #end if
44
45 #end if
46
47 #if $advancedOpt.showAdvancedOpt == "yes":
48 #if $advancedOpt.smoothLength:
49 --smoothLength '$advancedOpt.smoothLength'
50 #end if
51
52 #if str($advancedOpt.region.value) != '':
53 --region '$advancedOpt.region'
54 #end if
55
56 $advancedOpt.doNotExtendPairedEnds
57 $advancedOpt.ignoreDuplicates
58
59 #if $advancedOpt.minMappingQuality:
60 --minMappingQuality '$advancedOpt.minMappingQuality'
61 #end if
62
63 --missingDataAsZero $advancedOpt.missingDataAsZero
64
65 #end if
66
67 </command>
68
69 <inputs>
70 <param name="bamFile1" format="bam" type="data" label="Treatment BAM file"
71 help="The BAM file must be sorted."/>
72
73 <param name="bamFile2" format="bam" type="data" label="Input BAM file"
74 help="The BAM file must be sorted."/>
75
76 <param name="fragmentLength" type="integer" value="300" min="1"
77 label="Length of the average fragment size"
78 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."/>
79
80 <param name="binSize" type="integer" value="50" min="1"
81 label="Bin size in bp"
82 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. "/>
83
84 <conditional name="scaling">
85 <param name="method" type="select"
86 label="Method to use for scaling the largest sample to the smallest">
87 <option value="readCount" selected="true">read count</option>
88 <option value="SES">signal extraction scaling (SES)</option>
89 <option value="own">enter own scaling factors</option>
90 </param>
91 <when value="SES">
92 <param name="sampleLength" type="integer" value="1000" min="10"
93 label="Length in base pairs used to sample the genome and compute the size or scaling factors to compare the two BAM files "
94 help="The default is fine. Only change it if you know what you are doing" />
95 </when>
96 <when value="readCount" />
97 <when value="own">
98 <param name="scaleFactor1" type="float" value="1"
99 label="Scale factor for treatment"/>
100
101 <param name="scaleFactor2" type="float" value="1"
102 label="Scale factor for input"/>
103 </when>
104 </conditional>
105
106 <conditional name="comparison">
107 <param name="type" type="select"
108 label="How to compare the two files">
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 </param>
113 <when value="log2" />
114 <when value="ratio" />
115 <when value="subtract">
116 <conditional name="normalization">
117 <param name="type" type="select" label="Normalization method" >
118 <option value="1x">Normalize coverage to 1x</option>
119 <option value="rpkm">Normalize to fragments (reads) per kilobase per million (RPKM)</option>
120 <option value="no">Do not normalize or scale</option>
121 </param>
122 <when value="rpkm" />
123 <when value="no" />
124 <when value="1x">
125 <param name="normalizeTo1x" type="integer" value="2150570000"
126 label="Report normalized coverage to 1x sequenceing depth"
127 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."/>
128 </when>
129 </conditional>
130 <param name="ignoreForNormalization" type="text" value="" size="50"
131 label="regions that should be excluded for calculating the scaling factor"
132 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" />
133 </when>
134 </conditional>
135
136 <param name="outFileFormat" type="select" label="Coverage file format">
137 <option value="bigwig" selected="true">bigwig</option>
138 <option value="bedgraph">bedgraph</option>
139 </param>
140
141 <conditional name="advancedOpt">
142 <param name="showAdvancedOpt" type="select" label="Show advanced options" >
143 <option value="no" selected="true">no</option>
144 <option value="yes">yes</option>
145 </param>
146 <when value="no" />
147 <when value="yes">
148
149 <param name="smoothLength" type="integer" value="1" optional="true" min="1"
150 label="Smooth values using the following length (in bp)"
151 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."/>
152
153 <param name="region" type="text" value=""
154 label="Region of the genome to limit the operation to"
155 help="This is useful when testing parameters to reduce the computing time. The format is chr:start:end, for example &quot;chr10&quot; or &quot;chr10:456700:891000&quot;" />
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 </when>
173 </conditional>
174
175 </inputs>
176 <outputs>
177 <data format="bigwig" name="outFileName">
178 <change_format>
179 <when input="outFileFormat" value="bigwig" format="bigwig" />
180 <when input="outFileFormat" value="bedgraph" format="bedgraph" />
181 </change_format>
182 </data>
183 </outputs>
184 <help>
185
186 **What it does**
187
188 This tool compares two BAM files based on the number of mapped reads. To
189 compare the BAM files, the genome is partitioned into bins of equal size,
190 the reads are counted for each bin and each BAM file and finally, a summarizing value is reported.
191 This value can be the ratio of the number of reads per bin, the log2 of the ratio or the difference.
192 This tool can normalize the number of reads on each BAM file using the SES method
193 proposed by Diaz et al. (2012). Stat Appl Genet Mol Biol 11(3). Normalization based on read counts is also available. The
194 output is either a bedGraph or a bigWig file containing the bin location and
195 the resulting comparison values.
196 If paired-end reads are present, the fragment
197 length reported in the BAM file is used by default.
198
199
200 .. image:: $PATH_TO_IMAGES/norm_IGVsnapshot_indFiles.png
201
202
203 **Output files**:
204
205 - same as for bamCoverage, except that you now obtain 1 coverage file that is based on 2 BAM files.
206
207 -----
208
209 .. class:: infomark
210
211 </help>
212 </tool>