Skip to content

Commit

Permalink
hiccorrectmatrix: is writing to input file (#4670)
Browse files Browse the repository at this point in the history
* hiccorrectmatrix: is wrinting to input file

so we need to copy it

* skip from_workdir

* fix URLs

* workaround for a bug regarding parallel processing

that will be fixed in 3.7

* add missing options to CLI

see #4085

* more fixes:

- redundant name and argument
- 1 wrong parameter name in test
- 1 wrong option value and one missing option text

* fix duplicated output labels
  • Loading branch information
bernt-matthias authored Jan 10, 2023
1 parent 29fe525 commit fa140a9
Show file tree
Hide file tree
Showing 12 changed files with 42 additions and 38 deletions.
4 changes: 2 additions & 2 deletions tools/hicexplorer/hicAggregateContacts.xml
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,10 @@
<collection name="matrix_values" type="list" label="${tool.name} on ${on_string}: Matrix values">
<discover_datasets pattern="matrix_values_(?P&lt;designation&gt;.*)\..*" directory="./" format="tabular" />
</collection>
<collection name="contact_positions" type="list" label="${tool.name} on ${on_string}: Matrix values">
<collection name="contact_positions" type="list" label="${tool.name} on ${on_string}: Contact positions">
<discover_datasets pattern="contact_positions_(?P&lt;designation&gt;.*)\..*" directory="./" format="tabular" />
</collection>
<collection name="heatmap" type="list" label="${tool.name} on ${on_string}: Matrix values">
<collection name="heatmap" type="list" label="${tool.name} on ${on_string}: Heatmap">
<discover_datasets pattern="heatmap_(?P&lt;designation&gt;.*)\..*" directory="./" format="tabular" />
</collection>
<data name="matrix_obs_exp_output" from_work_dir="matrix" format="h5" label="${tool.name} MATRIX on ${on_string}">
Expand Down
25 changes: 14 additions & 11 deletions tools/hicexplorer/hicConvertFormat.xml
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,8 @@
--outputFormat $outputSingleMultiple_conditional.outputFormat_conditional.outputFormat_selector
--outFileName 'matrix.$outputSingleMultiple_conditional.outputFormat_conditional.outputFormat_selector'
#if $outputSingleMultiple_conditional.outputFormat_conditional.outputFormat_selector == 'ginteractions':
&& mv 'matrix.${outputSingleMultiple_conditional.outputFormat_conditional.outputFormat_selector}.tsv' matrix_out
#else:
&& mv 'matrix.$outputSingleMultiple_conditional.outputFormat_conditional.outputFormat_selector' matrix_out
#end if
#end if
### Set up links to matrices to have correct ending
#if $outputSingleMultiple_conditional.outputSingleMultiple_selector == 'multipleMatrix':
#else if $outputSingleMultiple_conditional.outputSingleMultiple_selector == 'multipleMatrix':
#if $outputSingleMultiple_conditional.resolutionOrManyToOne_conditional.resolutionOrManyToOne_selector == 'resolution_option':
#set xml_path = $outputSingleMultiple_conditional.resolutionOrManyToOne_conditional.inputFormat_conditional
#if $xml_path.inputFormat_selector == 'optionCool':
Expand Down Expand Up @@ -206,6 +198,17 @@
--matrices $m
#end if
--outFileName matrix.mcool
#end if
$storeAppliedCorrection
$enforceInteger
#if $outputSingleMultiple_conditional.outputSingleMultiple_selector == 'singleMatrix':
#if $outputSingleMultiple_conditional.outputFormat_conditional.outputFormat_selector == 'ginteractions':
&& mv 'matrix.${outputSingleMultiple_conditional.outputFormat_conditional.outputFormat_selector}.tsv' matrix_out
#else:
&& mv 'matrix.$outputSingleMultiple_conditional.outputFormat_conditional.outputFormat_selector' matrix_out
#end if
#else if $outputSingleMultiple_conditional.outputSingleMultiple_selector == 'multipleMatrix':
&& mv matrix.mcool matrix_out
#end if
]]>
Expand Down Expand Up @@ -237,10 +240,10 @@
<expand macro='convertFormat_multiple_macro' />
</when>
</conditional>
<param name='storeAppliedCorrection' type="boolean" truevalue="yes" falsevalue="" label='Store applied correction factors in column count' />
<param name='enforceInteger' type="boolean" truevalue="yes" falsevalue="" label='Enforce integer for count column' />
</when>
</conditional>
<param name='storeAppliedCorrection' type="boolean" truevalue="--store_applied_correction" falsevalue="" label="Store applied correction factors in column count" help="Option only for cool input files" />
<param name='enforceInteger' type="boolean" truevalue="--enforce_integer" falsevalue="" label="Enforce integer for count column" help="Option only for cool input files" />
</inputs>
<outputs>
<data name='output_converted_matrix' from_work_dir='matrix_out' format='cool' label='Converted matrix'>
Expand Down
22 changes: 11 additions & 11 deletions tools/hicexplorer/hicCorrectMatrix.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</macros>
<expand macro="requirements" />
<command detect_errors="exit_code"><![CDATA[
ln -s '$matrix_h5_cooler' 'matrix.$matrix_h5_cooler.ext' &&
cp '$matrix_h5_cooler' 'matrix.$matrix_h5_cooler.ext' &&
@BINARY@
$mode.mode_selector
Expand Down Expand Up @@ -55,7 +55,7 @@
$mode.perchr
#end if
#if $mode.mode_selector == 'correct':
&& mv matrix.$matrix_h5_cooler.ext matrix
&& mv matrix.$matrix_h5_cooler.ext '$outFileName'
#end if
]]>
</command>
Expand All @@ -68,7 +68,7 @@
</param>
<when value="diagnostic_plot">
<expand macro="xMax" />
<param argument="--perchr" name="perchr" type="boolean" truevalue="--perchr" falsevalue="" checked="false" label="Compute statistics for each chromosome separately" />
<param argument="--perchr" type="boolean" truevalue="--perchr" falsevalue="" checked="false" label="Compute statistics for each chromosome separately" />
</when>
<when value="correct">
<conditional name='correctionMethod'>
Expand All @@ -78,19 +78,19 @@
</param>

