|
0
|
1 <tool id="bamFingerprint" name="bamFingerprint" version="1.0">
|
|
|
2 <description>plots profiles 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 #set $temp_input_handle = tempfile.NamedTemporaryFile( dir=$temp_dir )
|
|
|
14 #set $temp_input_path = $temp_input_handle.name
|
|
|
15 #silent $temp_input_handle.close()
|
|
|
16 #silent os.system("ln -s %s %s.bam" % (str($i.bamfile), $temp_input_path))
|
|
|
17 #silent os.system("ln -s %s %s.bam.bai" % (str($i.bamfile.metadata.bam_index), $temp_input_path))
|
|
|
18 #silent $files.append('%s.bam' % $temp_input_path)
|
|
|
19
|
|
|
20 ##set $files += [str($i.bamfile)]
|
|
|
21 #if str($i.label.value) != "":
|
|
|
22 #set $labels += ["\"%s\"" % ($i.label.value)]
|
|
|
23 #else
|
|
|
24 #set $labels += ["\"%s\"" % ($i.bamfile.name)]
|
|
|
25 #end if
|
|
|
26 #end for
|
|
|
27
|
|
0
|
28 bamFingerprint
|
|
1
|
29
|
|
|
30 ##ToDo
|
|
|
31 --numberOfProcessors 4
|
|
|
32
|
|
0
|
33 --bamfiles #echo " ".join($files)
|
|
|
34 --labels #echo " ".join($labels)
|
|
1
|
35
|
|
0
|
36 --fragmentLength $fragmentLength
|
|
1
|
37
|
|
0
|
38 #set newoutFileName=str($outFileName)+".png"
|
|
|
39 --plotFile $newoutFileName
|
|
1
|
40
|
|
0
|
41 #if $outputOpt.showOutputOpt == "yes"
|
|
|
42 #if $outputOpt.saveRawCounts:
|
|
|
43 --outRawCounts '$outFileRawCounts'
|
|
|
44 #end if
|
|
|
45 #end if
|
|
1
|
46
|
|
0
|
47 #if $advancedOpt.showAdvancedOpt == "yes":
|
|
|
48 #if $advancedOpt.smoothLength:
|
|
|
49 --smoothLength '$advancedOpt.smoothLength'
|
|
|
50 #end if
|
|
1
|
51
|
|
0
|
52 #if str($advancedOpt.region.value) != '':
|
|
|
53 --region '$advancedOpt.region'
|
|
|
54 #end if
|
|
1
|
55
|
|
0
|
56 --binSize '$advancedOpt.binSize'
|
|
|
57 --numberOfSamples '$advancedOpt.numberOfSamples'
|
|
1
|
58
|
|
0
|
59 $advancedOpt.doNotExtendPairedEnds
|
|
|
60 $advancedOpt.ignoreDuplicates
|
|
|
61 $advancedOpt.skipZeros
|
|
1
|
62
|
|
0
|
63 #if $advancedOpt.minMappingQuality:
|
|
|
64 --minMappingQuality '$advancedOpt.minMappingQuality'
|
|
|
65 #end if
|
|
|
66 #end if
|
|
1
|
67 ; mv $newoutFileName $outFileName
|
|
|
68 ; rm $temp_dir -rf
|
|
0
|
69 </command>
|
|
|
70
|
|
|
71 <inputs>
|
|
|
72 <repeat name="inputs" title="Input files" min="2">
|
|
|
73 <param name="bamfile" type="data" format="bam"
|
|
|
74 label="Bam file"
|
|
|
75 help="The BAM file must be sorted and indexed."/>
|
|
|
76 <param name="label" type="text" size="30" optional="true" value=""
|
|
|
77 label="Label"
|
|
|
78 help="Label to use in the output. If not given the dataset name will be used instead."/>
|
|
|
79 </repeat>
|
|
|
80 <param name="fragmentLength" type="integer" value="200" min="1"
|
|
|
81 label="Length of the average fragment size"/>
|
|
|
82 <conditional name="advancedOpt">
|
|
|
83 <param name="showAdvancedOpt" type="select" label="Show advanced options" >
|
|
|
84 <option value="no" selected="true">no</option>
|
|
|
85 <option value="yes">yes</option>
|
|
|
86 </param>
|
|
|
87 <when value="no" />
|
|
|
88 <when value="yes">
|
|
|
89 <param name="smoothLength" type="integer" value="1" optional="true" min="1"
|
|
|
90 label="Smooth values using the following length (in bp)"
|
|
|
91 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."/>
|
|
|
92
|
|
|
93 <param name="region" type="text" value=""
|
|
|
94 label="Region of the genome to limit the operation to"
|
|
|
95 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"" />
|
|
|
96
|
|
|
97 <param name="binSize" type="integer" value="10000" min="1"
|
|
|
98 label="Bin size in bp"
|
|
|
99 help="Length in base pairs for a window used to sample the genome."/>
|
|
|
100
|
|
|
101 <param name="numberOfSamples" type="integer" value="100000" min="1"
|
|
|
102 label="Number of samples"
|
|
|
103 help="Number of samples taken from the genome to compute the scaling factors"/>
|
|
|
104
|
|
|
105 <param name="doNotExtendPairedEnds" type="boolean" truevalue="--doNotExtendPairedEnds" falsevalue=""
|
|
|
106 label="Do not extend paired ends"
|
|
|
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."/>
|
|
|
108
|
|
|
109 <param name="ignoreDuplicates" type="boolean" truevalue="--ignoreDuplicates" falsevalue=""
|
|
|
110 label="Ignore duplicates"
|
|
|
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." />
|
|
|
112
|
|
|
113 <param name="minMappingQuality" type="integer" optional="true" value="1" min="1"
|
|
|
114 label="Minimum mapping quality"
|
|
|
115 help= "If set, only reads that have a mapping quality score higher than the given value are considered"/>
|
|
|
116
|
|
|
117 <param name="skipZeros" type="boolean" truevalue="--skipZeros" falsevalue=""
|
|
|
118 label ="Include zeros"
|
|
|
119 help ="If set, then zero counts that happen for *all* bam files given are ignored. This will result in a reduced number of read counts than the specified in number of samples" />
|
|
|
120 </when>
|
|
|
121 </conditional>
|
|
|
122
|
|
|
123 <conditional name="outputOpt">
|
|
|
124 <param name="showOutputOpt" type="select" label="Show additional output options" >
|
|
|
125 <option value="no" selected="true">no</option>
|
|
|
126 <option value="yes">yes</option>
|
|
|
127 </param>
|
|
|
128 <when value="no" />
|
|
|
129 <when value="yes">
|
|
|
130 <param name="saveRawCounts" type="boolean" label="Save the bin counts"/>
|
|
|
131 </when>
|
|
|
132 </conditional>
|
|
|
133 </inputs>
|
|
|
134 <outputs>
|
|
|
135 <data format="png" name="outFileName" />
|
|
|
136 <data format="tabular" name="outFileRawCounts" label="${tool.name} on ${on_string}: bin counts">
|
|
|
137 <filter>(outputOpt['showOutputOpt'] == 'yes' and outputOpt['saveRawCounts'] == True)</filter>
|
|
|
138 </data>
|
|
|
139 </outputs>
|
|
|
140 <help>
|
|
|
141
|
|
|
142 **What it does**
|
|
|
143
|
|
5
|
144 This tool is based on a method developed by Diaz et al. (2012). Stat Appl Genet Mol Biol 11(3).
|
|
|
145 The resulting plot can be used to assess the strength of a ChIP (for factors that bind to narrow regions).
|
|
|
146 The tool first samples indexed bam files and counts all reads overlapping a window (bin) of specified length.
|
|
|
147 These counts are then sorted according to their rank and the cumulative sum of read counts are plotted. An ideal input
|
|
|
148 with perfect uniform distribution of reads along the genome (i.e. without enrichments in open chromatin etc.) should
|
|
|
149 generate a straight diagonal line. A very specific and strong ChIP enrichment will be indicated by a prominent and steep
|
|
|
150 rise of the cumulative sum towards the highest rank. This means that a big chunk of reads from the ChIP sample is located in
|
|
|
151 few bins which corresponds to high, narrow enrichments seen for transcription factors.
|
|
0
|
152
|
|
|
153 -----
|
|
|
154
|
|
|
155 .. class:: infomark
|
|
|
156
|
|
5
|
157 If you would like to give us feedback or you run into any trouble, please sent an email to deeptools@googlegroups.com
|
|
0
|
158
|
|
|
159 This tool is developed by the `Bioinformatics and Deep-Sequencing Unit`_ at the `Max Planck Institute for Immunobiology and Epigenetics`_.
|
|
|
160
|
|
|
161
|
|
|
162 .. _Bioinformatics and Deep-Sequencing Unit: http://www3.ie-freiburg.mpg.de/facilities/research-facilities/bioinformatics-and-deep-sequencing-unit/
|
|
|
163 .. _Max Planck Institute for Immunobiology and Epigenetics: http://www3.ie-freiburg.mpg.de
|
|
|
164 .. _Fidel Ramirez: ramirez@ie-freiburg.mpg.de
|
|
|
165
|
|
|
166 </help>
|
|
|
167
|
|
|
168 </tool>
|