annotate bamCorrelate.xml @ 0:d957e25e18a3 draft

Uploaded
author bgruening
date Thu, 14 Nov 2013 16:39:18 -0500
parents
children a22ccc261bb3
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
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
18 @THREADS@
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
19
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
20 --bamfiles #echo " ".join($files)
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
21 --labels #echo " ".join($labels)
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
22
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
23 --fragmentLength $fragmentLength
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
24 --corMethod $corMethod
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
25
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
26 #set newoutFileName=str($outFileName)+".png"
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
27 --plotFile $newoutFileName
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
28
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
29 #if $outputOpt.showOutputOpt == "yes"
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
30 --outRawCounts '$outFileRawCounts'
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
31 --outFileCorMatrix '$outFileCorMatrix'
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
32 #end if
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
33
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
34 #if $mode.modeOpt == "bins":
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
35 --binSize '$mode.binSize'
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
36 --numberOfSamples '$modenumberOfSamples'
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
37 #else:
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
38 --BED $mode.region_file
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
39 #end if
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
40
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
41 ## options available in both modes
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
42 #if $mode.advancedOpt.showAdvancedOpt == "yes":
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
43
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
44 #if str($mode.advancedOpt.region.value) != '':
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
45 --region '$mode.advancedOpt.region'
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
46 #end if
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
47
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
48 $mode.advancedOpt.doNotExtendPairedEnds
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
49 $mode.advancedOpt.ignoreDuplicates
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
50 $mode.advancedOpt.includeZeros
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
51
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
52 #if $mode.advancedOpt.minMappingQuality:
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
53 --minMappingQuality '$mode.advancedOpt.minMappingQuality'
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
54 #end if
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
55
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
56 #if $mode.advancedOpt.zMin:
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
57 --zMin $mode.advancedOpt.zMin
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
58 #end if
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
59 #if $mode.advancedOpt.zMax:
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
60 --zMax $mode.advancedOpt.zMax
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
61 #end if
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
62 --colorMap '$mode.advancedOpt.colorMap'
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
63
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
64 #end if
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
65
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
66 ; mv $newoutFileName $outFileName
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
67 ; rm $temp_dir -rf
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
68 </command>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
69
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
70 <inputs>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
71 <expand macro="multiple_input_bams" />
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
72
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
73 <param name="fragmentLength" type="integer" value="300" min="1"
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
74 label="Length of the average fragment size"
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
75 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
76
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
77 <param name="corMethod" type="select" label="Correlation method">
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
78 <option value="pearson">Pearson</option>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
79 <option value="spearman">Spearman</option>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
80 </param>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
81
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
82 <conditional name="mode">
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
83 <param name="modeOpt" type="select" label="Choose computation mode"
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
84 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
85 <option value="bins" selected="true">Bins</option>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
86 <option value="BED-file">Limit correlation to certain regions (BED file)</option>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
87 </param>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
88 <when value="bins">
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
89 <param name="binSize" type="integer" value="10000" min="1"
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
90 label="Bin size in bp"
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
91 help="Length in base pairs for a window used to sample the genome."/>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
92
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
93 <param name="numberOfSamples" type="integer" value="100000" min="1"
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
94 label="Number of samples"
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
95 help="Number of samples taken from the genome to compute the scaling factors"/>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
96 <expand macro="bamCorrelate_mode_actions" />
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
97 </when>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
98 <when value="BED-file">
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
99 <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
100 <expand macro="bamCorrelate_mode_actions" />
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
101 </when>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
102
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
103 </conditional>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
104
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
105 <conditional name="outputOpt">
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
106 <param name="showOutputOpt" type="select" label="Show additional output options" >
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
107 <option value="no" selected="true">no</option>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
108 <option value="yes">yes</option>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
109 </param>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
110 <when value="no" />
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
111 <when value="yes">
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
112 <param name="saveRawCounts" type="boolean" label="Save the bin counts"/>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
113 <param name="saveCorMatrix" type="boolean" label="Save the correlation matrix"/>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
114 </when>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
115 </conditional>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
116
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
117 </inputs>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
118 <outputs>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
119 <data format="png" name="outFileName" />
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
120 <data format="tabular" name="outFileRawCounts" label="${tool.name} on ${on_string}: bin counts">
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
121 <filter>(outputOpt['showOutputOpt'] == 'yes' and outputOpt['saveRawCounts'] == True)</filter>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
122 </data>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
123 <data format="tabular" name="outFileCorMatrix" label="${tool.name} on ${on_string}: correlation matrix">
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
124 <filter>(outputOpt['showOutputOpt'] == 'yes' and outputOpt['saveCorMatrix'] == True)</filter>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
125 </data>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
126 </outputs>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
127 <help>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
128
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
129 **What it does**
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
130
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
131 This tool is useful to assess the overall similarity of different BAM files. A typical application
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
132 is to check the correlation between replicates or published data sets.
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
133
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
134 The tool splits the genomes into bins of given length. For each bin, the number of reads
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
135 found in each BAM file is counted and a correlation is computed for all
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
136 pairs of BAM files.
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
137
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
138
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
139 .. image:: $PATH_TO_IMAGES/QC_bamCorrelate_humanSamples.png
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
140 :alt: Heatmap of RNA Polymerase II ChIP-seq
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
141
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
142
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
143 **Output files**:
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
144
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
145 - 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
146 - 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
147
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
148
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 .. class:: infomark
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
154
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
155 @REFERENCES@
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
156
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
157 </help>
d957e25e18a3 Uploaded
bgruening
parents:
diff changeset
158 </tool>