diff chicPlotViewpoint.xml @ 8:013e53ccc7ac draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/hicexplorer commit 07802a6bd441d9da888cfb8283f8c2135704f7c9
author iuc
date Wed, 18 Oct 2023 10:56:31 +0000
parents 031872f8e2e0
children f47ac4a0b337
line wrap: on
line diff
--- a/chicPlotViewpoint.xml	Tue Jan 10 18:39:03 2023 +0000
+++ b/chicPlotViewpoint.xml	Wed Oct 18 10:56:31 2023 +0000
@@ -8,80 +8,28 @@
     <command detect_errors="exit_code"><![CDATA[
         #import re
 
-        mkdir interactionFiles &&
-        mkdir differentialFolder &&
-        mkdir significantFolder &&
-        mkdir plots &&
-
-        #if $tar_input_conditional.tar_input_selector == 'tar_input':
-            ln -s '$tar_input_conditional.interactionFiles' viewpoints.tar && 
-            tar -C interactionFiles -xvf viewpoints.tar &&
-
-            #if $differentialFiles:
-                ln -s '$tar_input_conditional.differentialFiles' differential.tar && 
-                tar -C differentialFolder -xvf differential.tar &&
-            #end if
-            #if $significantFiles:
-                ln -s '$tar_input_conditional.significantFiles' significantFiles.tar && 
-                tar -C significantFolder -xvf significantFiles.tar &&
+        @BINARY@
+          
+            --interactionFile '$interactionFile'
+            #if $differentialFile:
+                --differentialTestResult '$differentialFile'
             #end if
-        #else:
-            #for $file in $tar_input_conditional.interactionFiles:
-                #set identifier = @ESCAPE_IDENTIFIER_FILE@
-                ln -s '$file' 'interactionFiles/$identifier' &&
-            #end for
-
-            #for $file in $tar_input_conditional.differentialFiles:
-                    #set identifier = @ESCAPE_IDENTIFIER_FILE@
-                    ln -s '$file' 'differentialFolder/$identifier' &&
-            #end for
-
-            #for $file in $tar_input_conditional.significantFiles:
-                    #set identifier = @ESCAPE_IDENTIFIER_FILE@
-                    ln -s '$file' 'significantFolder/$identifier' &&
-            #end for
-        #end if
 
-        #if $batchmode_conditional.batchmode_selector == 'optionSinglemode':
-            #set $interactonfileslist = ' '.join([ '\'interactionFiles/%s\'' % @ESCAPE_IDENTIFIER_FILE@ for $file in $tar_input_conditional.interactionFiles ])
-            #set $differentialfileslist = ' '.join([ '\'differentialFolder/%s\'' % @ESCAPE_IDENTIFIER_FILE@ for $file in $tar_input_conditional.differentialFiles ])
-            #set $significantfileslist = ' '.join([ '\'significantFolder/%s\'' % @ESCAPE_IDENTIFIER_FILE@ for $file in $tar_input_conditional.significantFiles ])
-        #end if
-
-        @BINARY@
-            #if $batchmode_conditional.batchmode_selector == 'optionSinglemode':
-                --interactionFile $interactonfileslist
-                #if $tar_input_conditional.differentialFiles:
-                    --differentialTestResult $differentialfileslist
-                #end if
-
-                #if $tar_input_conditional.significantFiles:
-                    --significantInteractions $significantfileslist
-                #end if
-
-                -o out_plot.$image_file_format
-            #else:
-                --interactionFile $batchmode_conditional.interactionFilesOrderFile
-                --interactionFileFolder interactionFiles
-                #if $batchmode_conditional.differentialFilesOrderFile:
-                    --differentialTestResult $batchmode_conditional.differentialFilesOrderFile
-                    --differentialTestResultsFolder differentialFolder
-                #end if
-                #if $batchmode_conditional.significantInteractionFilesOrderFile:
-                    --significantInteractions $batchmode_conditional.significantInteractionFilesOrderFile
-                    --significantInteractionFileFolder significantFolder
-                #end if
-                --plotSampleNumber $batchmode_conditional.computeSampleNumber
-
-                --batchMode
-                --outputFolder plots
-                --outputFormat $image_file_format
+            #if $significantInteractionFile:
+                --significantInteractions '$significantInteractionFile'
+                $plotSignificantInteractions
             #end if
 
             --range $rangeUpstream $rangeDownstream
             #if $backgroundModelFile:
                 --backgroundModelFile '$backgroundModelFile'
             #end if
+            
+            --combinationMode $combinationMode_conditional.combinationMode_selector
+
+            #if $combinationMode_conditional.combinationMode_selector == 'oneGene':
+                --combinationName $combinationMode_conditional.geneName
+            #end if
 
             #if $dpi:
                 --dpi $dpi
@@ -95,7 +43,7 @@
                 --minPValue $minPValue
             #end if
 
-            --binResolution $resolution
+            
             #if $colormap:
                 --colorMapPvalue $colormap
             #end if
@@ -107,184 +55,74 @@
             --colorList $colorList
             --threads @THREADS@
             $truncateZeroPvalues
-            #if $batchmode_conditional.batchmode_selector == 'optionSinglemode':
-                && mv out_plot.$image_file_format plots/out_plot.$image_file_format
-            #end if
-
-            #if $tar:
-                && cd plots
-                && tar -cvf ../plots.tar *
-                && cd ..
-                && rm -rf plots
-            #end if
+           
+            -o plots.tar.gz
+          
     ]]>    </command>
     <inputs>
-        <conditional name="tar_input_conditional">
-            <param name="tar_input_selector" type="select" label="Compute files individually or in batch mode">
-                <option value="tar_input">Tar file</option>
-                <option value="interval_input" selected="True">Interval files</option>
+
+        <param name="interactionFile" type="data" format="h5" label="Interaction file order" />
+        <param name="differentialFile" type="data" format="h5" label="Rejected H0 file order" optional="true" />
+        <param name="significantInteractionFile" type="data" format="h5" label="Significant file order" optional="true" />
+        <param argument="--plotSignificantInteractions" type="boolean" truevalue="--plotSignificantInteractions" falsevalue="" checked="false" label="Plot significant interactions" help="Select if the significant regions should be highlighted in the plot. If not set, the significant file data is used only to update the p-values." />
+        
+        <param name="rangeUpstream" type="integer" value="100000" label="Upstream range" help="Defines the region upstream of a reference point which should be considered in the analysis." />
+        <param name="rangeDownstream" type="integer" value="100000" label="Downstream range" help="Defines the region upstream of a reference point which should be considered in the analysis." />
+        <param argument="--backgroundModelFile" type="data" format="tabular" label="Background model" help="The background file computed by chicViewpointBackgroundModel" optional="true" />
+        <conditional name="combinationMode_conditional">
+            <param name="combinationMode_selector" type="select" label="Combination mode for the plots">
+                <option value="dual">Dual</option>
+                <option value="single" selected="True">Single</option>
+                <option value="allGenes" >All genes</option>
+                <option value="oneGene" >One gene</option>
             </param>
-            <when value="tar_input">
-                <param name='interactionFiles' type="data" format="tar" label="Interaction files" multiple="false" />
-                <param name='differentialFiles' type="data" format="tar" label="Rejected H0 files" multiple="true" optional='false' />
-                <param name='significantFiles' type="data" format="tar" label="Significant interaction files" multiple="true" optional='false' />
+            <when value="dual" >
+            </when>
+            <when value="single" >
             </when>
-            <when value="interval_input">
-                <param name='interactionFiles' type="data" format="interval" label="Interaction files" multiple="true" />
-                <param name='differentialFiles' type="data" format="interval" label="Rejected H0 files" multiple="true" optional='true' />
-                <param name='significantFiles' type="data" format="interval" label="Significant interaction files" multiple="true" optional='true' />
+            <when value="allGenes" >
+            </when>
+            <when value="oneGene" >
+                <param name="geneName" type="text" value="" label="Gene name" help="Gene name that should be plotted." />
             </when>
         </conditional>
