1
|
1 <tool id="bamCorrelate" name="bamCorrelate" version="1.0.1">
|
0
|
2 <description>corrlates pairs of bam files</description>
|
|
3 <requirements>
|
1
|
4 <requirement type="package" version="1.5.1_59e067cce039cb93add04823c9f51cab202f8c2b">deepTools</requirement>
|
0
|
5 </requirements>
|
|
6 <command>
|
1
|
7 #import tempfile
|
|
8 #set $temp_dir = os.path.abspath(tempfile.mkdtemp())
|
|
9
|
|
10 #set files=[]
|
|
11 #set labels=[]
|
|
12 #for $i in $inputs
|
|
13
|
|
14 #set $temp_input_handle = tempfile.NamedTemporaryFile( dir=$temp_dir )
|
|
15 #set $temp_input_path = $temp_input_handle.name
|
|
16 #silent $temp_input_handle.close()
|
|
17 #silent os.system("ln -s %s %s.bam" % (str($i.bamfile), $temp_input_path))
|
|
18 #silent os.system("ln -s %s %s.bam.bai" % (str($i.bamfile.metadata.bam_index), $temp_input_path))
|
|
19 #silent $files.append('%s.bam' % $temp_input_path)
|
|
20
|
|
21
|
|
22 ##set $files += [str($i.bamfile)]
|
|
23 #if str($i.label.value) != "":
|
|
24 #set $labels += ["\"%s\"" % ($i.label.value)]
|
|
25 #else
|
|
26 #set $labels += ["\"%s\"" % ($i.bamfile.name)]
|
|
27 #end if
|
|
28 #end for
|
0
|
29 bamCorrelate
|
1
|
30
|
|
31 ##ToDo
|
|
32 --numberOfProcessors 4
|
|
33
|
0
|
34 --bamfiles #echo " ".join($files)
|
|
35 --labels #echo " ".join($labels)
|
|
36
|
|
37 --fragmentLength $fragmentLength
|
|
38 --corMethod $corMethod
|
|
39
|
|
40 #set newoutFileName=str($outFileName)+".png"
|
|
41 --plotFile $newoutFileName
|
|
42
|
|
43 #if $outputOpt.showOutputOpt == "yes"
|
1
|
44 --outRawCounts '$outFileRawCounts'
|
|
45 --outFileCorMatrix '$outFileCorMatrix'
|
0
|
46 #end if
|
|
47
|
|
48 #if $advancedOpt.showAdvancedOpt == "yes":
|
|
49 #if $advancedOpt.smoothLength:
|
|
50 --smoothLength '$advancedOpt.smoothLength'
|
|
51 #end if
|
|
52
|
|
53 #if str($advancedOpt.region.value) != '':
|
|
54 --region '$advancedOpt.region'
|
|
55 #end if
|
|
56
|
|
57 --binSize '$advancedOpt.binSize'
|
|
58 --numberOfSamples '$advancedOpt.numberOfSamples'
|
|
59
|
|
60 $advancedOpt.doNotExtendPairedEnds
|
|
61 $advancedOpt.ignoreDuplicates
|
|
62 $advancedOpt.includeZeros
|
|
63
|
|
64 #if $advancedOpt.minMappingQuality:
|
|
65 --minMappingQuality '$advancedOpt.minMappingQuality'
|
|
66 #end if
|
|
67 #end if
|
1
|
68 ; mv $newoutFileName $outFileName
|
|
69 ; rm $temp_dir -rf
|
0
|
70 </command>
|
|
71
|
|
72 <inputs>
|
|
73 <repeat name="inputs" title="Input files" min="2">
|
|
74 <param name="bamfile" type="data" format="bam"
|
|
75 label="Bam file"
|
|
76 help="The BAM file must be sorted and indexed."/>
|
|
77 <param name="label" type="text" size="30" optional="true" value=""
|
|
78 label="Label"
|
|
79 help="Label to use in the output. If not given the dataset name will be used instead."/>
|
|
80 </repeat>
|
1
|
81
|
0
|
82 <param name="fragmentLength" type="integer" value="300" min="1"
|
|
83 label="Length of the average fragment size"
|
|
84 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 "normalize coverage to 1x"). 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."/>
|
|
85
|
|
86 <param name="corMethod" type="select" label="Correlation method">
|
|
87 <option value="pearson">Pearson</option>
|
|
88 <option value="spearman">Spearman</option>
|
|
89 </param>
|
|
90
|
|
91 <conditional name="advancedOpt">
|
|
92 <param name="showAdvancedOpt" type="select" label="Show advanced options" >
|
|
93 <option value="no" selected="true">no</option>
|
|
94 <option value="yes">yes</option>
|
|
95 </param>
|
|
96 <when value="no" />
|
|
97 <when value="yes">
|
|
98 <param name="smoothLength" type="integer" value="1" optional="true" min="1"
|
|
99 label="Smooth values using the following length (in bp)"
|
|
100 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."/>
|
|
101
|
|
102 <param name="region" type="text" value=""
|
|
103 label="Region of the genome to limit the operation to"
|
|
104 help="This is useful when testing parameters to reduce the computing time. The format is chr:start:end, for example "chr10" or "chr10:456700:891000"" />
|
|
105
|
|
106 <param name="binSize" type="integer" value="10000" min="1"
|
|
107 label="Bin size in bp"
|
|
108 help="Length in base pairs for a window used to sample the genome."/>
|
|
109
|
|
110 <param name="numberOfSamples" type="integer" value="100000" min="1"
|
|
111 label="Number of samples"
|
|
112 help="Number of samples taken from the genome to compute the scaling factors"/>
|
|
113
|
|
114 <param name="doNotExtendPairedEnds" type="boolean" truevalue="--doNotExtendPairedEnds" falsevalue=""
|
|
115 label="Do not extend paired ends"
|
|
116 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."/>
|
|
117
|
|
118 <param name="ignoreDuplicates" type="boolean" truevalue="--ignoreDuplicates" falsevalue=""
|
|
119 label="Ignore duplicates"
|
|
120 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." />
|
|
121
|
|
122 <param name="minMappingQuality" type="integer" optional="true" value="1" min="1"
|
|
123 label="Minimum mapping quality"
|
|
124 help= "If set, only reads that have a mapping quality score higher than the given value are considered"/>
|
|
125
|
|
126 <param name="includeZeros" type="boolean" truevalue="--includeZeros" falsevalue=""
|
|
127 label ="Include zeros"
|
|
128 help ="If set, then zero counts that happen for *all* bam files given are included. The default behavior is to ignore those cases" />
|
|
129
|
|
130 </when>
|
|
131 </conditional>
|
|
132
|
|
133 <conditional name="outputOpt">
|
|
134 <param name="showOutputOpt" type="select" label="Show additional output options" >
|
|
135 <option value="no" selected="true">no</option>
|
|
136 <option value="yes">yes</option>
|
|
137 </param>
|
|
138 <when value="no" />
|
|
139 <when value="yes">
|
|
140 <param name="saveRawCounts" type="boolean" label="Save the bin counts"/>
|
|
141 <param name="saveCorMatrix" type="boolean" label="Save the correlation matrix"/>
|
|
142 </when>
|
|
143 </conditional>
|
|
144
|
|
145 </inputs>
|
|
146 <outputs>
|
|
147 <data format="png" name="outFileName" />
|
|
148 <data format="tabular" name="outFileRawCounts" label="${tool.name} on ${on_string}: bin counts">
|
|
149 <filter>(outputOpt['showOutputOpt'] == 'yes' and outputOpt['saveRawCounts'] == True)</filter>
|
|
150 </data>
|
|
151 <data format="tabular" name="outFileCorMatrix" label="${tool.name} on ${on_string}: correlation matrix">
|
|
152 <filter>(outputOpt['showOutputOpt'] == 'yes' and outputOpt['saveCorMatrix'] == True)</filter>
|
|
153 </data>
|
|
154 </outputs>
|
|
155 <help>
|
|
156
|
|
157 **What it does**
|
|
158
|
|
159 Genomes are split into bins of given length. For each bin the number of reads
|
|
160 found for each of the bam files is counted. A correlation is computed for all
|
|
161 pairs of bam files.
|
|
162
|
|
163 -----
|
|
164
|
|
165 .. class:: infomark
|
|
166
|
|
167 Please acknowledge that this tool **is still in development** and we will be very happy to receive feedback from the users. If you run into any trouble please sent an email to `Fidel Ramirez`_.
|
|
168
|
|
169 This tool is developed by the `Bioinformatics and Deep-Sequencing Unit`_ at the `Max Planck Institute for Immunobiology and Epigenetics`_.
|
|
170
|
|
171
|
|
172 .. _Bioinformatics and Deep-Sequencing Unit: http://www3.ie-freiburg.mpg.de/facilities/research-facilities/bioinformatics-and-deep-sequencing-unit/
|
|
173 .. _Max Planck Institute for Immunobiology and Epigenetics: http://www3.ie-freiburg.mpg.de
|
|
174 .. _Fidel Ramirez: ramirez@ie-freiburg.mpg.de
|
|
175
|
|
176 </help>
|
|
177
|
|
178 </tool>
|