<when value='ice'>
<param argument="--iterNum" name="iterNum" type="integer" optional="true" value="500" label="Number of iterations" />
<param argument="--iterNum" type="integer" optional="true" value="500" label="Number of iterations" />

<param argument="--inflationCutoff" name="inflationCutoff" type="float" optional="true" label="Inflation cutoff" value="" help="Value corresponding to the maximum number of times a bin can be scaled up during the iterative correction.
<param argument="--inflationCutoff" type="float" optional="true" label="Inflation cutoff" value="" help="Value corresponding to the maximum number of times a bin can be scaled up during the iterative correction.
For example, a inflationCutoff of 3 will filter out all bins that were expanded 3 times or more during the iterative correction." />

<param argument="--transCutoff" name="transCutoff" type="float" optional="true" label="Trans region cutoff" value="" help="Clip high counts in the top -transcut trans regions (i.e. between chromosomes). A usual value is 0.05." />
<param argument="--transCutoff" type="float" optional="true" label="Trans region cutoff" value="" help="Clip high counts in the top -transcut trans regions (i.e. between chromosomes). A usual value is 0.05." />

<param argument="--sequencedCountCutoff" name="sequencedCountCutoff" optional="true" type="float" label="Sequenced count cutoff" help="Each bin receives a value indicating the fraction that is covered by reads.
<param argument="--sequencedCountCutoff" optional="true" type="float" label="Sequenced count cutoff" help="Each bin receives a value indicating the fraction that is covered by reads.
A cutoff of 0.5 will discard all those bins that have less than half of the bin covered." />

