Source code

Download source archive ↓

upstream/convert_characters/convert_characters.xml

1<tool id="Convert characters1" name="Convert"  version="1.0.1">
2    <description>delimiters to TAB</description>
3    <requirements>
4        <requirement type="package" version="3.8">python</requirement>
5    </requirements>
6    <command>
7        python '$__tool_directory__/convert_characters.py'
8            '${input}'
9            '${convert_from}'
10            '${out_file1}'
11    </command>
12    <inputs>
13        <param name="convert_from" type="select" label="Convert all">
14            <option value="s">Whitespaces</option>
15            <option value="T">Tabs</option>
16            <!--<option value="Sp">Spaces</option>-->
17            <option value="Dt">Dots</option>
18            <option value="C">Commas</option>
19            <option value="D">Dashes</option>
20            <option value="U">Underscores</option>
21            <option value="P">Pipes</option>
22            <option value="Co">Colons</option>
23        </param>
24        <param format="txt" name="input" type="data" label="in Query"/>
25    </inputs>
26    <outputs>
27        <data format="tabular" name="out_file1" />
28    </outputs>
29    <tests>
30        <test>
31            <param name="convert_from" value="s"/>
32            <param name="input" value="1.bed"/>
33            <output name="out_file1" file="eq-convert.dat"/>
34        </test>
35        <test>
36            <param name="convert_from" value="s"/>
37            <param name="input" value="a.txt"/>
38            <output name="out_file1" file="a.tab"/>
39        </test>
40    </tests>
41    <help>
42
43**What it does**
44
45Converts all delimiters of a specified type into TABs.  Consecutive characters are condensed. For example, if columns are separated by 5 spaces they will converted into 1 tab.
46
47-----
48
49**Example**
50
51- Input file::
52
53    chrX||151283558|151283724|NM_000808_exon_8_0_chrX_151283559_r|0|-
54    chrX|151370273|151370486|NM_000808_exon_9_0_chrX_151370274_r|0|-
55    chrX|151559494|151559583|NM_018558_exon_1_0_chrX_151559495_f|0|+
56    chrX|151564643|151564711|NM_018558_exon_2_0_chrX_151564644_f||||0|+
57
58- Converting all pipe delimiters of the above file to TABs will get::
59
60    chrX  151283558  151283724  NM_000808_exon_8_0_chrX_151283559_r  0  -
61    chrX  151370273  151370486  NM_000808_exon_9_0_chrX_151370274_r  0  -
62    chrX  151559494  151559583  NM_018558_exon_1_0_chrX_151559495_f  0  +
63    chrX  151564643  151564711  NM_018558_exon_2_0_chrX_151564644_f  0  +
64
65    </help>
66</tool>