mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-21 13:50:20 +08:00
Fix grouping tool broken in 7347d75a4a / fd85979a86, and enhance performance when removing lines.
This commit is contained in:
+14
-13
@@ -38,19 +38,20 @@ def main():
|
||||
round_val = []
|
||||
|
||||
if sys.argv[5] != "None":
|
||||
oldfile = open(inputfile, 'r')
|
||||
oldfilelines = oldfile.readlines()
|
||||
newinputfile = "input_cleaned.tsv"
|
||||
newfile = open(newinputfile, 'w')
|
||||
asciitodelete = sys.argv[5].split(',')
|
||||
for i in range(len(asciitodelete)):
|
||||
asciitodelete[i] = chr(int(asciitodelete[i]))
|
||||
for line in oldfilelines:
|
||||
if line[0] not in asciitodelete:
|
||||
newfile.write(line)
|
||||
oldfile.close()
|
||||
newfile.close()
|
||||
inputfile = newinputfile
|
||||
asciitodelete = sys.argv[5]
|
||||
if asciitodelete:
|
||||
oldfile = open(inputfile, 'r')
|
||||
newinputfile = "input_cleaned.tsv"
|
||||
newfile = open(newinputfile, 'w')
|
||||
asciitodelete = asciitodelete.split(',')
|
||||
for i in range(len(asciitodelete)):
|
||||
asciitodelete[i] = chr(int(asciitodelete[i]))
|
||||
for line in oldfile:
|
||||
if line[0] not in asciitodelete:
|
||||
newfile.write(line)
|
||||
oldfile.close()
|
||||
newfile.close()
|
||||
inputfile = newinputfile
|
||||
|
||||
for var in sys.argv[6:]:
|
||||
op, col, do_round = var.split()
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<tool id="Grouping1" name="Group" version="2.1.0">
|
||||
<tool id="Grouping1" name="Group" version="2.1.1">
|
||||
<description>data by a column and perform aggregate operation on other columns.</description>
|
||||
<command interpreter="python">
|
||||
grouping.py
|
||||
$out_file1
|
||||
$input1
|
||||
$groupcol
|
||||
$ignorecase
|
||||
$ignorelines
|
||||
"${out_file1}"
|
||||
"${input1}"
|
||||
"${groupcol}"
|
||||
"${ignorecase}"
|
||||
"${ignorelines}"
|
||||
#for $op in $operations
|
||||
'${op.optype}
|
||||
${op.opcol}
|
||||
|
||||
Reference in New Issue
Block a user