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