Commit 610ed0d9 authored by hmueller's avatar hmueller
Browse files

Minor improvements in code readability.

parent 88914353
......@@ -59,5 +59,6 @@ output_filename = args.output
with open(output_filename, 'w') as o:
json.dump(documents, o)
# Replace sequences' enumerated ids with their original ids
restore_seq_ids_tool = path.dirname(__file__) + '/restore_seq_id_from_enumeration.py'
subprocess.run([restore_seq_ids_tool, '-j', output_filename, '-e', args.result + '/enum_headers.tsv'])
......@@ -3,7 +3,7 @@
import argparse
import fileinput
parser = argparse.ArgumentParser(description='Replaces fasta headers with unique numbers and saves a dictionary of both in tsv format')
parser = argparse.ArgumentParser(description='Replaces fasta headers with unique numbers and saves a dictionary of both in tsv format. Caution: The original fasta file gets replaced in the process.')
parser.add_argument('--fasta', '-f', required=True, help='The fasta file')
parser.add_argument('--enum-headers-dir', '-d', default='.', help='Target directory for headers dictionary file enum_headers.tsv')
args = parser.parse_args()
......
......@@ -3,7 +3,7 @@
import json
import argparse
parser = argparse.ArgumentParser(description='Replace enumerated id of sequences with original identifier')
parser = argparse.ArgumentParser(description='Replace enumerated id of sequences with original identifier. Caution: The original json file gets replaced in the process.')
parser.add_argument('--json', '-j', required=True, help='The results json file')
parser.add_argument('--enum-headers', '-e', required=True, help='The enumerated original headers in tsv format')
args = parser.parse_args()
......
......@@ -18,6 +18,7 @@ args = parser.parse_args()
makedirs(args.output, exist_ok=True)
# Swap fasta headers for unique numbers to save ghostx from dealing with complex headers
reduce_headers_tool = path.dirname(__file__) + '/reduce_fasta_headers_to_enumeration.py'
subprocess.run([reduce_headers_tool, "-f", args.fasta, "-d", args.output])
......
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