-
-        <param name="rangeUpstream" type="integer" value="100000" label="Upstream range" help='Defines the region upstream of a reference point which should be considered in the analysis.' />
-        <param name="rangeDownstream" type="integer" value="100000" label="Downstream range" help='Defines the region upstream of a reference point which should be considered in the analysis.' />
-        <param argument="--backgroundModelFile" type="data" format='tabular' label="Background model" help="The background file computed by chicViewpointBackgroundModel" optional='true' />
-
-        <conditional name="batchmode_conditional">
-            <param name="batchmode_selector" type="select" label="Compute files individually or in batch mode">
-                <option value="optionBatchmode">Batch processing</option>
-                <option value="optionSinglemode" selected="True">Single file processing</option>
-            </param>
-            <when value="optionBatchmode">
-                <param name='interactionFilesOrderFile' type="data" format="txt" label="Interaction file order" />
-                <param name='differentialFilesOrderFile' type="data" format="txt" label="Rejected H0 file order" optional='true' />
-                <param name='significantInteractionFilesOrderFile' type="data" format="txt" label="Significant file order" optional='true' />
-                <param name='computeSampleNumber' type="integer" value='2' label="Plot n sample in one plot" />
-            </when>
-            <when value="optionSinglemode">
-            </when>
-        </conditional>
-
+    
         <param argument="--maxPValue" type="float" optional="true" label="Max p-value" help="Maximum value of the plotted p-value." />
         <param argument="--minPValue" type="float" optional="true" label="Min p-value" help="Minimum value of the plotted p-value." />
-        <param name='resolution' type='integer' value='1000' min="1" optional='true' label='Resolution of cHi-C data' help='Resolution of the bin in genomic units. Values are usually e.g. 1000 for a 1kb, 5000 for a 5kb or 10000 for a 10kb resolution.' />
-        <param name='pvalue' type='boolean' truevalue='--pValue' falsevalue="" checked="false" label="Plot p-values as a colorbar" />
+        <param name="pvalue" type="boolean" truevalue="--pValue" falsevalue="" checked="false" label="Plot p-values as a colorbar" />
         <expand macro="colormap" />
 
-        <param name='xFold' type='float' value='' optional='true' label='X-fold mean background' help='Plot x-fold region for the mean background.' />
+        <param name="xFold" type="float" value="" optional="true" label="X-fold mean background" help="Plot x-fold region for the mean background." />
 
         <param name="image_file_format" type="select" label="Image output format">
             <option value="png" selected="True">png</option>
             <option value="svg">svg</option>
             <option value="pdf">pdf</option>
         </param>
-        <param name='dpi' type='integer' optional='true' label='DPI for image' help='Change the default resolution of the plot.' />
-        <param name='colorList' type='text' value='g b c m y k' optional='true' label='Color list' help='Colorlist for the viewpoint lines. For all available colors please check matplotlib documentation: https://matplotlib.org/stable/gallery/color/named_colors.html'>
+        <param name="dpi" type="integer" optional="true" label="DPI for image" help="Change the default resolution of the plot." />
+        <param name="colorList" type="text" value="g b c m y k" optional="true" label="Color list" help="Colorlist for the viewpoint lines. For all available colors please check matplotlib documentation: https://matplotlib.org/stable/gallery/color/named_colors.html">
             <validator type="expression" message="Only alphabetic characters and the colon are allowed.">value.replace(' ', '').replace(':', '').isalpha()</validator>
         </param>
-        <param argument='--truncateZeroPvalues' type='boolean' truevalue='--truncateZeroPvalues' falsevalue="" checked="false" label="Truncate zeros by setting them to one." help="Sets all p-values which are equal to zero to one. This has the effect that the associated positions are not disturbing the presenation of small p-values." />
-        <param name='tar' type='boolean' checked="false" truevalue='True' label="tar output to one file" help="The output is tarred to one file and not written to a collection. Set this option if the number of files is large." />
+        <param argument="--truncateZeroPvalues" type="boolean" truevalue="--truncateZeroPvalues" falsevalue="" checked="false" label="Truncate zeros by setting them to one." help="Sets all p-values which are equal to zero to one. This has the effect that the associated positions are not disturbing the presenation of small p-values." />
     </inputs>
     <outputs>
-        <collection name="plotsCollection" type="list" label="cHi-C viewpoint plots">
-            <discover_datasets pattern="__name_and_ext__" directory="plots" />
-        </collection>
-        <data name="plotsTar" from_work_dir="plots.tar" format="tar" label="cHi-C viewpoint plots tar">
-            <filter>tar</filter>
-        </data>
+        <data name="plotsTar" from_work_dir="plots.tar.gz" format="tar.gz" label="cHi-C viewpoint plots" />
     </outputs>
     <tests>
         <test>
