annotate bamCorrelate.xml @ 4:ac935c35437a draft

Uploaded
author bgruening
date Sat, 16 Nov 2013 07:54:13 -0500
parents 9441b4e5d2d6
children c54d31467be4
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
1 <tool id="deeptools_bamCorrelate" name="bamCorrelate" version="1.0.1">
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
2 <description>correlates pairs of BAM files</description>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
3 <expand macro="requirements" />
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
4 <macros>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
5 <import>deepTools_macros.xml</import>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
6 </macros>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
7 <command>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
8 #import tempfile
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
9 #set $temp_dir = os.path.abspath(tempfile.mkdtemp())
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
10
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
11 #set files=[]
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
12 #set labels=[]
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
13
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
14 @multiple_input_bams@
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
15
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
16 bamCorrelate
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
17
3
9441b4e5d2d6 Uploaded
bgruening
parents: 1
diff changeset
18 #if $mode.modeOpt == "bins":
9441b4e5d2d6 Uploaded
bgruening
parents: 1
diff changeset
19 bins
9441b4e5d2d6 Uploaded
bgruening
parents: 1
diff changeset
20 --binSize '$mode.binSize'
9441b4e5d2d6 Uploaded
bgruening
parents: 1
diff changeset
21 --numberOfSamples '$mode.numberOfSamples'
9441b4e5d2d6 Uploaded
bgruening
parents: 1
diff changeset
22 #else:
9441b4e5d2d6 Uploaded
bgruening
parents: 1
diff changeset
23 BED-file
9441b4e5d2d6 Uploaded
bgruening
parents: 1
diff changeset
24 --BED $mode.region_file
9441b4e5d2d6 Uploaded
bgruening
parents: 1
diff changeset
25 #end if
9441b4e5d2d6 Uploaded
bgruening
parents: 1
diff changeset
26
0
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
27 @THREADS@
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
28
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
29 --bamfiles #echo " ".join($files)
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
30 --labels #echo " ".join($labels)
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
31
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
32 --fragmentLength $fragmentLength
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
33 --corMethod $corMethod
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
34
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
35 #set newoutFileName=str($outFileName)+".png"
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
36 --plotFile $newoutFileName
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
37
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
38 #if $outputOpt.showOutputOpt == "yes"
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
39 --outRawCounts '$outFileRawCounts'
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
40 --outFileCorMatrix '$outFileCorMatrix'
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
41 #end if
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
42
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
43 ## options available in both modes
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
44 #if $mode.advancedOpt.showAdvancedOpt == "yes":
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
45
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
46 #if str($mode.advancedOpt.region.value) != '':
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
47 --region '$mode.advancedOpt.region'
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
48 #end if
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
49
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
50 $mode.advancedOpt.doNotExtendPairedEnds
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
51 $mode.advancedOpt.ignoreDuplicates
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
52 $mode.advancedOpt.includeZeros
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
53
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
54 #if $mode.advancedOpt.minMappingQuality:
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
55 --minMappingQuality '$mode.advancedOpt.minMappingQuality'
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
56 #end if
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
57
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
58 #if $mode.advancedOpt.zMin:
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
59 --zMin $mode.advancedOpt.zMin
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
60 #end if
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
61 #if $mode.advancedOpt.zMax:
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
62 --zMax $mode.advancedOpt.zMax
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
63 #end if
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
64 --colorMap '$mode.advancedOpt.colorMap'
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
65
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
66 #end if
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
67
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
68 ; mv $newoutFileName $outFileName
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
69 ; rm $temp_dir -rf
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
70 </command>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
71
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
72 <inputs>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
73 <expand macro="multiple_input_bams" />
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
74
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
75 <param name="fragmentLength" type="integer" value="300" min="1"
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
76 label="Length of the average fragment size"
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
77 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. *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
78
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
79 <param name="corMethod" type="select" label="Correlation method">
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
80 <option value="pearson">Pearson</option>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
81 <option value="spearman">Spearman</option>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
82 </param>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
83
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
84 <conditional name="mode">
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
85 <param name="modeOpt" type="select" label="Choose computation mode"
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
86 help="In the bins mode, the correlation is computed based on equal length bins. In the BED file mode, as list of genomic regions in BED format has to be given. For each region in the BED file the number of overlapping reads is counted in each of the BAM files. Then the correlation is computed.">
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
87 <option value="bins" selected="true">Bins</option>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
88 <option value="BED-file">Limit correlation to certain regions (BED file)</option>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
89 </param>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
90 <when value="bins">
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
91 <param name="binSize" type="integer" value="10000" min="1"
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
92 label="Bin size in bp"
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
93 help="Length in base pairs for a window used to sample the genome."/>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
94
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
95 <param name="numberOfSamples" type="integer" value="100000" min="1"
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
96 label="Number of samples"
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
97 help="Number of samples taken from the genome to compute the scaling factors"/>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
98 <expand macro="bamCorrelate_mode_actions" />
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
99 </when>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
100 <when value="BED-file">
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
101 <param name="region_file" type="data" format="bed" label="Region file in BED format" help="Correlation is computed for the number of reads that overlap such regions."/>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
102 <expand macro="bamCorrelate_mode_actions" />
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
103 </when>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
104
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
105 </conditional>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
106
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
107 <conditional name="outputOpt">
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
108 <param name="showOutputOpt" type="select" label="Show additional output options" >
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
109 <option value="no" selected="true">no</option>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
110 <option value="yes">yes</option>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
111 </param>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
112 <when value="no" />
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
113 <when value="yes">
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
114 <param name="saveRawCounts" type="boolean" label="Save the bin counts"/>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
115 <param name="saveCorMatrix" type="boolean" label="Save the correlation matrix"/>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
116 </when>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
117 </conditional>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
118
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
119 </inputs>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
120 <outputs>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
121 <data format="png" name="outFileName" />
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
122 <data format="tabular" name="outFileRawCounts" label="${tool.name} on ${on_string}: bin counts">
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
123 <filter>(outputOpt['showOutputOpt'] == 'yes' and outputOpt['saveRawCounts'] == True)</filter>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
124 </data>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
125 <data format="tabular" name="outFileCorMatrix" label="${tool.name} on ${on_string}: correlation matrix">
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
126 <filter>(outputOpt['showOutputOpt'] == 'yes' and outputOpt['saveCorMatrix'] == True)</filter>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
127 </data>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
128 </outputs>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
129 <help>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
130
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
131 **What it does**
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
132
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
133 This tool is useful to assess the overall similarity of different BAM files. A typical application
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
134 is to check the correlation between replicates or published data sets.
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
135
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
136 The tool splits the genomes into bins of given length. For each bin, the number of reads
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
137 found in each BAM file is counted and a correlation is computed for all
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
138 pairs of BAM files.
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
139
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
140
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
141 .. image:: $PATH_TO_IMAGES/QC_bamCorrelate_humanSamples.png
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
142 :alt: Heatmap of RNA Polymerase II ChIP-seq
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
143
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
144
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
145 **Output files**:
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
146
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
147 - diagnostic plot produced by bamCorrelate is a clustered heatmap displaying the values for each pair-wise correlation, see below for an example
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
148 - data matrix (optional) in case you want to plot the correlation values using a different program, e.g. R, this matrix can be used
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
149
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
150
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
151
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
152
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
153 -----
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
154
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
155 .. class:: infomark
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
156
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
157 @REFERENCES@
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
158
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
159 </help>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
160 </tool>