Mercurial > repos > bgruening > hicexplorer_hiccorrectmatrix
comparison hicCorrectMatrix.xml @ 13:9949f055db84 draft
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/hicexplorer commit 3b41d687ff30583540d055f6995de00530cca81d-dirty"
author | bgruening |
---|---|
date | Mon, 16 Dec 2019 14:31:21 -0500 |
parents | 92fc291ceb1a |
children | 1e622e371512 |
comparison
equal
deleted
inserted
replaced
12:ccb35fd640b9 | 13:9949f055db84 |
---|---|
4 <token name="@BINARY@">hicCorrectMatrix</token> | 4 <token name="@BINARY@">hicCorrectMatrix</token> |
5 <import>macros.xml</import> | 5 <import>macros.xml</import> |
6 </macros> | 6 </macros> |
7 <expand macro="requirements" /> | 7 <expand macro="requirements" /> |
8 <command detect_errors="exit_code"><![CDATA[ | 8 <command detect_errors="exit_code"><![CDATA[ |
9 | 9 ln -s '$matrix_h5_cooler' 'matrix.$matrix_h5_cooler.ext' && |
10 hicCorrectMatrix | 10 |
11 @BINARY@ | |
11 $mode.mode_selector | 12 $mode.mode_selector |
12 --matrix '$matrix_h5_cooler' | 13 --matrix 'matrix.$matrix_h5_cooler.ext' |
13 | 14 |
14 ## special: --chromosomes is optional, but if given needs at least one argument | 15 ## special: --chromosomes is optional, but if given needs at least one argument |
15 #set chroms = '" "'.join([ str($var.chromosome) for $var in $chromosomes ]) | 16 #set chroms = ' '.join([ '\'' + str($var.chromosome) + '\'' for $var in $chromosomes ]) |
16 #if chroms | 17 #if chroms |
17 --chromosomes "$chroms" | 18 --chromosomes $chroms |
18 #end if | 19 #end if |
19 | 20 |
20 #if $mode.mode_selector == 'correct': | 21 #if $mode.mode_selector == 'correct': |
21 | 22 #if $mode.correctionMethod.correctionMethod_selector == 'ice': |
22 --iterNum $mode.iterNum | 23 --correctionMethod ICE |
23 --outFileName matrix.$mode.outputFormat | 24 --iterNum $mode.correctionMethod.iterNum |
24 | 25 |
25 #if $mode.filterThreshold_low and $mode.filterThreshold_large: | 26 |
26 --filterThreshold $mode.filterThreshold_low $mode.filterThreshold_large | 27 #if $mode.correctionMethod.filterThreshold_low and $mode.correctionMethod.filterThreshold_large: |
28 --filterThreshold $mode.correctionMethod.filterThreshold_low $mode.correctionMethod.filterThreshold_large | |
29 #end if | |
30 | |
31 #if $mode.correctionMethod.inflationCutoff: | |
32 --inflationCutoff $mode.correctionMethod.inflationCutoff | |
33 #end if | |
34 | |
35 #if $mode.correctionMethod.transCutoff: | |
36 --transCutoff $mode.correctionMethod.transCutoff | |
37 #end if | |
38 | |
39 #if $mode.correctionMethod.sequencedCountCutoff: | |
40 --sequencedCountCutoff $mode.correctionMethod.sequencedCountCutoff | |
41 #end if | |
42 | |
43 $mode.correctionMethod.skipDiagonal | |
44 $mode.correctionMethod.perchr | |
45 #else: | |
46 --correctionMethod KR | |
27 #end if | 47 #end if |
28 | 48 --outFileName matrix.$matrix_h5_cooler.ext |
29 #if $mode.inflationCutoff: | 49 #elif $mode.mode_selector == 'diagnostic_plot': |
30 --inflationCutoff $mode.inflationCutoff | |
31 #end if | |
32 | |
33 #if $mode.transCutoff: | |
34 --transCutoff $mode.transCutoff | |
35 #end if | |
36 | |
37 #if $mode.sequencedCountCutoff: | |
38 --sequencedCountCutoff $mode.sequencedCountCutoff | |
39 #end if | |
40 | |
41 $mode.skipDiagonal | |
42 $mode.perchr | |
43 | |
44 #elif $mode.mode_selector == 'merge_failed': | |
45 --plotName diagnostic_plot.png | 50 --plotName diagnostic_plot.png |
46 --outMatrixFile corrected_matrix.npz.h5 | 51 ##--outMatrixFile corrected_matrix.npz.h5 |
47 #if $mode.xMax: | 52 #if $mode.xMax: |
48 --xMax $mode.xMax | 53 --xMax $mode.xMax |
49 #end if | 54 #end if |
50 #if $mode.filterThreshold_low and $mode.filterThreshold_large: | 55 $mode.perchr |
51 --filterThreshold '$mode.filterThreshold_low' '$mode.filterThreshold_large' | |
52 #end if | |
53 #else: | |
54 --plotName diagnostic_plot.png | |
55 #if $mode.xMax: | |
56 --xMax $mode.xMax | |
57 #end if | |
58 #end if | 56 #end if |
59 #if $mode.mode_selector == 'correct': | 57 #if $mode.mode_selector == 'correct': |
60 && mv matrix.$mode.outputFormat matrix | 58 && mv matrix.$matrix_h5_cooler.ext matrix |
61 #end if | 59 #end if |
62 ]]> | 60 ]]> |
63 </command> | 61 </command> |
64 <inputs> | 62 <inputs> |
65 <expand macro='matrix_h5_cooler_macro' /> | 63 <expand macro='matrix_h5_cooler_macro' /> |
68 <option value="diagnostic_plot">Diagnostic plot</option> | 66 <option value="diagnostic_plot">Diagnostic plot</option> |
69 <option value="correct">Correct matrix</option> | 67 <option value="correct">Correct matrix</option> |
70 </param> | 68 </param> |
71 <when value="diagnostic_plot"> | 69 <when value="diagnostic_plot"> |
72 <expand macro="xMax" /> | 70 <expand macro="xMax" /> |
71 <param argument="--perchr" name="perchr" type="boolean" truevalue="--perchr" falsevalue="" checked="false" | |
72 label="Compute statistics for each chromosome separately" /> | |
73 </when> | 73 </when> |
74 <when value="correct"> | 74 <when value="correct"> |
75 <param argument="--iterNum" name="iterNum" type="integer" optional="true" value="500" | 75 <conditional name='correctionMethod'> |
76 label="Number of iterations" /> | 76 <param name='correctionMethod_selector' type='select' label='Correction method'> |
77 | 77 <option value='ice'>Iterative_correction (Imakaev)</option> |
78 <param argument="--inflationCutoff" name="inflationCutoff" type="float" optional="true" | 78 <option value='kr'>Knights-Ruiz</option> |
79 label="Inflation cutoff" value="" | 79 </param> |
80 help="Value corresponding to the maximum number of times a bin can be scaled up during the iterative correction. | 80 |
81 For example, a inflationCutoff of 3 will filter out all bins that were expanded 3 times or more during the iterative correction."/> | 81 <when value='ice'> |
82 | 82 <param argument="--iterNum" name="iterNum" type="integer" optional="true" value="500" |
83 <param argument="--transCutoff" name="transCutoff" type="float" optional="true" | 83 label="Number of iterations" /> |
84 label="Trans region cutoff" value="" | 84 |
85 help="Clip high counts in the top -transcut trans regions (i.e. between chromosomes). A usual value is 0.05."/> | 85 <param argument="--inflationCutoff" name="inflationCutoff" type="float" optional="true" |
86 | 86 label="Inflation cutoff" value="" |
87 <param argument="--sequencedCountCutoff" name="sequencedCountCutoff" optional="true" type="float" | 87 help="Value corresponding to the maximum number of times a bin can be scaled up during the iterative correction. |
88 label="Sequenced count cutoff" | 88 For example, a inflationCutoff of 3 will filter out all bins that were expanded 3 times or more during the iterative correction."/> |
89 help="Each bin receives a value indicating the fraction that is covered by reads. | 89 |
90 A cutoff of 0.5 will discard all those bins that have less than half of the bin covered."/> | 90 <param argument="--transCutoff" name="transCutoff" type="float" optional="true" |
91 | 91 label="Trans region cutoff" value="" |
92 <param argument="--skipDiagonal" name="skipDiagonal" type="boolean" truevalue="--skipDiagonal" falsevalue="" checked="false" | 92 help="Clip high counts in the top -transcut trans regions (i.e. between chromosomes). A usual value is 0.05."/> |
93 label="Skip diagonal counts"/> | 93 |
94 | 94 <param argument="--sequencedCountCutoff" name="sequencedCountCutoff" optional="true" type="float" |
95 <param argument="--perchr" name="perchr" type="boolean" truevalue="--perchr" falsevalue="" checked="false" | 95 label="Sequenced count cutoff" |
96 label="Normalize each chromosome separately" /> | 96 help="Each bin receives a value indicating the fraction that is covered by reads. |
97 <expand macro="filterThreshold" /> | 97 A cutoff of 0.5 will discard all those bins that have less than half of the bin covered."/> |
98 <param name='outputFormat' type='select' label="Output file format"> | 98 |
99 <option value='h5'>HiCExplorer format</option> | 99 <param argument="--skipDiagonal" name="skipDiagonal" type="boolean" truevalue="--skipDiagonal" falsevalue="" checked="false" |
100 <option value="cool">cool</option> | 100 label="Skip diagonal counts"/> |
101 </param> | 101 |
102 <param argument="--perchr" name="perchr" type="boolean" truevalue="--perchr" falsevalue="" checked="false" | |
103 label="Normalize each chromosome separately" /> | |
104 <expand macro="filterThreshold" /> | |
105 </when> | |
106 <when value='kr'> | |
107 </when> | |
108 </conditional> | |
102 </when> | 109 </when> |
103 </conditional> | 110 </conditional> |
104 | 111 |
105 <repeat name="chromosomes" min="0" | 112 <repeat name="chromosomes" min="0" |
106 title="Include chromosomes" help="List of chromosomes to be included in the iterative correction. | 113 title="Include chromosomes" help="List of chromosomes to be included in the iterative correction. |
110 </param> | 117 </param> |
111 </repeat> | 118 </repeat> |
112 | 119 |
113 </inputs> | 120 </inputs> |
114 <outputs> | 121 <outputs> |
115 <data name="outFileName" from_work_dir="matrix" format="h5"> | 122 <data name="outFileName" from_work_dir="matrix" format="cool"> |
116 <change_format> | 123 <change_format> |
117 <when input="mode.outputFormat" value="cool" format="cool" /> | 124 <when input_dataset="matrix_h5_cooler" attribute="ext" value="h5" format="h5"/> |
118 </change_format> | 125 </change_format> |
119 <filter>mode['mode_selector'] == "correct"</filter> | 126 <filter>mode['mode_selector'] == "correct"</filter> |
120 | 127 |
121 </data> | 128 </data> |
122 | 129 |
128 <tests> | 135 <tests> |
129 <test> | 136 <test> |
130 <param name="matrix_h5_cooler" value="small_test_matrix.h5"/> | 137 <param name="matrix_h5_cooler" value="small_test_matrix.h5"/> |
131 | 138 |
132 <param name="mode_selector" value="correct"/> | 139 <param name="mode_selector" value="correct"/> |
140 <param name='correctionMethod_selector' value='ice'/> | |
133 <repeat name="chromosomes"> | 141 <repeat name="chromosomes"> |
134 <param name="chromosome" value="chrUextra"/> | 142 <param name="chromosome" value="chrUextra"/> |
135 </repeat> | 143 </repeat> |
136 <repeat name="chromosomes"> | 144 <repeat name="chromosomes"> |
137 <param name="chromosome" value="chr3LHet"/> | 145 <param name="chromosome" value="chr3LHet"/> |
138 </repeat> | 146 </repeat> |
139 <param name='outputFormat' value='h5'/> | |
140 <param name='filterThreshold_low' value='-2.0' /> | 147 <param name='filterThreshold_low' value='-2.0' /> |
141 <param name='filterThreshold_large' value='4' /> | 148 <param name='filterThreshold_large' value='4' /> |
142 <output name="outFileName" file="hicCorrectMatrix_result1.npz.h5" ftype="h5" compare="sim_size"/> | 149 <output name="outFileName" ftype="h5"> |
150 <assert_contents> | |
151 <has_h5_keys keys='correction_factors,intervals,matrix,nan_bins'/> | |
152 </assert_contents> | |
153 </output> | |
154 </test> | |
155 <test> | |
156 <param name="matrix_h5_cooler" value="small_test_matrix.h5"/> | |
157 | |
158 <param name="mode_selector" value="correct"/> | |
159 <param name='correctionMethod_selector' value='kr'/> | |
160 | |
161 <output name="outFileName" ftype="h5"> | |
162 <assert_contents> | |
163 <has_h5_keys keys='correction_factors,intervals,matrix'/> | |
164 </assert_contents> | |
165 </output> | |
166 </test> | |
167 <test> | |
168 <param name="matrix_h5_cooler" value="small_test_matrix.cool"/> | |
169 | |
170 <param name="mode_selector" value="correct"/> | |
171 <param name='correctionMethod_selector' value='kr'/> | |
172 | |
173 <output name="outFileName" ftype="cool"> | |
174 <assert_contents> | |
175 <has_h5_keys keys='bins,chroms,indexes,pixels'/> | |
176 </assert_contents> | |
177 </output> | |
178 </test> | |
179 <test> | |
180 <param name="matrix_h5_cooler" value="small_test_matrix.h5"/> | |
181 | |
182 <param name="mode_selector" value="correct"/> | |
183 <param name='correctionMethod_selector' value='ice'/> | |
184 <repeat name="chromosomes"> | |
185 <param name="chromosome" value="chrUextra"/> | |
186 </repeat> | |
187 <repeat name="chromosomes"> | |
188 <param name="chromosome" value="chr3LHet"/> | |
189 </repeat> | |
190 <param name='filterThreshold_low' value='-2.0' /> | |
191 <param name='filterThreshold_large' value='4' /> | |
192 <output name="outFileName" ftype="h5"> | |
193 <assert_contents> | |
194 <has_h5_keys keys='correction_factors,intervals,matrix,nan_bins'/> | |
195 </assert_contents> | |
196 </output> | |
143 </test> | 197 </test> |
144 <test> | 198 <test> |
145 <param name="matrix_h5_cooler" value="small_test_matrix.h5"/> | 199 <param name="matrix_h5_cooler" value="small_test_matrix.h5"/> |
146 <param name="mode_selector" value="diagnostic_plot"/> | 200 <param name="mode_selector" value="diagnostic_plot"/> |
147 <repeat name="chromosomes"> | 201 <repeat name="chromosomes"> |
148 <param name="chromosome" value="chrUextra"/> | 202 <param name="chromosome" value="chrUextra"/> |
149 </repeat> | 203 </repeat> |
150 <repeat name="chromosomes"> | 204 <repeat name="chromosomes"> |
151 <param name="chromosome" value="chr3LHet"/> | 205 <param name="chromosome" value="chr3LHet"/> |
152 </repeat> | 206 </repeat> |
153 <output name="diagnostic_plot" file="diagnostic_plot.png" ftype="png" compare="sim_size"/> | 207 <output name="diagnostic_plot" file="hicCorrectMatrix/diagnostic_plot.png" ftype="png" compare="sim_size"/> |
154 </test> | 208 </test> |
155 </tests> | 209 </tests> |
156 <help><![CDATA[ | 210 <help><![CDATA[ |
157 | 211 |
158 Hi-C contact matrix correction | 212 Hi-C contact matrix correction |
209 On the example plot above, a user can then use the lower threshold defined by the Median Absolute Deviation (MAD) method (black bold bar), or define its own threshold based on the contacts distribution. | 263 On the example plot above, a user can then use the lower threshold defined by the Median Absolute Deviation (MAD) method (black bold bar), or define its own threshold based on the contacts distribution. |
210 | 264 |
211 Correct | 265 Correct |
212 _______ | 266 _______ |
213 | 267 |
214 Run the iterative correction and outputs the corrected matrix. This matrix can then be used with all downstream analysis tools such as ``hicPlotMatrix``, ``hicPlotTADs``, ``hicPlotViewpoint``, ``hicAggregateContacts`` for **visualization of Hi-C data**, ``hicCorrelate``, ``hicPlotDistVsCounts``, ``hicTransform``, ``hicFindTADs``, ``hicPCA`` **for data and scores computation on Hi-C data**. | 268 Run the iterative correction and outputs the corrected matrix. This matrix can then be used with all downstream analysis tools such as ``hicPlotMatrix``, ``pyGenomeTracks``, ``hicPlotViewpoint``, ``hicAggregateContacts`` for **visualization of Hi-C data**, ``hicCorrelate``, ``hicPlotDistVsCounts``, ``hicTransform``, ``hicFindTADs``, ``hicPCA`` **for data and scores computation on Hi-C data**. |
215 | 269 |
216 It is noteworthy that ``hicSumMatrices`` and ``hicMergeMatrixBins`` **must be performed on uncorrected matrices**. | 270 It is noteworthy that ``hicSumMatrices`` and ``hicMergeMatrixBins`` **must be performed on uncorrected matrices**. |
217 | 271 |
218 _________________ | 272 _________________ |
219 | 273 |