Fix grouping tool broken in 7347d75a4a / fd85979a86, and enhance performance when removing lines.

This commit is contained in:
Daniel Blankenberg
2016-04-14 12:00:11 -04:00
parent f013cf2021
commit 34900f87f5
2 changed files with 20 additions and 19 deletions
+14 -13
View File
@@ -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()
+6 -6
View File
@@ -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}