annotate bamCoverage.xml @ 19:01bc5ce13498 draft

Uploaded
author bgruening
date Mon, 03 Feb 2014 13:56:24 -0500
parents 5ea8782d650c
children 69ff16ba27bd
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
18
5ea8782d650c Uploaded
bgruening
parents: 17
diff changeset
1 <tool id="deeptools_bamCoverage" name="bamCoverage" version="1.0.3">
0
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
2 <description> generates a coverage bigWig file from a given BAM file. Multiple options are available to count reads and normalize coverage. (bam2bigwig)</description>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
3 <expand macro="requirements" />
10
135f3bae5c56 Uploaded
bgruening
parents: 9
diff changeset
4 <expand macro="stdio" />
0
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
5 <macros>
18
5ea8782d650c Uploaded
bgruening
parents: 17
diff changeset
6 <token name="@BINARY@">bamCoverage</token>
0
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
7 <import>deepTools_macros.xml</import>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
8 </macros>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
9 <command>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
10 bamCoverage
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
11
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
12 @THREADS@
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
13
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
14 --bam '$bamInput'
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
15 --bamIndex ${bamInput.metadata.bam_index}
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
16 --outFileName '$outFileName'
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
17 --outFileFormat '$outFileFormat'
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
18
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
19 --fragmentLength $fragmentLength
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
20 --binSize $binSize
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
21
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
22 #if $scaling.type=='rpkm':
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
23 --normalizeUsingRPKM
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
24 #elif $scaling.type=='1x':
18
5ea8782d650c Uploaded
bgruening
parents: 17
diff changeset
25 #if $scaling.effectiveGenomeSize.effectiveGenomeSize_opt == "specific":
5ea8782d650c Uploaded
bgruening
parents: 17
diff changeset
26 --normalizeTo1x $scaling.effectiveGenomeSize.effectiveGenomeSize
5ea8782d650c Uploaded
bgruening
parents: 17
diff changeset
27 #else:
5ea8782d650c Uploaded
bgruening
parents: 17
diff changeset
28 --normalizeTo1x $scaling.effectiveGenomeSize.effectiveGenomeSize_opt
5ea8782d650c Uploaded
bgruening
parents: 17
diff changeset
29 #end if
0
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
30 #elif $scaling.type=='own':
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
31 --scaleFactor $scaling.scaleFactor
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
32 #end if
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
33
18
5ea8782d650c Uploaded
bgruening
parents: 17
diff changeset
34 #if str(region).strip() != '':
5ea8782d650c Uploaded
bgruening
parents: 17
diff changeset
35 --region 'region'
5ea8782d650c Uploaded
bgruening
parents: 17
diff changeset
36 #end if
5ea8782d650c Uploaded
bgruening
parents: 17
diff changeset
37
0
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
38 #if $advancedOpt.showAdvancedOpt == "yes":
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
39 #if $advancedOpt.smoothLength:
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
40 --smoothLength '$advancedOpt.smoothLength'
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
41 #end if
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
42
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
43 $advancedOpt.doNotExtendPairedEnds
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
44 $advancedOpt.ignoreDuplicates
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
45
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
46 #if $advancedOpt.minMappingQuality:
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
47 --minMappingQuality '$advancedOpt.minMappingQuality'
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
48 #end if
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
49
17
ef65d6b68ccc Uploaded
bgruening
parents: 10
diff changeset
50 ##if str($advancedOpt.ignoreForNormalization).strip() != '':
ef65d6b68ccc Uploaded
bgruening
parents: 10
diff changeset
51 ## --ignoreForNormalization $advancedOpt.ignoreForNormalization
ef65d6b68ccc Uploaded
bgruening
parents: 10
diff changeset
52 ##end if
ef65d6b68ccc Uploaded
bgruening
parents: 10
diff changeset
53
0
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
54 #end if
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
55 </command>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
56
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
57 <inputs>
9
c53a73b8eef9 Uploaded
bgruening
parents: 0
diff changeset
58 <param name="bamInput" format="bam" type="data" label="BAM file"
0
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
59 help="The BAM file must be sorted."/>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
60
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
61 <param name="fragmentLength" type="integer" value="300" min="1"
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
62 label="Length of the average fragment size"
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
63 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."/>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
64
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
65 <param name="binSize" type="integer" value="50" min="1"
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
66 label="Bin size in bp"
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
67 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. "/>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
68
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
69 <conditional name="scaling">
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
70 <param name="type" type="select" label="Scaling/Normalization method" >
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
71 <option value="1x">Normalize coverage to 1x</option>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
72 <option value="rpkm">Normalize to fragments (reads) per kilobase per million (RPKM)</option>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
73 <option value="own">Set your own scaling factor</option>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
74 <option value="no">Do not normalize or scale</option>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
75 </param>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
76 <when value="rpkm"/>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
77 <when value="no"/>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
78 <when value="1x">
18
5ea8782d650c Uploaded
bgruening
parents: 17
diff changeset
79 <expand macro="effectiveGenomeSize" />
0
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
80 </when>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
81 <when value="own">
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
82 <param name="scaleFactor" type="float" value="1" size="3"
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
83 label="Scale factor to multiply all values" />
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
84 </when>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
85 </conditional>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
86
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
87 <param name="outFileFormat" type="select" label="Coverage file format">
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
88 <option value="bigwig" selected="true">bigwig</option>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
89 <option value="bedgraph">bedgraph</option>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
90 </param>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
91
18
5ea8782d650c Uploaded
bgruening
parents: 17
diff changeset
92 <expand macro="region_limit_operation" />
5ea8782d650c Uploaded
bgruening
parents: 17
diff changeset
93
0
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
94 <conditional name="advancedOpt">
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
95 <param name="showAdvancedOpt" type="select" label="Show advanced options" >
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
96 <option value="no" selected="true">no</option>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
97 <option value="yes">yes</option>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
98 </param>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
99 <when value="no" />
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
100 <when value="yes">
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
101 <param name="smoothLength" type="integer" value="1" optional="true" min="1"
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
102 label="Smooth values using the following length (in bp)"
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
103 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."/>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
104
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
105 <param name="doNotExtendPairedEnds" type="boolean" truevalue="--doNotExtendPairedEnds" falsevalue=""
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
106 label="Do not extend paired ends"
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
107 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."/>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
108
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
109 <param name="ignoreDuplicates" type="boolean" truevalue="--ignoreDuplicates" falsevalue=""
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
110 label="Ignore duplicates"
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
111 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." />
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
112
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
113 <param name="minMappingQuality" type="integer" optional="true" value="1" min="1"
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
114 label="Minimum mapping quality"
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
115 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."/>
17
ef65d6b68ccc Uploaded
bgruening
parents: 10
diff changeset
116
ef65d6b68ccc Uploaded
bgruening
parents: 10
diff changeset
117 <!-- <param name="ignoreForNormalization" type="text" value="" size="50"
ef65d6b68ccc Uploaded
bgruening
parents: 10
diff changeset
118 label="regions that should be excluded for calculating the scaling factor"
ef65d6b68ccc Uploaded
bgruening
parents: 10
diff changeset
119 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" />
ef65d6b68ccc Uploaded
bgruening
parents: 10
diff changeset
120 -->
0
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
121 </when>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
122 </conditional>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
123 </inputs>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
124 <outputs>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
125 <data format="bigwig" name="outFileName">
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
126 <change_format>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
127 <when input="outFileFormat" value="bigwig" format="bigwig" />
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
128 <when input="outFileFormat" value="bedgraph" format="bedgraph" />
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
129 </change_format>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
130 </data>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
131 </outputs>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
132 <help>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
133
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
134 **What it does**
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
135
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
136 Given a BAM file, this tool generates a bigWig or bedGraph file of fragment or read coverages.
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
137 The way the method works is by first calculating all the number of reads (either extended to match the fragment length or not)
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
138 that overlap each bin in the genome. Bins with zero counts are skipped, i.e. not added to the output file.
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
139 The resulting read counts can be normalized using either a given scaling factor, the RPKM formula or to get a 1x depth of coverage (RPGC).
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
140
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
141
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
142 .. image:: $PATH_TO_IMAGES/norm_IGVsnapshot_indFiles.png
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
143
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
144
18
5ea8782d650c Uploaded
bgruening
parents: 17
diff changeset
145 You can find more details in the `bamCoverage wiki`_.
5ea8782d650c Uploaded
bgruening
parents: 17
diff changeset
146
5ea8782d650c Uploaded
bgruening
parents: 17
diff changeset
147 .. _bamCoverage wiki: https://github.com/fidelram/deepTools/wiki/Normalizations#wiki-bamCoverage
5ea8782d650c Uploaded
bgruening
parents: 17
diff changeset
148
5ea8782d650c Uploaded
bgruening
parents: 17
diff changeset
149
0
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
150 **Output files**:
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
151
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
152 - coverage file either in bigWig or bedGraph format
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
153
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
154 -----
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
155
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
156 @REFERENCES@
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
157
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
158 </help>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
159 </tool>