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