upstream/windowsplitter/windowSplitter.xml
1<tool id="winSplitter" name="Make windows" version="1.0.1">
2 <description></description>
3 <requirements>
4 <requirement type="package" version="0.8.8">bx-python</requirement>
5 </requirements>
6 <command>
7 python $__tool_directory__/windowSplitter.py
8 $input
9 $size
10 $out_file1
11 ${wintype.choice}
12 ${wintype.offset}
13 -l ${input.metadata.chromCol},${input.metadata.startCol},${input.metadata.endCol},${input.metadata.strandCol}
14 </command>
15 <inputs>
16 <!--<param label="Genome" name="dbkey" type="genomebuild"/>-->
17 <param format="interval" name="input" type="data" label="Select data"/>
18 <param name="size" type="integer" value="500" label="Window size"/>
19 <conditional name="wintype">
20 <param name="choice" type="select" label="Make sliding windows?">
21 <option value="0" selected="true">No</option>
22 <option value="1">Yes</option>
23 </param>
24 <when value="0">
25 <param name="offset" type="hidden" value="0" />
26 </when>
27 <when value="1">
28 <param name="offset" type="integer" value="10" label="Offset size"/>
29 </when>
30 </conditional>
31 </inputs>
32 <outputs>
33 <data format="interval" name="out_file1" metadata_source="input"/>
34 </outputs>
35 <tests>
36 <test>
37 <param name="input" value="4.bed"/>
38 <param name="size" value="5000"/>
39 <param name="choice" value="1"/>
40 <param name="offset" value="4000"/>
41 <output name="out_file1" file="4_windows.bed"/>
42 </test>
43 </tests>
44 <help>
45
46.. class:: infomark
47
48**What it does**
49
50This tool splits the intervals in the input file into smaller intervals based on the specified window-size and window type.
51
52-----
53
54.. class:: warningmark
55
56**Note**
57
58The positions at the end of the input interval which do not fit into the last window or a new window of required size, will be omitted from the output.
59
60-----
61
62.. class:: infomark
63
64**About formats**
65
66**BED format** Browser Extensible Data format was designed at UCSC for displaying data tracks in the Genome Browser. It has three required fields and several additional optional ones:
67
68The first three BED fields (required) are::
69
70 1. chrom - The name of the chromosome (e.g. chr1, chrY_random).
71 2. chromStart - The starting position in the chromosome. (The first base in a chromosome is numbered 0.)
72 3. chromEnd - The ending position in the chromosome, plus 1 (i.e., a half-open interval).
73
74The additional BED fields (optional) are::
75
76 4. name - The name of the BED line.
77 5. score - A score between 0 and 1000.
78 6. strand - Defines the strand - either '+' or '-'.
79 7. thickStart - The starting position where the feature is drawn thickly at the Genome Browser.
80 8. thickEnd - The ending position where the feature is drawn thickly at the Genome Browser.
81 9. reserved - This should always be set to zero.
82 10. blockCount - The number of blocks (exons) in the BED line.
83 11. blockSizes - A comma-separated list of the block sizes. The number of items in this list should correspond to blockCount.
84 12. blockStarts - A comma-separated list of block starts. All of the blockStart positions should be calculated relative to chromStart. The number of items in this list should correspond to blockCount.
85 13. expCount - The number of experiments.
86 14. expIds - A comma-separated list of experiment ids. The number of items in this list should correspond to expCount.
87 15. expScores - A comma-separated list of experiment scores. All of the expScores should be relative to expIds. The number of items in this list should correspond to expCount.
88
89-----
90
91**Example**
92
93- For the following dataset::
94
95 chr22 1000 4700 NM_174568 0 +
96
97- running this tool with **Window size as 1000**, will return::
98
99 chr22 1000 2000 NM_174568 0 +
100 chr22 2000 3000 NM_174568 0 +
101 chr22 3000 4000 NM_174568 0 +
102
103- running this tool to make **Sliding windows** of **size 1000** and **offset 500**, will return::
104
105 chr22 1000 2000 NM_174568 0 +
106 chr22 1500 2500 NM_174568 0 +
107 chr22 2000 3000 NM_174568 0 +
108 chr22 2500 3500 NM_174568 0 +
109 chr22 3000 4000 NM_174568 0 +
110 chr22 3500 4500 NM_174568 0 +
111
112 </help>
113</tool>