annotate replaceColumn.xml @ 1:d533e4b75800 draft default tip

planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 0def21576e206a0732ce63bacd18533064ddf155
author bgruening
date Sun, 23 Sep 2018 04:03:34 -0400
parents cc18bac5afdb
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
d533e4b75800 planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 0def21576e206a0732ce63bacd18533064ddf155
bgruening
parents: 0
diff changeset
1 <tool id="replace_column_with_key_value_file" name="Replace column" version="0.2">
0
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
2 <description>by values which are defined in a convert file</description>
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
3 <command>
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
4 <![CDATA[
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
5 python '$replaceColumnScript'
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
6 ]]>
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
7 </command>
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
8 <configfiles>
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
9 <configfile name="replaceColumnScript">
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
10 <![CDATA[
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
11 import sys
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
12
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
13 replace_file = '$replace_information'
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
14 original_file = '$original_file'
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
15 column = int("$column_replace") - 1
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
16 ignore_start_lines = int("$skip_lines")
1
d533e4b75800 planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 0def21576e206a0732ce63bacd18533064ddf155
bgruening
parents: 0
diff changeset
17 delimiter_local = "\t" if str("$delimiter") == "tab" else str("$delimiter")
d533e4b75800 planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 0def21576e206a0732ce63bacd18533064ddf155
bgruening
parents: 0
diff changeset
18 comment_str = str("$pass_comments")
d533e4b75800 planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 0def21576e206a0732ce63bacd18533064ddf155
bgruening
parents: 0
diff changeset
19 unk_strat = str("$unknowns_strategy")
0
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
20
1
d533e4b75800 planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 0def21576e206a0732ce63bacd18533064ddf155
bgruening
parents: 0
diff changeset
21 ## read conversion information to index
0
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
22 conversion = {}
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
23
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
24 with open(replace_file, 'r') as conversion_file:
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
25 for line in conversion_file:
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
26 conv_key_value = line.strip().split()
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
27 if len(conv_key_value) == 2:
1
d533e4b75800 planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 0def21576e206a0732ce63bacd18533064ddf155
bgruening
parents: 0
diff changeset
28 conversion[conv_key_value[0]] = conv_key_value[1]
0
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
29
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
30 ## read file line by line, search for column entry if it can be replaced. Otherwise it will be skipped.
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
31 with open("output_file", 'w') as output:
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
32 with open(original_file) as original:
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
33 for i, line in enumerate(original):
1
d533e4b75800 planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 0def21576e206a0732ce63bacd18533064ddf155
bgruening
parents: 0
diff changeset
34 if i < ignore_start_lines or (comment_str and line.startswith(comment_str)):
0
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
35 output.write(line)
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
36 continue
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
37
1
d533e4b75800 planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 0def21576e206a0732ce63bacd18533064ddf155
bgruening
parents: 0
diff changeset
38 line_content = line.rstrip().split(delimiter_local)
0
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
39
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
40 out = list()
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
41 for j, line_content_column in enumerate(line_content):
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
42 if j == column:
1
d533e4b75800 planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 0def21576e206a0732ce63bacd18533064ddf155
bgruening
parents: 0
diff changeset
43
0
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
44 if line_content_column in conversion:
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
45 out.append(conversion[line_content_column])
1
d533e4b75800 planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 0def21576e206a0732ce63bacd18533064ddf155
bgruening
parents: 0
diff changeset
46 elif unk_strat == "print":
d533e4b75800 planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 0def21576e206a0732ce63bacd18533064ddf155
bgruening
parents: 0
diff changeset
47 out.append(line_content_column)
d533e4b75800 planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 0def21576e206a0732ce63bacd18533064ddf155
bgruening
parents: 0
diff changeset
48 elif unk_strat == "error":
d533e4b75800 planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 0def21576e206a0732ce63bacd18533064ddf155
bgruening
parents: 0
diff changeset
49 raise Exception('ERROR: Encountered a value [%s] in the file that is not in the replacements file and is not commented with [%s]' % (line_content_column, comment_str))
0
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
50 else:
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
51 out.append(line_content_column)
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
52
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
53 if len(out) == len(line_content):
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
54 output.write('%s\n' % delimiter_local.join(out))
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
55
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
56 ]]>
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
57 </configfile>
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
58 </configfiles>
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
59 <inputs>
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
60 <param name="original_file" type="data" format="tabular"
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
61 label="File in which you want to replace some values"
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
62 help="The entries of a specific column are replaced by the information given by the next input file." />
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
63 <param name="replace_information" type="data" format="tabular"
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
64 label="Replace information file"
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
65 help="This file contains in the first column the entries that should be replaced by the values of the second column." />
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
66 <param name="column_replace" type="data_column" data_ref="original_file" multiple="false"
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
67 label="Which column should be replaced?" />
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
68 <param name="skip_lines" type='integer' value='0' label="Skip this many starting lines" />
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
69 <param name="delimiter" type="select" label="Delimited by">
1
d533e4b75800 planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 0def21576e206a0732ce63bacd18533064ddf155
bgruening
parents: 0
diff changeset
70 <option value="tab" selected="True">Tab</option>
d533e4b75800 planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 0def21576e206a0732ce63bacd18533064ddf155
bgruening
parents: 0
diff changeset
71 <option value=" ">Space</option>
0
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
72 <option value=".">Dot</option>
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
73 <option value=",">Comma</option>
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
74 <option value="-">Dash</option>
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
75 <option value="_">Underscore</option>
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
76 <option value="|">Pipe</option>
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
77 </param>
1
d533e4b75800 planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 0def21576e206a0732ce63bacd18533064ddf155
bgruening
parents: 0
diff changeset
78 <param name="unknowns_strategy" type="select" label="When an unknown value is encountered">
d533e4b75800 planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 0def21576e206a0732ce63bacd18533064ddf155
bgruening
parents: 0
diff changeset
79 <option value="skip" selected="True">Skip / Do not print</option>
d533e4b75800 planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 0def21576e206a0732ce63bacd18533064ddf155
bgruening
parents: 0
diff changeset
80 <option value="print">Print without modification</option>
d533e4b75800 planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 0def21576e206a0732ce63bacd18533064ddf155
bgruening
parents: 0
diff changeset
81 <option value="error">Exit with an error</option>
d533e4b75800 planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 0def21576e206a0732ce63bacd18533064ddf155
bgruening
parents: 0
diff changeset
82 </param>
d533e4b75800 planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 0def21576e206a0732ce63bacd18533064ddf155
bgruening
parents: 0
diff changeset
83 <param name="pass_comments" type="text" value="#" label="Do not perform replacement on lines starting with">
d533e4b75800 planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 0def21576e206a0732ce63bacd18533064ddf155
bgruening
parents: 0
diff changeset
84 <sanitizer>
d533e4b75800 planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 0def21576e206a0732ce63bacd18533064ddf155
bgruening
parents: 0
diff changeset
85 <valid>
d533e4b75800 planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 0def21576e206a0732ce63bacd18533064ddf155
bgruening
parents: 0
diff changeset
86 <add value="#" />
d533e4b75800 planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 0def21576e206a0732ce63bacd18533064ddf155
bgruening
parents: 0
diff changeset
87 </valid>
d533e4b75800 planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 0def21576e206a0732ce63bacd18533064ddf155
bgruening
parents: 0
diff changeset
88 </sanitizer>
d533e4b75800 planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 0def21576e206a0732ce63bacd18533064ddf155
bgruening
parents: 0
diff changeset
89 </param>
0
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
90 </inputs>
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
91 <outputs>
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
92 <data name="outfile_replace" format="txt" from_work_dir="output_file"/>
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
93 </outputs>
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
94 <tests>
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
95 <test>
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
96 <param name="replace_information" value="GRCh38_ensembl2UCSC.txt" ftype="tabular" />
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
97 <param name="original_file" value="original_file" ftype="tabular" />
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
98 <param name="column_replace" value="1"/>
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
99 <param name="skip_lines" value="1"/>
1
d533e4b75800 planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 0def21576e206a0732ce63bacd18533064ddf155
bgruening
parents: 0
diff changeset
100 <param name="delimiter" value="tab" />
d533e4b75800 planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 0def21576e206a0732ce63bacd18533064ddf155
bgruening
parents: 0
diff changeset
101 <param name="unknowns_strategy" value="skip"/>
d533e4b75800 planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 0def21576e206a0732ce63bacd18533064ddf155
bgruening
parents: 0
diff changeset
102 <param name="pass_comments" value="#"/>
0
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
103 <output name="outfile_replace" file="result_file"/>
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
104 </test>
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
105 <test>
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
106 <param name="replace_information" value="GRCh38_ensembl2UCSC.txt" ftype="tabular" />
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
107 <param name="original_file" value="empty_mapping" ftype="tabular" />
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
108 <param name="column_replace" value="1"/>
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
109 <param name="skip_lines" value="1"/>
1
d533e4b75800 planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 0def21576e206a0732ce63bacd18533064ddf155
bgruening
parents: 0
diff changeset
110 <param name="delimiter" value="tab" />
d533e4b75800 planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 0def21576e206a0732ce63bacd18533064ddf155
bgruening
parents: 0
diff changeset
111 <param name="unknowns_strategy" value="skip"/>
d533e4b75800 planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 0def21576e206a0732ce63bacd18533064ddf155
bgruening
parents: 0
diff changeset
112 <param name="pass_comments" value="#"/>
0
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
113 <output name="outfile_replace" file="result_file_empty_mapping"/>
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
114 </test>
1
d533e4b75800 planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 0def21576e206a0732ce63bacd18533064ddf155
bgruening
parents: 0
diff changeset
115 <test expect_failure="True">
d533e4b75800 planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 0def21576e206a0732ce63bacd18533064ddf155
bgruening
parents: 0
diff changeset
116 <param name="replace_information" value="neg_test_map.txt" ftype="tabular" />
d533e4b75800 planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 0def21576e206a0732ce63bacd18533064ddf155
bgruening
parents: 0
diff changeset
117 <param name="original_file" value="neg_test_commented.txt" ftype="tabular" />
d533e4b75800 planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 0def21576e206a0732ce63bacd18533064ddf155
bgruening
parents: 0
diff changeset
118 <param name="column_replace" value="1"/>
d533e4b75800 planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 0def21576e206a0732ce63bacd18533064ddf155
bgruening
parents: 0
diff changeset
119 <param name="skip_lines" value="0"/>
d533e4b75800 planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 0def21576e206a0732ce63bacd18533064ddf155
bgruening
parents: 0
diff changeset
120 <param name="delimiter" value="tab" />
d533e4b75800 planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 0def21576e206a0732ce63bacd18533064ddf155
bgruening
parents: 0
diff changeset
121 <param name="unknowns_strategy" value="error"/>
d533e4b75800 planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 0def21576e206a0732ce63bacd18533064ddf155
bgruening
parents: 0
diff changeset
122 <param name="pass_comments" value="#"/>
d533e4b75800 planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 0def21576e206a0732ce63bacd18533064ddf155
bgruening
parents: 0
diff changeset
123 </test>
d533e4b75800 planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 0def21576e206a0732ce63bacd18533064ddf155
bgruening
parents: 0
diff changeset
124 <test>
d533e4b75800 planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 0def21576e206a0732ce63bacd18533064ddf155
bgruening
parents: 0
diff changeset
125 <param name="replace_information" value="neg_test_map.txt" ftype="tabular" />
d533e4b75800 planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 0def21576e206a0732ce63bacd18533064ddf155
bgruening
parents: 0
diff changeset
126 <param name="original_file" value="neg_test_commented.txt" ftype="tabular" />
d533e4b75800 planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 0def21576e206a0732ce63bacd18533064ddf155
bgruening
parents: 0
diff changeset
127 <param name="column_replace" value="1"/>
d533e4b75800 planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 0def21576e206a0732ce63bacd18533064ddf155
bgruening
parents: 0
diff changeset
128 <param name="skip_lines" value="0"/>
d533e4b75800 planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 0def21576e206a0732ce63bacd18533064ddf155
bgruening
parents: 0
diff changeset
129 <param name="delimiter" value="tab" />
d533e4b75800 planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 0def21576e206a0732ce63bacd18533064ddf155
bgruening
parents: 0
diff changeset
130 <param name="unknowns_strategy" value="print"/>
d533e4b75800 planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 0def21576e206a0732ce63bacd18533064ddf155
bgruening
parents: 0
diff changeset
131 <param name="pass_comments" value="#"/>
d533e4b75800 planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 0def21576e206a0732ce63bacd18533064ddf155
bgruening
parents: 0
diff changeset
132 <output name="outfile_replace" file="neg_test_commented.txt"/>
d533e4b75800 planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 0def21576e206a0732ce63bacd18533064ddf155
bgruening
parents: 0
diff changeset
133 </test>
0
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
134 </tests>
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
135 <help>
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
136 <![CDATA[
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
137 **What it does**
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
138
1
d533e4b75800 planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 0def21576e206a0732ce63bacd18533064ddf155
bgruening
parents: 0
diff changeset
139 This tool replaces the entries of a defined column with entries given by a replacement file.
d533e4b75800 planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 0def21576e206a0732ce63bacd18533064ddf155
bgruening
parents: 0
diff changeset
140 For example the replacement file holds the information of the naming scheme of ensembl annotated chromosomes in the frist column and in the second the UCSC annotation.
0
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
141 A file which is having information about chromosomes in ensembl notation in column x can now be converted to a file which holds the same information but in UCSC annotation.
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
142
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
143 A useful repository for ensembl and UCSC chromosomes mapping is: https://github.com/dpryan79/ChromosomeMappings
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
144 ]]>
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
145 </help>
cc18bac5afdb planemo upload for repository https://github.com/bgruening/galaxytools/tree/replaceColumn/tools/replaceColumn commit 045006e0b2fe5b4fe96583949b0c757eb6a734a4
bgruening
parents:
diff changeset
146 </tool>