Skip to content

Commit

Permalink
Fixed bug on unseekable stdin object
Browse files Browse the repository at this point in the history
  • Loading branch information
crosenth committed Jun 5, 2024
1 parent 1dd0dec commit 2b8d590
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions taxtastic/subcommands/named.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ def action(args):
tax = Taxonomy(engine, schema=args.schema)
if args.seq_info:
seq_info = csv.DictReader(args.seq_info)
fieldnames = seq_info.fieldnames
seq_info = list(seq_info)
tax_ids = (i['tax_id'] for i in seq_info)
named = tax.is_valid(tax_ids, no_rank=not args.ranked)
args.seq_info.seek(0)
seq_info = csv.DictReader(args.seq_info)
out = csv.DictWriter(args.outfile, fieldnames=seq_info.fieldnames)
out = csv.DictWriter(args.outfile, fieldnames=fieldnames)
out.writeheader()
out.writerows(i for i in seq_info if i['tax_id'] in named)
else:
Expand Down

0 comments on commit 2b8d590

Please sign in to comment.