Mercurial > repos > bgruening > hicexplorer_hiccorrectmatrix
changeset 0:aa854293da07 draft
planemo upload for repository https://github.com/maxplanck-ie/HiCExplorer/tree/master/galaxy/wrapper/ commit 6a4d8b48a6504eacbb9ed7228f77117fa759286d-dirty
author | bgruening |
---|---|
date | Sun, 09 Oct 2016 17:35:21 -0400 |
parents | |
children | c041d564e6cc |
files | _hicExport._xml hicCorrectMatrix.xml hicFindEnrichedContacts.xml macros.xml |
diffstat | 3 files changed, 780 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/_hicExport._xml Sun Oct 09 17:35:21 2016 -0400 @@ -0,0 +1,55 @@ +<tool id="hicExport" name="hicExport" version="1.0"> + <description>saves a HiC Matrix in text format</description> + <macros> + <token name="@BINARY@">hicExport</token> + <import>macros.xml</import> + </macros> + <expand macro="requirements" /> + <command><![CDATA[ + hicExport + #if $matrix and $matrix is not None: + --matrix $matrix + #end if + --outputFormat $outputFormat + $clearMaskedBins + --outFileName $output + + ]]></command> + <inputs> + <param label="Matrix to use" name="matrix" type="data" help="(--matrix)" /> + <param label="Output format" name="outputFormat" type="select" + help="There are two possibilities: "dekker" and "ren". + The dekker format outputs the whole matrix where the first column and first row are the bin widths and labels. + The "ren" format is a list of tuples of the form chrom, bin_star, bin_end, values. (--outputFormat)"> + <option selected="true" value="dekker">Dekker (first column and first rows are labels)</option> + <option value="ren">Ren (chrom, bin_star, bin_end, values)</option> + </param> + <param name="clearMaskedBins" type="boolean" truevalue="--clearMaskedBins" falsevalue="" label="If set, masked bins are removed from the matrix" + help="Masked bins are those that do not have any values, mainly because they are repetitive regions of the genome (--clearMaskedBins)" /> + </inputs> + <outputs> + <data format="txt" name="output"/> + </outputs> + <tests> + <test> + <param name="matrix" value="hicBuildMatrix_result1.npz"/> + <param name="outputFormat" value="dekker"/> + <output name="output" file="hicExport_result1.txt" ftpye="txt"/> + </test> + <test> + <param name="matrix" value="hicBuildMatrix_result1.npz"/> + <param name="outputFormat" value="ren"/> + <param name="clearMaskedBins" value="True"/> + <output name="output" file="hicExport_result2.txt" ftpye="txt"/> + </test> + </tests> + <help><![CDATA[ + +**What it does** + +Saves a HiC Matrix in text format + + ]]></help> + <expand macro="citations" /> +</tool> +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hicCorrectMatrix.xml Sun Oct 09 17:35:21 2016 -0400 @@ -0,0 +1,184 @@ +<tool id="hicexplorer_hiccorrectmatrix" name="@BINARY@" version="@WRAPPER_VERSION@.0"> + <description>Runs Dekker's iterative correction over a hic matrix.</description> + <macros> + <token name="@BINARY@">hicCorrectMatrix</token> + <import>macros.xml</import> + </macros> + <expand macro="requirements" /> + <command> +<![CDATA[ + ln -s '$matrix' temp_matrix.npz.h5 && + + hicCorrectMatrix + $mode.mode_selector + --matrix temp_matrix.npz.h5 + + ## special: --chromosomes is optional, but if given needs at least one argument + #set chroms = '" "'.join([ str($var.chromosome) for $var in $chromosomes ]) + #if chroms + --chromosomes "$chroms" + #end if + + #if $mode.mode_selector == 'correct': + + --iterNum $mode.iterNum + --outFileName corrected_matrix.npz.h5 + + #if $mode.filterThreshold_low and $mode.filterThreshold_large: + --filterThreshold $mode.filterThreshold_low $mode.filterThreshold_large + #end if + + #if $mode.inflationCutoff: + --inflationCutoff $mode.inflationCutoff + #end if + + #if $mode.transCutoff: + --transCutoff $mode.transCutoff + #end if + + #if $mode.sequencedCountCutoff: + --sequencedCountCutoff $mode.sequencedCountCutoff + #end if + + $mode.skipDiagonal + $mode.perchr + + #elif $mode.mode_selector == 'merge_failed': + --plotName diagnostic_plot.png + --outMatrixFile corrected_matrix.npz.h5 + #if $mode.xMax: + --xMax $mode.xMax + #end if + #if $mode.filterThreshold_low and $mode.filterThreshold_large: + --filterThreshold $mode.filterThreshold_low $mode.filterThreshold_large + #end if + #else: + --plotName diagnostic_plot.png + #if $mode.xMax: + --xMax $mode.xMax + #end if + #end if + +]]> + </command> + <inputs> + <param argument="--matrix" name="matrix" type="data" format="h5" + label="Hi-C matrix" /> + + <conditional name="mode"> + <param name="mode_selector" type="select" label="Range restriction (in bp)" argument="--range"> + <option value="diagnostic_plot">Diagnostic plot</option> + <option value="correct">Correct matrix</option> + <option value="merge_failed">Merges together failed bins</option> + </param> + <when value="diagnostic_plot"> + <expand macro="xMax" /> + </when> + <when value="correct"> + <param argument="--iterNum" name="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. + 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="--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. + 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="--perchr" name="perchr" type="boolean" truevalue="--perchr" falsevalue="" checked="false" + label="Normalize each chromosome separately" /> + <expand macro="filterThreshold" /> + + </when> + <when value="merge_failed"> + <expand macro="filterThreshold" /> + <expand macro="xMax" /> + </when> + </conditional> + + <repeat name="chromosomes" min="1" + title="Include chromosomes" help="List of chromosomes to be included in the iterative correction. + The order of the given chromosomes will be kept for the resulting corrected matrix"> + <param name="chromosome" type="text" value="" /> + </repeat> + + </inputs> + <outputs> + <data name="outFileName" from_work_dir="corrected_matrix.npz.h5" format="h5"> + <filter>mode['mode_selector'] == "correct" or mode['mode_selector'] == "merge_failed"</filter> + </data> + <data name="diagnostic_plot" from_work_dir="diagnostic_plot.png" format="png"> + <filter>mode['mode_selector'] == "diagnostic_plot" or mode['mode_selector'] == "merge_failed"</filter> + </data> + </outputs> + <tests> + <test> + <param name="matrix" value="hicBuildMatrix_result1.npz.h5" ftype="h5"/> + <param name="mode_selector" value="correct"/> + <repeat name="chromosomes"> + <param name="chromosome" value="chrUextra"/> + </repeat> + <repeat name="chromosomes"> + <param name="chromosome" value="chr3LHet"/> + </repeat> + <output name="outFileName" file="hicCorrectMatrix_result1.npz.h5" ftype="h5" compare="sim_size"/> + </test> + <test> + <param name="matrix" ftype="h5" value="hicBuildMatrix_result1.npz.h5"/> + <param name="mode_selector" value="diagnostic_plot"/> + <repeat name="chromosomes"> + <param name="chromosome" value="chrUextra"/> + </repeat> + <repeat name="chromosomes"> + <param name="chromosome" value="chr3LHet"/> + </repeat> + <output name="diagnostic_plot" file="diagnostic_plot.png" ftype="png" compare="sim_size"/> + </test> + <test> + <param name="matrix" ftype="h5" value="hicBuildMatrix_result1.npz.h5"/> + <param name="mode_selector" value="merge_failed"/> + <repeat name="chromosomes"> + <param name="chromosome" value="chrUextra"/> + </repeat> + <repeat name="chromosomes"> + <param name="chromosome" value="chr3LHet"/> + </repeat> + <output name="diagnostic_plot" file="diagnostic_plot.png" ftype="png" compare="sim_size"/> + <output name="outMatrixFile" file="merged_matrix.npz.h5" ftype="h5" compare="sim_size"/> + </test> + </tests> + <help><![CDATA[ + +**What it does** + +Runs Dekker's iterative correction over a hic matrix. + + + correct Run the iterative correction. + diagnostic_plot + Plots a histogram of the coverage per bin together with the + modified z-score based on the median absolute deviation + method (see Boris Iglewicz and David Hoaglin 1993, Volume + 16: How to Detect and Handle Outliers The ASQC Basic + References in Quality Control: Statistical Techniques, + Edward F. Mykytka, Ph.D., Editor. + merge_failed Merges together failed bins to rescue some of the + information instead of discarding it. This option is mostly + useful with processing small restrition fragment size bins + + + +]]></help> + <expand macro="citations" /> +</tool> +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/macros.xml Sun Oct 09 17:35:21 2016 -0400 @@ -0,0 +1,541 @@ +<macros> + <xml name="stdio"> + <stdio> + <exit_code range="1:" /> + <exit_code range=":-1" /> + <regex match="Error:" /> + <regex match="Exception:" /> + <regex match="EXception:" /> + <regex match="Traceback" /> + </stdio> + </xml> + + <token name="@THREADS@">--numberOfProcessors "\${GALAXY_SLOTS:-4}"</token> + <token name="@WRAPPER_VERSION@">1.2</token> + <xml name="requirements"> + <requirements> + <requirement type="package" version="@WRAPPER_VERSION@">hicexplorer</requirement> + <yield /> + </requirements> + <expand macro="stdio" /> + <version_command>@BINARY@ --version</version_command> + </xml> + + <xml name="citations"> + <citations> + <citation type="doi">10.5281/zenodo.159780</citation> + <yield /> + </citations> + </xml> + + <xml name="zMax"> + <param argument="--zMax" name="zMax" type="float" optional="true" label="zMax for 3D plot"/> <!-- this should only be enabled when both or 3d is selected for param whatToShow --> + </xml> + + <xml name="colormap"> + <param argument="--colorMap" type="select" label="Color map to use for the heatmap" help=" Available color map names can be found here: http://www.astro.lsa.umich.edu/~msshin/science/code/matplotlib_cm/"> + <option value="RdYlBu" selected="true">RdYlBu</option> + <option value="Accent">Accent</option> + <option value="Spectral">Spectral</option> + <option value="Set1">Set1</option> + <option value="Set2">Set2</option> + <option value="Set3">Set3</option> + <option value="Dark2">Dark2</option> + <option value="Reds">Reds</option> + <option value="Oranges">Oranges</option> + <option value="Greens">Greens</option> + <option value="Blues">Blues</option> + <option value="Greys">Greys</option> + <option value="Purples">Purples</option> + <option value="Paired">Paired</option> + <option value="Pastel1">Pastel1</option> + <option value="Pastel2">Pastel2</option> + <option value="spring">spring</option> + <option value="summer">summer</option> + <option value="autumn">autumn</option> + <option value="winter">winter</option> + <option value="hot">hot</option> + <option value="coolwarm">coolwarm</option> + <option value="cool">cool</option> + <option value="seismic">seismic</option> + <option value="terrain">terrain</option> + <option value="ocean">ocean</option> + <option value="rainbow">rainbow</option> + <option value="bone">bone</option> + <option value="flag">flag</option> + <option value="prism">prism</option> + <option value="cubehelix">cubehelix</option> + <option value="binary">binary</option> + <option value="pink">pink</option> + <option value="gray">gray</option> + <option value="copper">copper</option> + <option value="BrBG">BrBG</option> + <option value="BuGn">BuGn</option> + <option value="BuPu">BuPu</option> + <option value="GnBu">GnBu</option> + <option value="OrRd">OrRd</option> + <option value="PiYG">PiYG</option> + <option value="PRGn">PRGn</option> + <option value="PuOr">PuOr</option> + <option value="PuRd">PuRd</option> + <option value="PuBu">PuBu</option> + <option value="RdBu">RdBu</option> + <option value="RdGy">RdGy</option> + <option value="RdPu">RdPu</option> + <option value="YlGn">YlGn</option> + <option value="PuBuGn">PuBuGn</option> + <option value="RdYlGn">RdYlGn</option> + <option value="YlGnBu">YlGnBu</option> + <option value="YlOrBr">YlOrBr</option> + <option value="YlOrRd">YlOrRd</option> + <option value="gist_gray">gist_gray</option> + <option value="gist_stern">gist_stern</option> + <option value="gist_earth">gist_earth</option> + <option value="gist_yarg">gist_yarg</option> + <option value="gist_ncar">gist_ncar</option> + <option value="gist_rainbow">gist_rainbow</option> + <option value="gist_heat">gist_heat</option> + <option value="gnuplot">gnuplot</option> + <option value="gnuplot2">gnuplot2</option> + <option value="CMRmap">CMRmap</option> + <option value="bwr">bwr</option> + <option value="hsv">hsv</option> + <option value="brg">brg</option> + <option value="jet">jet</option> + <option value="afmhot">afmhot</option> + <option value="Accent_r">Accent reversed</option> + <option value="Spectral_r">Spectral reversed</option> + <option value="Set1_r">Set1 reversed</option> + <option value="Set2_r">Set2 reversed</option> + <option value="Set3_r">Set3 reversed</option> + <option value="Dark2_r">Dark2 reversed</option> + <option value="Reds_r">Reds reversed</option> + <option value="Oranges_r">Oranges reversed</option> + <option value="Greens_r">Greens reversed</option> + <option value="Blues_r">Blues reversed</option> + <option value="Greys_r">Greys reversed</option> + <option value="Purples_r">Purples reversed</option> + <option value="Paired_r">Paired reversed</option> + <option value="Pastel1_r">Pastel1 reversed</option> + <option value="Pastel2_r">Pastel2 reversed</option> + <option value="spring_r">spring reversed</option> + <option value="summer_r">summer reversed</option> + <option value="autumn_r">autumn reversed</option> + <option value="winter_r">winter reversed</option> + <option value="hot_r">hot reversed</option> + <option value="coolwarm_r">coolwarm reversed</option> + <option value="cool_r">cool reversed</option> + <option value="seismic_r">seismic reversed</option> + <option value="terrain_r">terrain reversed</option> + <option value="ocean_r">ocean reversed</option> + <option value="rainbow_r">rainbow reversed</option> + <option value="bone_r">bone reversed</option> + <option value="flag_r">flag reversed</option> + <option value="prism_r">prism reversed</option> + <option value="cubehelix_r">cubehelix reversed</option> + <option value="binary_r">binary reversed</option> + <option value="pink_r">pink reversed</option> + <option value="gray_r">gray reversed</option> + <option value="copper_r">copper reversed</option> + <option value="BrBG_r">BrBG reversed</option> + <option value="BuGn_r">BuGn reversed</option> + <option value="BuPu_r">BuPu reversed</option> + <option value="GnBu_r">GnBu reversed</option> + <option value="OrRd_r">OrRd reversed</option> + <option value="PiYG_r">PiYG reversed</option> + <option value="PRGn_r">PRGn reversed</option> + <option value="PuOr_r">PuOr reversed</option> + <option value="PuRd_r">PuRd reversed</option> + <option value="PuBu_r">PuBu reversed</option> + <option value="RdBu_r">RdBu reversed</option> + <option value="RdGy_r">RdGy reversed</option> + <option value="RdPu_r">RdPu reversed</option> + <option value="YlGn_r">YlGn reversed</option> + <option value="PuBuGn_r">PuBuGn reversed</option> + <option value="RdYlBu_r">RdYlBu reversed</option> + <option value="RdYlGn_r">RdYlGn reversed</option> + <option value="YlGnBu_r">YlGnBu reversed</option> + <option value="YlOrBr_r">YlOrBr reversed</option> + <option value="YlOrRd_r">YlOrRd reversed</option> + <option value="gist_gray_r">gist_gray reversed</option> + <option value="gist_stern_r">gist_stern reversed</option> + <option value="gist_earth_r">gist_earth reversed</option> + <option value="gist_yarg_r">gist_yarg reversed</option> + <option value="gist_ncar_r">gist_ncar reversed</option> + <option value="gist_rainbow_r">gist_rainbow reversed</option> + <option value="gist_heat_r">gist_heat reversed</option> + <option value="gnuplot_r">gnuplot reversed</option> + <option value="gnuplot2_r">gnuplot2 reversed</option> + <option value="CMRmap_r">CMRmap reversed</option> + <option value="bwr_r">bwr reversed</option> + <option value="hsv_r">hsv reversed</option> + <option value="brg_r">brg reversed</option> + <option value="jet_r">jet reversed</option> + <option value="afmhot_r">afmhot reversed</option> + </param> + </xml> + + + <xml name="multiple_input_matrices"> + <repeat name="input_files" title="HiC Matrix files" min="2"> + <param name="matrix" type="data" format="h5" + label="HiC Matrix file" + help=""/> + <param name="mlabel" type="text" size="30" optional="true" value="" + label="Label" + help="Label to use in the output. If not given the dataset name will be used instead."/> + </repeat> + </xml> + + <token name="@multiple_input_matrices@"> + #set $matrices = [] + #set $mlabels = [] + #for $counter, $i in enumerate($input_files): + ln -s $i.matrix #echo str($counter)+'.npz.h5'#; + #silent $matrices.append( '%s.npz.h5' % $counter ) + + #if str($i.mlabel.value) != "": + #set $mlabels += ['"%s"' % ($i.mlabel.value)] + #else + #set $mlabels += ['"%s"' % ($i.matrix.name)] + #end if + #end for + #set $mlabels = ' '.join($mlabels) + #set $matrices = ' '.join($matrices) + </token> + + + <xml name="region"> + <param name="region" type="text" label="Region of the genome to limit the operation" + help="The format is chr:start-end. Also valid is just to specify a chromosome, for example chr10:10-500" argument="--region"/> + </xml> + + + + <xml name="kmeans_clustering"> + <conditional name="used_multiple_regions"> + <param name="used_multiple_regions_options" type="select" + label="Did you compute the matrix with more than one groups of regions?" + help="Would you like to cluster the regions according to the similarity of the signal distribution? This is only possible if you used computeMatrix on only one group of regions."> + <option value="yes">Yes, I used multiple groups of regions</option> + <option value="no">No, I used only one group</option> + </param> + <when value="no"> + <conditional name="clustering"> + <param name="clustering_options" type="select" label="Clustering algorithm"> + <option value="none">No clustering</option> + <option value="kmeans">Kmeans clustering</option> + </param> + <when value="kmeans"> + <param name="k_kmeans" type="integer" value="0" label="Number of clusters to compute" + help="When this option is set, then the matrix is split into clusters using the kmeans algorithm. Only works for data that is not grouped, otherwise only the first group will be clustered. If more specific clustering methods are required it is advisable to save the underlying matrix and run the clustering using other software. The plotting of the clustering may fail (Error: Segmentation fault) if a cluster has very few members compared to the total number or regions. (default: None)."/> + </when> + <when value="none" /> + </conditional> + </when> + <when value="yes" /> + </conditional> + </xml> + + <token name="@KMEANS_CLUSTERING@"> + #if $advancedOpt.used_multiple_regions.used_multiple_regions_options == 'no': + #if $advancedOpt.used_multiple_regions.clustering.clustering_options == 'kmeans': + #if int($advancedOpt.used_multiple_regions.clustering.k_kmeans) > 0: + --kmeans $advancedOpt.used_multiple_regions.clustering.k_kmeans + #end if + #end if + #end if + </token> + + <xml name="samFlag"> + <param name="samFlag" type="integer" optional="true" value="" + label="Filter reads based on the SAM flag" + help= "For example to get only reads that are the first mate use a flag of 64. This is useful to count properly paired reads only once, otherwise the second mate will be also considered for the coverage. (--samFlag)"/> + </xml> + <xml name="plotNumbers"> + <param name="plotNumbers" type="boolean" truevalue="--plotNumbers" falsevalue="" + label="Plot the correlation value" + help="If set, then the correlation number is plotted on top of the heatmap. (--plotNumbers)"/> + </xml> + <xml name="doNotExtendPairedEnds"> + <param name="doNotExtendPairedEnds" type="boolean" truevalue="--doNotExtendPairedEnds" falsevalue="" + label="Do not extend paired ends" + 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. (--doNotExtendPairedEnds)"/> + </xml> + + <xml name="ignoreDuplicates"> + <param name="ignoreDuplicates" type="boolean" truevalue="--ignoreDuplicates" falsevalue="" + label="Ignore duplicates" + 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. (--ignoreDuplicates)" /> + </xml> + + <xml name="minMappingQuality"> + <param argument="--minMappingQuality" type="integer" optional="true" value="1" min="1" + label="Minimum mapping quality" + 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."/> + </xml> + + <xml name="skipZeros"> + <param name="skipZeros" type="boolean" truevalue="--skipZeros" falsevalue="" + label ="Skip zeros" + 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. (--skipZeros)" /> + </xml> + + <xml name="fragmentLength"> + <param name="fragmentLength" type="integer" value="300" min="1" + label="Fragment length used for the sequencing" + help ="If paired-end reads are used, the fragment length is computed from the BAM file. (--fragmentLength)"/> + </xml> + + <xml name="scaleFactor"> + <param name="scaleFactor1" type="float" value="1" label="Scale factor for treatment" help="(--scaleFactors)"/> + <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" /> + </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."/> + + <param argument="--filterThreshold" name="filterThreshold_large" type="float" value="5.0" + label="Remove bins of large coverage" help="e.g. 5; Both Thresholds needs to be set to take effect."/> + </xml> + + + <xml name="pseudocount"> + <param name="pseudocount" type="float" value="1" label="Pseudocount" help="Small number to avoid dividing by zero."/> + </xml> + + <token name="@REFERENCES@"> + +.. class:: infomark + +For more information on the tools, please visit our `help site`_. + +If you would like to give us feedback or you run into any trouble, please send an email to deeptools@googlegroups.com + +This tool is developed by the `Bioinformatics and Deep-Sequencing Unit`_ at the `Max Planck Institute for Immunobiology and Epigenetics`_. + +.. _Bioinformatics and Deep-Sequencing Unit: http://www3.ie-freiburg.mpg.de/facilities/research-facilities/bioinformatics-and-deep-sequencing-unit/ +.. _Max Planck Institute for Immunobiology and Epigenetics: http://www3.ie-freiburg.mpg.de +.. _help site: https://github.com/fidelram/deepTools/wiki/ + + </token> + + + <xml name="multiple_input_bams"> + <repeat name="input_files" title="BAM files" min="2"> + <param name="bamfile" type="data" format="bam" + label="Bam file" + help="The BAM file must be sorted."/> + <param name="label" type="text" size="30" optional="true" value="" + label="Label" + help="Label to use in the output. If not given the dataset name will be used instead."/> + </repeat> + </xml> + + <xml name="multiple_input_bigwigs"> + <repeat name="input_files" title="BigWig files" min="2"> + <param name="bigwigfile" type="data" format="bigwig" + label="Bigwig file" + help="The Bigwig file must be sorted."/> + <param name="label" type="text" size="30" optional="true" value="" + label="Label" + help="Label to use in the output. If not given the dataset name will be used instead."/> + </repeat> + </xml> + + <xml name="plotTitle"> + <param name="plotTitle" type="text" value="" size="30" optional="True" + label="Title of the plot" + help="Title of the plot, to be printed on top of the generated image. (--plotTitle)" /> + </xml> + + <token name="@multiple_input_bams@"> + #import tempfile + #set $temp_dir = os.path.abspath(tempfile.mkdtemp()) + #set files=[] + #set labels=[] + #for $i in $input_files: + #set $temp_input_handle = tempfile.NamedTemporaryFile( dir=$temp_dir ) + #set $temp_input_path = $temp_input_handle.name + #silent $temp_input_handle.close() + #silent os.system("ln -s %s %s.bam" % (str($i.bamfile), $temp_input_path)) + #silent os.system("ln -s %s %s.bam.bai" % (str($i.bamfile.metadata.bam_index), $temp_input_path)) + #silent $files.append('%s.bam' % $temp_input_path) + + ##set $files += [str($i.bamfile)] + #if str($i.label.value) != "": + #set $labels += ["\"%s\"" % ($i.label.value)] + #else + #set $labels += ["\"%s\"" % ($i.bamfile.name)] + #end if + #end for + </token> + + <token name="@multiple_input_bigwigs@"> + #import tempfile + #set $temp_dir = os.path.abspath(tempfile.mkdtemp()) + #set files=[] + #set labels=[] + #for $i in $input_files: + #set $temp_input_handle = tempfile.NamedTemporaryFile( dir=$temp_dir ) + #set $temp_input_path = $temp_input_handle.name + #silent $temp_input_handle.close() + #silent os.system("ln -s %s %s.bw" % (str($i.bigwigfile), $temp_input_path)) + #silent $files.append('%s.bw' % $temp_input_path) + + ##set $files += [str($i.bigwigfile)] + #if str($i.label.value) != "": + #set $labels += ["\"%s\"" % ($i.label.value)] + #else + #set $labels += ["\"%s\"" % ($i.bigwigfile.name)] + #end if + #end for + </token> + + <xml name="reference_genome_source"> + <conditional name="source"> + <param name="ref_source" type="select" label="Reference genome"> + <option value="cached">locally cached</option> + <option value="history">in your history</option> + </param> + <when value="cached"> + <param name="input1_2bit" type="select" label="Using reference genome" help="If your genome of interest is not listed, contact the Galaxy team"> + <options from_data_table="deepTools_seqs"> + <filter type="sort_by" column="1" /> + <validator type="no_options" message="No indexes are available." /> + </options> + </param> + </when> + <when value="history"> + <param name="input1" type="data" format="twobit" label="Select a reference dataset in 2bit format" /> + </when> + </conditional> + </xml> + + <token name="@reference_genome_source@"> + #if $source.ref_source=="history": + --genome $source.input1 + #else: + --genome "${source.input1_2bit.fields.path}" + #end if + </token> + + <xml name="effectiveGenomeSize"> + <conditional name="effectiveGenomeSize"> + <param name="effectiveGenomeSize_opt" type="select" label="Effective genome size" + help="The effective genome size is the portion of the genome that is mappable. Large fractions of the genome are stretches of NNNN that should be discarded. + Also, if repetitive regions were not included in the mapping of reads, the effective genome size needs to be adjusted accordingly. + See Table 2 of http://www.plosone.org/article/info%3Adoi%2F10.1371%2Fjournal.pone.0030377 or http://www.nature.com/nbt/journal/v27/n1/fig_tab/nbt.1518_T1.html for several effective genome sizes."> + <option value="93260000">ce10 (93260000)</option> + <option value="121400000">dm3 (121400000)</option> + <option value="2451960000" selected="true">hg19 (2451960000)</option> + <option value="2150570000">mm9 (2150570000)</option> + <option value="specific">user specified</option> + </param> + <when value="specific"> + <param name="effectiveGenomeSize" type="integer" value="" label="Effective genome size" help="e.g. ce10: 93260000, dm3: 121400000, hg19: 2451960000, mm9: 2150570000"/> + </when> + <when value="2150570000" /> + <when value="2451960000" /> + <when value="121400000" /> + <when value="93260000" /> + </conditional> + </xml> + + <xml name="image_file_format"> + <param name="outFileFormat" type="select" label="Image file format"> + <option value="png" selected="true">png</option> + <option value="pdf">pdf</option> + <option value="svg">svg</option> + <option value="eps">eps</option> + <option value="emf">emf</option> + </param> + </xml> + + <xml name="missingDataAsZero"> + <param name="missingDataAsZero" type="boolean" truevalue="yes" falsevalue="no" checked="True" + label ="Treat missing data as zero" + help ="This parameter determines if missing data should be treated as zeros. If unchecked, missing data will be ignored and not included in the output file. Missing data is defined as those regions for which both BAM files have 0 reads." /> + </xml> + + <xml name="input_save_matrix_values"> + <param name="saveMatrix" type="boolean" label="Save the matrix of values underlying the heatmap"/> + </xml> + + <xml name="input_graphic_output_settings"> + <conditional name="output" > + <param name="showOutputSettings" type="select" label="Show advanced output settings" > + <option value="no" selected="true">no</option> + <option value="yes">yes</option> + </param> + <when value="no" /> + <when value="yes"> + <yield /> + <param name="saveData" type="boolean" label="Save the data underlying the average profile"/> + <param name="saveSortedRegions" type="boolean" label="Save the regions after skipping zeros or min/max threshold values" help="The order of the regions in the file follows the sorting order selected. This is useful, for example, to generate other heatmaps keeping the sorting of the first heatmap."/> + </when> + </conditional> + </xml> + + <xml name="input_image_file_format"> + <param name="outFileFormat" type="select" label="Image file format"> + <option value="png" selected="true">png</option> + <option value="pdf">pdf</option> + <option value="svg">svg</option> + <option value="eps">eps</option> + <option value="emf">emf</option> + </param> + </xml> + + <xml name="output_image_file_format"> + <data format="png" name="outFileName" label="${tool.name} image"> + <change_format> + <when input="output.outFileFormat" value="pdf" format="pdf" /> + <when input="output.outFileFormat" value="svg" format="svg" /> + <when input="output.outFileFormat" value="eps" format="eps" /> + <when input="output.outFileFormat" value="emf" format="emf" /> + </change_format> + </data> + </xml> + + <xml name="output_save_matrix_values"> + <data format="tabular" name="outFileNameMatrix" label="${tool.name} on ${on_string}: Heatmap values"> + <filter> + (( + output['showOutputSettings'] == 'yes' and + output['saveMatrix'] is True + )) + </filter> + </data> + </xml> + + <xml name="output_graphic_outputs"> + <data format="tabular" name="outFileNameData" label="${tool.name} on ${on_string}: averages per matrix column"> + <filter> + (( + output['showOutputSettings'] == 'yes' and + output['saveData'] is True + )) + </filter> + </data> + <data format="bed" name="outFileSortedRegions" label="${tool.name} on ${on_string}: sorted/filtered regions"> + <filter> + (( + output['showOutputSettings'] == 'yes' and + output['saveSortedRegions'] is True + )) + </filter> + </data> + </xml> + + + +</macros>