Commit 15f4a749 authored by Lukas Jelonek's avatar Lukas Jelonek
Browse files

Added --result and --output options to json converter scripts

parent 9945d113
#!/usr/bin/python3
import sys
import json
import argparse
filename = sys.argv[1]
parser = argparse.ArgumentParser(description='Convert blast results to json documents')
parser.add_argument('--result', '-r', required=True, help='The blast result file in outfmt 7 format (tsv with headers)')
parser.add_argument('--output', '-o', required=True, help='The converted results json file')
args = parser.parse_args()
filename = args.result
documents = {}
with open(filename) as f:
header = None
......@@ -44,6 +50,6 @@ with open(filename) as f:
results.append(result)
for key in documents:
print(json.dumps(documents[key]))
output_filename = args.output
with open(output_filename, 'w') as o:
json.dump(documents, o)
#!/usr/bin/python3
import sys
import json
import argparse
filename = sys.argv[1]
parser = argparse.ArgumentParser(description='Convert signalp results to json documents')
parser.add_argument('--result', '-r', required=True, help='The signalp result file')
parser.add_argument('--output', '-o', required=True, help='The converted results json file')
args = parser.parse_args()
filename = args.result
documents = {}
with open(filename) as f:
tool = None
......@@ -29,5 +35,6 @@ with open(filename) as f:
'version': split[1].split('-')[1],
'mode': split[2]}
for key in documents:
print(json.dumps(documents[key]))
output_filename = args.output
with open(output_filename, 'w') as o:
json.dump(documents, o)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment