1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229
|
<tool id="deeptools_compute_matrix_operations" name="computeMatrixOperations" version="@TOOL_VERSION@+galaxy0" profile="@GALAXY_VERSION@">
<description>Modify or combine the output of computeMatrix in a variety of ways.</description>
<macros>
<token name="@BINARY@">computeMatrixOperations</token>
<import>deepTools_macros.xml</import>
</macros>
<expand macro="requirements"/>
<command>
<![CDATA[
@BINARY@
#if $submodule.command == "info":
info
-m $submodule.matrixFile
> $outFileTxt
#else if $submodule.command == "relabel":
relabel
-m $submodule.matrixFile
#if $submodule.groupLabels is not None and str($submodule.groupLabels) != '':
--groupLabels $submodule.groupLabels
#end if
#if $submodule.sampleLabels is not None and str($submodule.sampleLabels) != '':
--sampleLabels $submodule.sampleLabels
#end if
#else if $submodule.command == "subset":
subset
-m $submodule.matrixFile
#if $submodule.groups is not None and str($submodule.groups) != '':
--groups $submodule.groups
#end if
#if $submodule.samples is not None and str($submodule.samples) != '':
--samples $submodule.samples
#end if
-o $outFileName
#else if $submodule.command == "filterStrand":
filterStrand
-m $submodule.matrixFile
--strand $submodule.strand
-o $outFileName
#else if $submodule.command == "filterValues":
filterValues
-m $submodule.matrixFile
#if $submodule.minValue is not None and str($submodule.minValue) != '':
--min $submodule.minValue
#end if
#if $submodule.maxValue is not None and str($submodule.maxValue) != '':
--max $submodule.maxValue
#end if
-o $outFileName
#else if $submodule.command == "rbind":
#set $files=[]
#for $f in $submodule.matrixFiles:
#silent $files.append(str($f.matrixFile))
#end for
rbind
-m '#echo "' '".join($files)#'
-o $outFileName
#else if $submodule.command == "cbind":
cbind
#set $files=[]
#for $f in $submodule.matrixFiles:
#silent $files.append(str($f.matrixFile))
#end for
-m '#echo "' '".join($files)#'
-o $outFileName
#else if $submodule.command == "sort":
sort
#set $files=[]
#for $f in $submodule.regionsFiles:
#silent $files.append(str($f.regionsFile))
#end for
-m $submodule.matrixFile
-R '#echo "' '".join($files)#'
-o $outFileName
#else if $submodule.command == "dataRange":
dataRange
-m $submodule.matrixFile
> $outFileTxt
#end if
]]>
</command>
<inputs>
<conditional name="submodule">
<param name="command" type="select" label="Operation type">
<option value="info" selected="true">Print information (info)</option>
<option value="relabel">Relabel the samples and/or groups (relabel)</option>
<option value="subset">Subset by samples and/or groups of regions (subset)</option>
<option value="filterStrand">Filter by strand (filterStrand)</option>
<option value="filterValues">Filter by min/max value (filterValues)</option>
<option value="rbind">Bind matrices, top to bottom (rbind)</option>
<option value="cbind">Bind matrices, left to right (cbind)</option>
<option value="sort">Sort by region order in specified files (sort)</option>
<option value="dataRange">Returns the min, max, median, 10th and 90th percentile of the matrix values per sample (dataRange)</option>
</param>
<when value="info">
<param argument="matrixFile" format="deeptools_compute_matrix_archive" type="data"
label="Matrix file from the computeMatrix tool" help=""/>
</when>
<when value="relabel">
<param argument="matrixFile" format="deeptools_compute_matrix_archive" type="data"
label="Matrix file from the computeMatrix tool" help=""/>
<param argument="groupLabels" type="text" optional="true" label="New Region/Group Labels."
help="If blank, the labels are left unchanged, otherwise they're changed to be those provided here. Multiple labels should be separated by spaces. If you provide labels, you must provide exactly one label for each group of regions."/>
<param argument="sampleLabels" type="text" optional="true" label="New Sample Labels."
help="If blank, the labels are left unchanged, otherwise they're changed to be those provided here. Multiple labels should be separated by spaces. If you provide labels, you must provide exactly one label for each sample."/>
</when>
<when value="subset">
<param argument="matrixFile" format="deeptools_compute_matrix_archive" type="data"
label="Matrix file from the computeMatrix tool" help=""/>
<param argument="groups" type="text" optional="true" label="Region groups to include."
help="If blank, all region groups are output. Alternatively, one or more groups listed in the output of the 'info' command can be used (separate groups by a space and enclose in quotes if needed)" />
<param argument="samples" type="text" optional="true" label="Samples to include."
help="If blank, all samples are output. Alternatively, one or more samples listed in the output of the 'info' command can be used (separate sample names by a space and enclose in quotes if needed)" />
</when>
<when value="filterStrand">
<param argument="matrixFile" format="deeptools_compute_matrix_archive" type="data"
label="Matrix file from the computeMatrix tool" help=""/>
<param argument="--strand" type="select" label="Only include regions on this strand."
help="Only regions on the desired strand will be included in the output. If you desire to instead remove regions on only one strand (or the . strand), separately run this on the other strand and then use the rbind operation.">
<option value="+">+</option>
<option value="-">-</option>
<option value=".">. (no annotated strand)</option>
</param>
</when>
<when value="filterValues">
<param argument="matrixFile" format="deeptools_compute_matrix_archive" type="data"
label="Matrix file from the computeMatrix tool" help=""/>
<param argument="--min" type="float" optional="true" label="Minimum value"
help="Exclude any row in the matrix with a value below this. By default there is no minimum value." />
<param argument="--max" type="float" optional="true" label="Maximum value"
help="Exclude any row in the matrix with a value above this. By default there is no maximum value." />
</when>
<when value="rbind">
<repeat name="matrixFiles" title="Matrix files from computeMatrix" min="2">
<param argument="matrixFile" format="deeptools_compute_matrix_archive" type="data"
label="Matrix file from the computeMatrix tool" help=""/>
</repeat>
</when>
<when value="cbind">
<repeat name="matrixFiles" title="Matrix files from computeMatrix" min="2">
<param argument="matrixFile" format="deeptools_compute_matrix_archive" type="data"
label="Matrix file from the computeMatrix tool" help=""/>
</repeat>
</when>
<when value="sort">
<param argument="matrixFile" format="deeptools_compute_matrix_archive" type="data"
label="Matrix file from the computeMatrix tool" help=""/>
<repeat name="regionsFiles" title="BED or GTF files of regions" min="1">
<param name="regionsFile" format="bed,gtf" type="data" label="Regions to plot"
help="File, in BED format, containing the regions to plot."/>
</repeat>
</when>
<when value="dataRange">
<param argument="matrixFile" format="deeptools_compute_matrix_archive" type="data"
label="Matrix file from the computeMatrix tool" help=""/>
</when>
</conditional>
</inputs>
<outputs>
<data format="deeptools_compute_matrix_archive" name="outFileName" label="${tool.name} ${submodule.command} on ${on_string}">
<filter>
((
submodule['command'] != "info"
))
</filter>
</data>
<data format="txt" name="outFileTxt" label="${tool.name} info on ${on_string}">
<filter>
((
submodule['command'] == "info"
))
</filter>
</data>
</outputs>
<tests>
<test>
<param name="command" value="info" />
<param name="matrixFile" value="computeMatrix_result1.gz" ftype="deeptools_compute_matrix_archive" />
<output name="outFileTxt" file="computeMatrixOperations.txt" ftype="txt" />
</test>
<test>
<param name="command" value="rbind" />
<param name="matrixFile" value="computeMatrix_result1.gz" ftype="deeptools_compute_matrix_archive" />
<param name="matrixFile" value="computeMatrix_result1.gz" ftype="deeptools_compute_matrix_archive" />
<output name="outFileName" file="computeMatrixOperations_result2.mat.gz" ftype="deeptools_compute_matrix_archive" compare="sim_size" delta="100"/>
</test>
</tests>
<help>
<![CDATA[
What it does
------------
``computeMatrixOperations`` can perform a variety of operations on one or more files produced by ``computeMatrix`` (N.B., the output is always written to a new file):
+----------------+--------------------------------------------------------------------------------------------------------------------------+
+ **Subcommand** | **What it does** |
+----------------+--------------------------------------------------------------------------------------------------------------------------+
+ info | Prints out the sample and region group names in the order in which they appear. |
+----------------+--------------------------------------------------------------------------------------------------------------------------+
+ subset | Subsets a file by the desired samples/region group names. This can also change the order of these samples/region groups. |
+----------------+--------------------------------------------------------------------------------------------------------------------------+
+ filterStrand | Filters the file to only include regions annotated as being on a particular strand. |
+----------------+--------------------------------------------------------------------------------------------------------------------------+
+ rbind | Concatenates multiple matrices together, top to bottom. |
+----------------+--------------------------------------------------------------------------------------------------------------------------+
+ cbind | Merges multiple matrices, left to right. |
+----------------+--------------------------------------------------------------------------------------------------------------------------+
+ sort | Sorts the given file so regions are in the order of occurence in the input BED/GTF file(s). |
+----------------+--------------------------------------------------------------------------------------------------------------------------+
+ dataRange | Returns the min, max, median, 10th and 90th percentile of the matrix values per sample. |
+----------------+--------------------------------------------------------------------------------------------------------------------------+
These operations are useful when you want to run computeMatrix on multiple files (thereby keeping all of the values together) and later exclude regions/samples or add new ones. Another common use would be if you require the output of computeMatrix to be sorted to match the order of regions in the input file.
-----
@REFERENCES@
]]>
</help>
<expand macro="citations" />
</tool>
|