<param argument="--skipDiagonal" name="skipDiagonal" type="boolean" truevalue="--skipDiagonal" falsevalue="" checked="false" label="Skip diagonal counts" />
<param argument="--skipDiagonal" type="boolean" truevalue="--skipDiagonal" falsevalue="" checked="false" label="Skip diagonal counts" />

<param argument="--perchr" name="perchr" type="boolean" truevalue="--perchr" falsevalue="" checked="false" label="Normalize each chromosome separately" />
<param argument="--perchr" type="boolean" truevalue="--perchr" falsevalue="" checked="false" label="Normalize each chromosome separately" />
<expand macro="filterThreshold" />
</when>
<when value='kr'>
Expand All @@ -108,13 +108,13 @@

</inputs>
<outputs>
<data name="outFileName" from_work_dir="matrix" format="cool">
<data name="outFileName" format="cool">
<change_format>
<when input_dataset="matrix_h5_cooler" attribute="ext" value="h5" format="h5" />
</change_format>
<filter>mode['mode_selector'] == "correct"</filter>
</data>
<data name="diagnostic_plot" from_work_dir="diagnostic_plot.png" format="png">
<data name="diagnostic_plot" from_work_dir="diagnostic_plot.png" format="png" label="${tool.name} on ${on_string}: Diagnostic plot">
<filter>mode['mode_selector'] == "diagnostic_plot"</filter>
</data>
</outputs>
Expand Down
4 changes: 2 additions & 2 deletions tools/hicexplorer/hicCorrelate.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@
<expand macro="colormap" />
</inputs>
<outputs> <!-- not sure if argument is specifiable for output yet, would be cool if so -->
<data name="outFileNameHeatmap" from_work_dir="heatmap.png" format="png" />
<data name="outFileNameScatter" from_work_dir="scatter.png" format="png" />
<data name="outFileNameHeatmap" from_work_dir="heatmap.png" format="png" label="${tool.name} on ${on_string}: Heatmap"/>
<data name="outFileNameScatter" from_work_dir="scatter.png" format="png" label="${tool.name} on ${on_string}: Scatter plot"/>
</outputs>
<tests>
<test>
Expand Down
2 changes: 1 addition & 1 deletion tools/hicexplorer/hicDetectLoops.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
<param argument="--expected" type="select" label="Method to compute the expected value">
<option value="mean" selected="True">mean</option>
<option value="mean_nonzero">mean_nonzero</option>
<option value="mean_nonzero">mean_nonzero_ligation</option>
<option value="mean_nonzero_ligation">mean_nonzero_ligation</option>
</param>
</inputs>
<outputs>
Expand Down
3 changes: 2 additions & 1 deletion tools/hicexplorer/hicDifferentialTAD.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@
<param name="mode_selector" value="all" />
<param name="modeReject" value="one" />
<output name="acceptedTADs" file="hicDifferentialTAD/accepted.txt" ftype="txt" />
<output name="rejectedTADs" file="hicDifferentialTAD/rejected.txt" ftype="txt" />
<!-- TODO remove lines_diff when updating to >=3.7 where" a multicore issue was solved that led to skipping data at the start and end of chromosomes-->
<output name="rejectedTADs" file="hicDifferentialTAD/rejected.txt" ftype="txt" lines_diff="4"/>
</test>
</tests>
<help><![CDATA[
Expand Down
2 changes: 1 addition & 1 deletion tools/hicexplorer/hicNormalize.xml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ _________________
| For more information about HiCExplorer please consider our documentation on readthedocs.io_
.. _readthedocs.io: http://hicexplorer.readthedocs.io/en/latest/index.html
.. _`Lieberman-Aiden et al. (2009)`: https://doi.org/10.1126%2Fscience.1181369
.. _`Lieberman-Aiden et al. (2009)`: https://doi.org/10.1126/science.1181369
]]> </help>
<expand macro="citations" />
</tool>
8 changes: 4 additions & 4 deletions tools/hicexplorer/hicPCA.xml
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,13 @@
</change_format>
</data>