-            <conditional name="tar_input_conditional">
-                <param name="tar_input_selector" value='interval_input' />
-                <param name="interactionFiles" value="cHi-C/chicViewpoint/output_1/FL-E13-5_chr1_chr1_14300280_14300280_Eya1.txt,cHi-C/chicViewpoint/output_1/FL-E13-5_chr1_chr1_4487435_4487435_Sox17.txt,cHi-C/chicViewpoint/output_1/FL-E13-5_chr1_chr1_19093103_19093103_Tfap2d.txt,cHi-C/chicViewpoint/output_1/MB-E10-5_chr1_chr1_4487435_4487435_Sox17.txt,cHi-C/chicViewpoint/output_1/MB-E10-5_chr1_chr1_14300280_14300280_Eya1.txt,cHi-C/chicViewpoint/output_1/MB-E10-5_chr1_chr1_19093103_19093103_Tfap2d.txt" />
-                <param name="differentialFiles" value="cHi-C/chicDifferentialTest/batch_mode_fisher_outfile/FL-E13-5_MB-E10-5_chr1_chr1_4487435_4487435_Sox17_H0_rejected.txt,cHi-C/chicDifferentialTest/batch_mode_fisher_outfile/FL-E13-5_MB-E10-5_chr1_chr1_14300280_14300280_Eya1_H0_rejected.txt,cHi-C/chicDifferentialTest/batch_mode_fisher_outfile/FL-E13-5_MB-E10-5_chr1_chr1_19093103_19093103_Tfap2d_H0_rejected.txt" />
-                <param name="significantFiles" value="cHi-C/chicSignificantInteractions/output_5/FL-E13-5_chr1_chr1_4487435_4487435_Sox17_significant_interactions.txt,cHi-C/chicSignificantInteractions/output_5/FL-E13-5_chr1_chr1_14300280_14300280_Eya1_significant_interactions.txt,cHi-C/chicSignificantInteractions/output_5/FL-E13-5_chr1_chr1_19093103_19093103_Tfap2d_significant_interactions.txt,cHi-C/chicSignificantInteractions/output_5/MB-E10-5_chr1_chr1_4487435_4487435_Sox17_significant_interactions.txt,cHi-C/chicSignificantInteractions/output_5/MB-E10-5_chr1_chr1_14300280_14300280_Eya1_significant_interactions.txt,cHi-C/chicSignificantInteractions/output_5/MB-E10-5_chr1_chr1_19093103_19093103_Tfap2d_significant_interactions.txt" />
-            </conditional>
-            <conditional name="batchmode_conditional">
-                <param name="batchmode_selector" value='optionBatchmode' />
-                <param name="interactionFilesOrderFile" value='cHi-C/chicViewpoint/fileNames_two_matrices.txt' />
-                <param name="differentialFilesOrderFile" value='cHi-C/chicDifferentialTest/rejectedFilesList.txt' />
-                <param name="significantInteractionFilesOrderFile" value='cHi-C/chicSignificantInteractions/output_5_significant_files.txt' />
-                <param name='computeSampleNumber' value='2' />
+            <param name="interactionFile" value="cHi-C/chicViewpoint/two_matrices.hdf5" />
+            <param name="differentialFile" value="cHi-C/chicDifferentialTest/differential.hdf5" />
+            <param name="significantInteractionFile" value="cHi-C/chicSignificantInteractions/significantInteractions_dual.hdf5" />
+            <conditional name="combinationMode_conditional">
+                <param name="combinationMode_selector" value="dual" />
             </conditional>
