comparison bamCoverage.xml @ 0:b2886915ce68 draft default tip

Uploaded
author bgruening
date Tue, 10 Feb 2015 03:21:34 -0500
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:b2886915ce68
1 <tool id="deeptools_bamCoverage" name="bamCoverage" version="@WRAPPER_VERSION@.0">
2 <description> generates a coverage bigWig file from a given BAM file. Multiple options are available to count reads and normalize coverage. (bam2bigwig)</description>
3 <expand macro="requirements" />
4 <expand macro="stdio" />
5 <macros>
6 <token name="@BINARY@">bamCoverage</token>
7 <import>deepTools_macros.xml</import>
8 </macros>
9 <command>
10 <![CDATA[
11 bamCoverage
12
13 @THREADS@
14
15 --bam '$bamInput'
16 --bamIndex ${bamInput.metadata.bam_index}
17 --outFileName '$outFileName'
18 --outFileFormat '$outFileFormat'
19
20 --fragmentLength $fragmentLength
21 --binSize $binSize
22
23 #if $scaling.type=='rpkm':
24 --normalizeUsingRPKM
25 #elif $scaling.type=='1x':
26 #if $scaling.effectiveGenomeSize.effectiveGenomeSize_opt == "specific":
27 --normalizeTo1x $scaling.effectiveGenomeSize.effectiveGenomeSize
28 #else:
29 --normalizeTo1x $scaling.effectiveGenomeSize.effectiveGenomeSize_opt
30 #end if
31 #elif $scaling.type=='own':
32 --scaleFactor $scaling.scaleFactor
33 #end if
34
35 #if str($region).strip() != '':
36 --region '$region'
37 #end if
38
39 #if $advancedOpt.showAdvancedOpt == "yes":
40 #if $advancedOpt.smoothLength:
41 --smoothLength '$advancedOpt.smoothLength'
42 #end if
43
44 $advancedOpt.doNotExtendPairedEnds
45 $advancedOpt.ignoreDuplicates
46
47 #if $advancedOpt.minMappingQuality:
48 --minMappingQuality '$advancedOpt.minMappingQuality'
49 #end if
50
51 --missingDataAsZero $advancedOpt.missingDataAsZero
52
53 ##if str($advancedOpt.ignoreForNormalization).strip() != '':
54 ## --ignoreForNormalization $advancedOpt.ignoreForNormalization
55 ##end if
56
57 #end if
58 ]]>
59 </command>
60
61 <inputs>
62 <param name="bamInput" format="bam" type="data" label="BAM file"
63 help="The BAM file must be sorted."/>
64
65 <param name="fragmentLength" type="integer" value="200" min="1"
66 label="Length of the average fragment size"
67 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;). Sequencing depth is defined as: (total number of mapped reads * fragment length) / effective genome size. *NOTE*: If the BAM files contain mated and unmated paired-end reads, unmated reads will be extended to match the fragment length. (--fragmentLength)"/>
68
69 <param name="binSize" type="integer" value="50" min="1"
70 label="Bin size in bp"
71 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. "/>
72
73 <conditional name="scaling">
74 <param name="type" type="select" label="Scaling/Normalization method" >
75 <option value="1x">Normalize coverage to 1x</option>
76 <option value="rpkm">Normalize to fragments (reads) per kilobase per million (RPKM)</option>
77 <option value="own">Set your own scaling factor</option>
78 <option value="no">Do not normalize or scale</option>
79 </param>
80 <when value="rpkm"/>
81 <when value="no"/>
82 <when value="1x">
83 <expand macro="effectiveGenomeSize" />
84 </when>
85 <when value="own">
86 <param name="scaleFactor" type="float" value="1" size="3"
87 label="Scale factor to multiply all values" />
88 </when>
89 </conditional>
90
91 <param name="outFileFormat" type="select" label="Coverage file format">
92 <option value="bigwig" selected="true">bigwig</option>
93 <option value="bedgraph">bedgraph</option>
94 </param>
95
96 <expand macro="region_limit_operation" />
97
98 <conditional name="advancedOpt">
99 <param name="showAdvancedOpt" type="select" label="Show advanced options" >
100 <option value="no" selected="true">no</option>
101 <option value="yes">yes</option>
102 </param>
103 <when value="no" />
104 <when value="yes">
105 <param name="smoothLength" type="integer" value="1" optional="true" min="1"
106 label="Smooth values using the following length (in bp)"
107 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. (--smoothLength)"/>
108
109 <expand macro="doNotExtendPairedEnds" />
110 <expand macro="ignoreDuplicates" />
111 <expand macro="minMappingQuality" />
112
113 <expand macro="missingDataAsZero" />
114
115 <!-- <param name="ignoreForNormalization" type="text" value="" size="50"
116 label="regions that should be excluded for calculating the scaling factor"
117 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" />
118 -->
119 </when>
120 </conditional>
121 </inputs>
122 <outputs>
123 <data format="bigwig" name="outFileName">
124 <change_format>
125 <when input="outFileFormat" value="bigwig" format="bigwig" />
126 <when input="outFileFormat" value="bedgraph" format="bedgraph" />
127 </change_format>
128 </data>
129 </outputs>
130 <tests>
131 <test>
132 <param name="bamInput" value="bowtie2-test1.bam" ftype="bam" />
133 <param name="outFileFormat" value="bigwig" />
134 <param name="showAdvancedOpt" value="no" />
135 <param name="binSize" value="10" />
136 <param name="type" value="no" />
137 <output name="outFileName" file="bamCoverage_result1.bw" ftype="bigwig" />
138 </test>
139 <test>
140 <param name="bamInput" value="bowtie2-test1.bam" ftype="bam" />
141 <param name="outFileFormat" value="bigwig" />
142 <param name="showAdvancedOpt" value="no" />
143 <param name="binSize" value="10" />
144 <output name="outFileName" file="bamCoverage_result2.bw" ftype="bigwig" />
145 </test>
146 <test>
147 <param name="bamInput" value="bowtie2-test1.bam" ftype="bam" />
148 <param name="outFileFormat" value="bedgraph" />
149 <param name="showAdvancedOpt" value="no" />
150 <param name="binSize" value="10" />
151 <output name="outFileName" file="bamCoverage_result3.bg" ftype="bedgraph" />
152 </test>
153 <test>
154 <param name="bamInput" value="phiX.bam" ftype="bam" />
155 <param name="outFileFormat" value="bigwig" />
156 <param name="showAdvancedOpt" value="no" />
157 <param name="binSize" value="10" />
158 <output name="outFileName" file="bamCoverage_result4.bw" ftype="bigwig" />
159 </test>
160 <test>
161 <param name="bamInput" value="phiX.bam" ftype="bam" />
162 <param name="outFileFormat" value="bedgraph" />
163 <param name="showAdvancedOpt" value="no" />
164 <param name="binSize" value="10" />
165 <output name="outFileName" file="bamCoverage_result4.bg" ftype="bedgraph" />
166 </test>
167 </tests>
168 <help>
169 <![CDATA[
170 **What it does**
171
172 Given a BAM file, this tool generates a bigWig or bedGraph file of fragment or
173 read coverages. The way the method works is by first calculating all the
174 number of reads (either extended to match the fragment length or not) that
175 overlap each bin in the genome. The resulting read counts can be normalized
176 using either a given scaling factor, the RPKM formula or to get a 1x depth of
177 coverage (RPGC). In the case of paired-end mapping each read mate is treated
178 independently to avoid a bias when a mixture of concordant and discordant
179 pairs is present. This means that *each end* will be extended to match the
180 fragment length.
181
182 .. image:: $PATH_TO_IMAGES/norm_IGVsnapshot_indFiles.png
183
184
185 You can find more details on the bamCoverage wiki page: https://github.com/fidelram/deepTools/wiki/Normalizations#wiki-bamCoverage
186
187
188 **Output files**:
189
190 - coverage file either in bigWig or bedGraph format
191
192 -----
193
194 @REFERENCES@
195 ]]>
196 </help>
197 <expand macro="citations" />
198 </tool>