<data name="pearson_outfile" from_work_dir="pearson" format="cool">
<data name="pearson_outfile" from_work_dir="pearson" format="cool" label="${tool.name} on ${on_string}: Pearson matrix">
<filter>pearsonMatrix</filter>
<change_format>
<when input_dataset="matrix_h5_cooler" attribute="ext" value="h5" format="h5" />
<when input_dataset="matrix_h5_cooler" attribute="ext" value="h5" format="h5"/>
</change_format>
</data>
<data name="obsexp_outfile" from_work_dir="obsexp" format="cool">
<data name="obsexp_outfile" from_work_dir="obsexp" format="cool" label="${tool.name} on ${on_string}: observed / expected matrix">
<filter>obsexpMatrix</filter>
<change_format>
<when input_dataset="matrix_h5_cooler" attribute="ext" value="h5" format="h5" />
Expand Down Expand Up @@ -228,7 +228,7 @@ _________________
| For more information about HiCExplorer please consider our documentation on readthedocs.io_
.. _readthedocs.io: http://hicexplorer.readthedocs.io/en/latest/index.html
.. _`Lieberman-Aiden et al. (2009)`: https://doi.org/10.1126%2Fscience.1181369
.. _`Lieberman-Aiden et al. (2009)`: https://doi.org/10.1126/science.1181369
]]> </help>
<expand macro="citations" />
</tool>
2 changes: 1 addition & 1 deletion tools/hicexplorer/hicPlotMatrix.xml
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@

<conditional name="pca_conditional">
<param name='pca_type' label='Datatype of eigenvector file' type='select'>
<option value='' selected="true"></option>
<option value='' selected="true">None</option>
<option value='bigwig'>bigwig</option>
</param>
<when value='' />
Expand Down
2 changes: 1 addition & 1 deletion tools/hicexplorer/hicPlotSVL.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
<param name="matrix_h5_cooler_multiple" value="small_test_matrix.h5,small_test_matrix.h5" />
<param name="distance" value="2000000" />
<param name="dpi" value="10" />
<param name="color" value="y m c" />
<param name="colorList" value="y m c" />
<repeat name="chromosome_list">
<param name="chromosomes" value="chr2L" />
</repeat>
Expand Down
2 changes: 1 addition & 1 deletion tools/hicexplorer/hicTransform.xml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ _________________
| For more information about HiCExplorer please consider our documentation on readthedocs.io_
.. _readthedocs.io: http://hicexplorer.readthedocs.io/en/latest/index.html
.. _`Lieberman-Aiden et al. (2009)`: https://doi.org/10.1126%2Fscience.1181369
.. _`Lieberman-Aiden et al. (2009)`: https://doi.org/10.1126/science.1181369
]]> </help>
<expand macro="citations" />
</tool>
4 changes: 2 additions & 2 deletions tools/hicexplorer/macros.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<macros>
<token name="@THREADS@">\${GALAXY_SLOTS:-4}</token>
<token name="@TOOL_VERSION@">3.6</token>
<token name="@VERSION_SUFFIX@">0</token>
<token name="@VERSION_SUFFIX@">1</token>
<token name="@USE_RANGE@">
#if $use_range.select_use_range == "yes_use_range":
--range $use_range.range_min:$use_range.range_max
Expand Down Expand Up @@ -333,7 +333,7 @@
<param name="scaleFactor2" type="float" value="1" label="Scale factor for input" help="(--scaleFactors)" />
</xml>
<xml name="xMax">
<param argument="--xMax" name="xMax" type="integer" optional="true" value="" label="Max value for the x-axis in counts per bin" />
<param argument="--xMax" type="integer" optional="true" value="" label="Max value for the x-axis in counts per bin" />
</xml>
<xml name="filterThreshold">
<param argument="--filterThreshold" name="filterThreshold_low" type="float" value="-1.5" label="Remove bins of low coverage" help="e.g. -1.5; Both Thresholds needs to be set to take effect." />
Expand Down

0 comments on commit fa140a9

Please sign in to comment.