-            <param name="pvalue" value='True' />
-            <param name="truncateZeroPvalues" value='True' />
-
-            <param name='backgroundModelFile' value='cHi-C/background.txt' />
-            <param name='xFold' value='1.5' />
-            <output_collection name="plotsCollection" type="list" count="3">
-                <element name="Eya1_FL-E13-5_MB-E10-5_chr1_chr1_14300280" file="cHi-C/chicPlotViewpoint/batchMode/two/Eya1_FL-E13-5_MB-E10-5_chr1_chr1_14300280.png" ftype="png" compare='sim_size' />
-                <element name="Sox17_FL-E13-5_MB-E10-5_chr1_chr1_4487435" file="cHi-C/chicPlotViewpoint/batchMode/two/Sox17_FL-E13-5_MB-E10-5_chr1_chr1_4487435.png" ftype="png" compare='sim_size' />
-                <element name="Tfap2d_FL-E13-5_MB-E10-5_chr1_chr1_19093103" file="cHi-C/chicPlotViewpoint/batchMode/two/Tfap2d_FL-E13-5_MB-E10-5_chr1_chr1_19093103.png" ftype="png" compare='sim_size' />
-            </output_collection>
-        </test>
-        <test>
-            <conditional name="tar_input_conditional">
-                <param name="tar_input_selector" value='interval_input' />
-                <param name="interactionFiles" value="cHi-C/chicViewpoint/output_1/FL-E13-5_chr1_chr1_14300280_14300280_Eya1.txt" />
-            </conditional>
-
-            <conditional name="batchmode_conditional">
-                <param name="batchmode_selector" value='optionSinglemode' />
-            </conditional>
-
-            <output_collection name="plotsCollection" type="list" count="1">
-                <element name="out_plot" file="cHi-C/chicPlotViewpoint/FL-E13-5_chr1_chr1_14300280_14300280_Eya1.png" ftype="png" compare='sim_size' />
-            </output_collection>
-        </test>
-
-        <test>
-            <conditional name="tar_input_conditional">
-                <param name="tar_input_selector" value='interval_input' />
-                <param name="interactionFiles" value="cHi-C/chicViewpoint/output_1/FL-E13-5_chr1_chr1_14300280_14300280_Eya1.txt" />
-            </conditional>
-
-            <conditional name="batchmode_conditional">
-                <param name="batchmode_selector" value='optionSinglemode' />
-            </conditional>
+            <param name="pvalue" value="True" />
+            <param name="truncateZeroPvalues" value="True" />
 
-            <output_collection name="plotsCollection" type="list" count="1">
-                <element name="out_plot" file="cHi-C/chicPlotViewpoint/FL-E13-5_chr1_chr1_14300280_14300280_Eya1.png" ftype="png" compare='sim_size' />
-            </output_collection>
-        </test>
-
-        <test>
-            <conditional name="tar_input_conditional">
-                <param name="tar_input_selector" value='interval_input' />
-                <param name="interactionFiles" value="cHi-C/chicViewpoint/output_1/FL-E13-5_chr1_chr1_14300280_14300280_Eya1.txt,cHi-C/chicViewpoint/output_1/FL-E13-5_chr1_chr1_4487435_4487435_Sox17.txt,cHi-C/chicViewpoint/output_1/FL-E13-5_chr1_chr1_19093103_19093103_Tfap2d.txt,cHi-C/chicViewpoint/output_1/MB-E10-5_chr1_chr1_4487435_4487435_Sox17.txt,cHi-C/chicViewpoint/output_1/MB-E10-5_chr1_chr1_14300280_14300280_Eya1.txt,cHi-C/chicViewpoint/output_1/MB-E10-5_chr1_chr1_19093103_19093103_Tfap2d.txt" />
-                <param name="differentialFiles" value="cHi-C/chicDifferentialTest/batch_mode_fisher_outfile/FL-E13-5_MB-E10-5_chr1_chr1_4487435_4487435_Sox17_H0_rejected.txt,cHi-C/chicDifferentialTest/batch_mode_fisher_outfile/FL-E13-5_MB-E10-5_chr1_chr1_14300280_14300280_Eya1_H0_rejected.txt,cHi-C/chicDifferentialTest/batch_mode_fisher_outfile/FL-E13-5_MB-E10-5_chr1_chr1_19093103_19093103_Tfap2d_H0_rejected.txt" />
-                <param name="significantFiles" value="cHi-C/chicSignificantInteractions/output_5/FL-E13-5_chr1_chr1_4487435_4487435_Sox17_significant_interactions.txt,cHi-C/chicSignificantInteractions/output_5/FL-E13-5_chr1_chr1_14300280_14300280_Eya1_significant_interactions.txt,cHi-C/chicSignificantInteractions/output_5/FL-E13-5_chr1_chr1_19093103_19093103_Tfap2d_significant_interactions.txt,cHi-C/chicSignificantInteractions/output_5/MB-E10-5_chr1_chr1_4487435_4487435_Sox17_significant_interactions.txt,cHi-C/chicSignificantInteractions/output_5/MB-E10-5_chr1_chr1_14300280_14300280_Eya1_significant_interactions.txt,cHi-C/chicSignificantInteractions/output_5/MB-E10-5_chr1_chr1_19093103_19093103_Tfap2d_significant_interactions.txt" />
-            </conditional>
-
-            <conditional name="batchmode_conditional">
-                <param name="batchmode_selector" value='optionBatchmode' />
-                <param name="interactionFilesOrderFile" value='cHi-C/chicViewpoint/fileNames_two_matrices.txt' />
-                <param name="differentialFilesOrderFile" value='cHi-C/chicDifferentialTest/rejectedFilesList.txt' />
-                <param name="significantInteractionFilesOrderFile" value='cHi-C/chicSignificantInteractions/output_5_significant_files.txt' />
-                <param name='computeSampleNumber' value='2' />
-            </conditional>
-            <param name="pvalue" value='True' />
-            <param name="truncateZeroPvalues" value='True' />
-
-            <param name='backgroundModelFile' value='cHi-C/background.txt' />
-            <param name='xFold' value='1.5' />
-            <param name='tar' value='True' />
-            <output name="plotsTar" file="cHi-C/chicPlotViewpoint/batchMode/plots.tar" ftype='tar' compare="sim_size" delta='40000' />
-        </test>
-
-        <test>
-            <conditional name="tar_input_conditional">
-                <param name="tar_input_selector" value='tar_input' />
-                <param name="interactionFiles" value="cHi-C/chicViewpoint/output_1.tar" />
-                <param name="differentialFiles" value="cHi-C/chicDifferentialTest/batch_mode_fisher_outfile.tar" />
-                <param name="significantFiles" value="cHi-C/chicSignificantInteractions/significantFilesFolder.tar" />
-            </conditional>
-
-            <conditional name="batchmode_conditional">
-                <param name="batchmode_selector" value='optionBatchmode' />
-                <param name="interactionFilesOrderFile" value='cHi-C/chicViewpoint/fileNames_two_matrices.txt' />
-                <param name="differentialFilesOrderFile" value='cHi-C/chicDifferentialTest/rejectedFilesList.txt' />
-                <param name="significantInteractionFilesOrderFile" value='cHi-C/chicSignificantInteractions/output_5_significant_files.txt' />
-                <param name='computeSampleNumber' value='2' />
-            </conditional>
-            <param name="pvalue" value='True' />
-            <param name="truncateZeroPvalues" value='True' />
-
-            <param name='backgroundModelFile' value='cHi-C/background.txt' />
-            <param name='xFold' value='1.5' />
-            <param name='tar' value='True' />
-            <output name="plotsTar" file="cHi-C/chicPlotViewpoint/batchMode/plots.tar" ftype='tar' compare="sim_size" delta='40000' />
+            <param name="backgroundModelFile" value="cHi-C/background.txt" />
+            <param name="xFold" value="1.5" />
+            <output name="plotsTar" file="cHi-C/plots.tar.gz" ftype="tar.gz" compare="sim_size" />
+            
         </test>
     </tests>
     <help><![CDATA[
@@ -296,12 +134,7 @@
 
 An example usage is:
 
-`$ chicPlotViewpoint --interactionFile viewpoint1.txt viewpoint2.txt --range 500000 500000  --backgroundModelFile background_model.txt --pValue --outFileName viewpoint1_2.png --dpi 300`
-
-
-In batch mode the list of file names and the folders containing the files need to be given:
-
-`$ chicPlotViewpoint --interactionFile viewpoint_names.txt -interactionFileFolder viewpointFilesFolder --differentialTestResult rejected_H0.txt --differentialTestResultsFolder differentialFolder --range 500000 500000 --backgroundModelFile background_model.txt --pValue --outputFolder plotsFOlder --dpi 300 --threads 20`
+`$ chicPlotViewpoint --interactionFile interactions.hdf5 --range 500000 500000  --backgroundModelFile background_model.txt --pValue --outFileName viewpoint1_2.tar.gz --dpi 300`
 
 
 For more information about HiCExplorer please consider our documentation on readthedocs.io_