comparison bamCompare.xml @ 17:2a1b4e95bdf7 draft

planemo upload for repository https://github.com/deeptools/deepTools/tree/master/galaxy/wrapper/ commit b1f975422b307927bbbe245d57609e9464d5d5c8-dirty
author bgruening
date Thu, 15 Feb 2018 07:48:38 -0500
parents 8f2a1286b61c
children a0ad8afc1e5f
comparison
equal deleted inserted replaced
16:2e615a3f2b07 17:2a1b4e95bdf7
1 <tool id="deeptools_bam_compare" name="bamCompare" version="@WRAPPER_VERSION@.0"> 1 <tool id="deeptools_bam_compare" name="bamCompare" version="@WRAPPER_VERSION@.0">
2 <description>normalizes and compares two BAM files to obtain the ratio, log2ratio or difference between them</description> 2 <description>normalizes and compares two BAM or CRAM files to obtain the ratio, log2ratio or difference between them</description>
3 <macros> 3 <macros>
4 <token name="@BINARY@">bamCompare</token> 4 <token name="@BINARY@">bamCompare</token>
5 <import>deepTools_macros.xml</import> 5 <import>deepTools_macros.xml</import>
6 </macros> 6 </macros>
7 <expand macro="requirements" /> 7 <expand macro="requirements" />
8 <command> 8 <command>
9 <![CDATA[ 9 <![CDATA[
10 ln -s '$bamFile1' one.bam && 10 ln -s '$bamFile1' one.bam &&
11 ln -s '${bamFile1.metadata.bam_index}' one.bam.bai && 11 #if $bamFile1.ext == 'bam':
12 ln -s '${bamFile1.metadata.bam_index}' one.bam.bai &&
13 #else:
14 ln -s '${bamFile1.metadata.cram_index}' one.bam.crai &&
15 #end if
12 ln -s '$bamFile2' two.bam && 16 ln -s '$bamFile2' two.bam &&
13 ln -s '${bamFile2.metadata.bam_index}' two.bam.bai && 17 #if $bamFile2.ext == 'bam':
18 ln -s '${bamFile2.metadata.bam_index}' two.bam.bai &&
19 #else:
20 ln -s '${bamFile2.metadata.cram_index}' two.bam.crai &&
21 #end if
14 22
15 @BINARY@ 23 @BINARY@
16 @THREADS@ 24 @THREADS@
17 --bamfile1 one.bam 25 --bamfile1 one.bam
18 --bamfile2 two.bam 26 --bamfile2 two.bam
28 --numberOfSamples $scaling.numberOfSamples 36 --numberOfSamples $scaling.numberOfSamples
29 #elif $scaling.method == 'readCount': 37 #elif $scaling.method == 'readCount':
30 --scaleFactorsMethod readCount 38 --scaleFactorsMethod readCount
31 #elif $scaling.method == 'own': 39 #elif $scaling.method == 'own':
32 --scaleFactors '$scaling.scaleFactor1:$scaling.scaleFactor2' 40 --scaleFactors '$scaling.scaleFactor1:$scaling.scaleFactor2'
33 #end if 41 #elif $scaling.method == 'None':
34 42 --scaleFactorsMethod None
35 --ratio $comparison.type 43 #if $scaling.type != '':
36 44 --normalizeUsing $scaling.type
37 #if $comparison.type == 'subtract':
38 #if $comparison.normalization.type == 'rpkm':
39 --normalizeUsingRPKM
40 #elif $comparison.normalization.type == '1x':
41
42 #if $comparison.normalization.effectiveGenomeSize.effectiveGenomeSize_opt == "specific":
43 --normalizeTo1x $comparison.normalization.effectiveGenomeSize.effectiveGenomeSize
44 #else:
45 --normalizeTo1x $comparison.normalization.effectiveGenomeSize.effectiveGenomeSize_opt
46 #end if
47
48 #end if 45 #end if
49 #elif $comparison.type in ['ratio','log2']: 46 #end if
47
48 --operation $comparison.type
49
50 #if $comparison.type in ['ratio','log2']:
50 --pseudocount $comparison.pseudocount 51 --pseudocount $comparison.pseudocount
51 #end if 52 #end if
52 53
53 #if str($region).strip() != '': 54 #if str($region).strip() != '':
54 --region '$region' 55 --region '$region'
69 @blacklist@ 70 @blacklist@
70 #end if 71 #end if
71 ]]> 72 ]]>
72 </command> 73 </command>
73 <inputs> 74 <inputs>
74 <param argument="--bamFile1" format="bam" type="data" label="First BAM file (e.g. treated sample)" 75 <param argument="--bamFile1" format="bam,cram" type="data" label="First BAM/CRAM file (e.g. treated sample)"
75 help=""/> 76 help=""/>
76 <param argument="--bamFile2" format="bam" type="data" label="Second BAM file (e.g. control sample)" 77 <param argument="--bamFile2" format="bam,cram" type="data" label="Second BAM/CRAM file (e.g. control sample)"
77 help=""/> 78 help=""/>
78 79
79 <param argument="--binSize" type="integer" value="50" min="1" 80 <param argument="--binSize" type="integer" value="50" min="1"
80 label="Bin size in bases" 81 label="Bin size in bases"
81 help="The genome will be divided into bins of the specified size. For each bin, the overlaping number of fragments (or reads) will be reported. 82 help="The genome will be divided into bins of the specified size. For each bin, the overlapping number of fragments (or reads) will be reported.
82 If only half a fragment overlaps then this fraction will be reported."/> 83 If only half a fragment overlaps then this fraction will be reported."/>
83 84
84 <conditional name="scaling"> 85 <conditional name="scaling">
85 <param name="method" type="select" 86 <param name="method" type="select"
86 label="Method to use for scaling the largest sample to the smallest"> 87 label="Method to use for scaling the largest sample to the smallest">
87 <option value="readCount" selected="true">read count</option> 88 <option value="readCount" selected="true">read count</option>
88 <option value="SES">signal extraction scaling (SES), check with plotFingerprint before using it!</option> 89 <option value="SES">signal extraction scaling (SES), check with plotFingerprint before using it!</option>
89 <option value="own">enter own scaling factors</option> 90 <option value="own">enter own scaling factors</option>
91 <option value="None">Don't scale reads. Samples can instead be normalized using one of the normalization methods</option>
90 </param> 92 </param>
91 <when value="SES"> 93 <when value="SES">
92 <param argument="--sampleLength" type="integer" value="1000" min="10" 94 <param argument="--sampleLength" type="integer" value="1000" min="10"
93 label="Length in bases used to sample the genome and compute the size or scaling factors." 95 label="Length in bases used to sample the genome and compute the size or scaling factors."
94 help="The default is fine. Only change it if you know what you are doing." /> 96 help="The default is fine. Only change it if you know what you are doing." />
97 help="" /> 99 help="" />
98 </when> 100 </when>
99 <when value="readCount" /> 101 <when value="readCount" />
100 <when value="own"> 102 <when value="own">
101 <expand macro="scaleFactors" /> 103 <expand macro="scaleFactors" />
104 </when>
105 <when value="None">
106 <param name="type" type="select" label="Normalization method" >
107 <option value="RPKM">Normalize to fragments (reads) per kilobase per million (RPKM)</option>
108 <option value="CPM">Normalize to counts per million (CPM), same as CPM in RNA-seq</option>
109 <option value="BPM">Normalize to bins per million (BPM), same as TPM in RNA-seq</option>
110 <option value="">Do not normalize or scale</option>
111 </param>
102 </when> 112 </when>
103 </conditional> 113 </conditional>
104 114
105 <conditional name="comparison"> 115 <conditional name="comparison">
106 <param name="type" type="select" 116 <param name="type" type="select"
124 </when> 134 </when>
125 <when value="ratio"> 135 <when value="ratio">
126 <expand macro="pseudocount" /> 136 <expand macro="pseudocount" />
127 </when> 137 </when>
128 <when value="add" /> 138 <when value="add" />
139 <when value="subtract" />
129 <when value="mean" /> 140 <when value="mean" />
130 <when value="first" /> 141 <when value="first" />
131 <when value="second" /> 142 <when value="second" />
132 <when value="reciprocal_ratio"> 143 <when value="reciprocal_ratio">
133 <expand macro="pseudocount" /> 144 <expand macro="pseudocount" />
134 </when>
135 <when value="subtract">
136 <conditional name="normalization">
137 <param name="type" type="select" label="Normalization method" >
138 <option value="1x">Normalize coverage to 1x</option>
139 <option value="rpkm">Normalize to fragments (reads) per kilobase per million (RPKM)</option>
140 <option value="no">Do not normalize or scale</option>
141 </param>
142 <when value="rpkm" />
143 <when value="no" />
144 <when value="1x">
145 <expand macro="effectiveGenomeSize" />
146 </when>
147 </conditional>
148 </when> 145 </when>
149 </conditional> 146 </conditional>
150 147
151 <param name="outFileFormat" type="select" label="Coverage file format"> 148 <param name="outFileFormat" type="select" label="Coverage file format">
152 <option value="bigwig" selected="true">bigwig</option> 149 <option value="bigwig" selected="true">bigwig</option>
209 <![CDATA[ 206 <![CDATA[
210 207
211 What it does 208 What it does
212 ------------- 209 -------------
213 210
214 This tool can be used to generate a bigWig or bedGraph file based on **two BAM** files that are compared to each other while being simultaneously normalized for sequencing depth. 211 This tool can be used to generate a bigWig or bedGraph file based on **two BAM or CRAM** files that are compared to each other while being simultaneously normalized for sequencing depth.
215 212
216 To compare the BAM files to each other, the genome is partitioned into bins of equal size, then the number of reads found in each BAM file is counted per bin, and finally a summary value reported. 213 To compare the BAM files to each other, the genome is partitioned into bins of equal size, then the number of reads found in each BAM file is counted per bin, and finally a summary value reported.
217 This value can be the ratio of the number of reads per bin, the log2 of the ratio, or the difference. 214
218 215 The tool works in two steps:
219 This tool can normalize the number of reads in each BAM file using the SES method proposed in Diaz et al. (2012). "Normalization, bias correction, and peak 216 1. Scaling : To properly compare samples with different sequencing depth, each bam file can be scaled either using the SES method
220 calling for ChIP-seq". Statistical applications in genetics and molecular 217 (proposed in Diaz et al. (2012). "Normalization, bias correction, and peak calling for ChIP-seq". Statistical applications in genetics and molecular
221 biology, 11(3). 218 biology, 11(3).) or total read count. additionally scaling can be turned off and a per-sample normalization can be used (--normalizeUsing RPKM/CPM/BPM)
222 219
223 Normalization based on read counts is also available. 220 2. Comparison : Two bam files are compared using one of the chosen methods (e.g. add, subtract, mean, log2 ratio etc.)
224 221
225 By default, if reads are from a paired-end sequencing run and reads are properly paired, the fragment length reported in the BAM file is used. 222 By default, if reads are from a paired-end sequencing run and reads are properly paired, the fragment length reported in the BAM file is used.
226 223
227 **Note:** *For paired-end sequencing samples, each read mate is treated independently to avoid a bias when a mixture of concordant and discordant pairs are present. This means that _each end_ will be extended to match the fragment length.* 224 **Note:** *For paired-end sequencing samples, each read mate is treated independently to avoid a bias when a mixture of concordant and discordant pairs are present. This means that _each end_ will be extended to match the fragment length.*
228 225