Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix - explicitly read latin-1 encoding from fasta files #637

Merged
merged 1 commit into from
Dec 31, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions workflow_flu_gisaid_ingest/scripts/chunk_sequences.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def process_fasta_file(fasta_file, metadata, output_path, chunk_size=10_000):
# Get the date from the fasta file name, as a string
# file_date = Path(fasta_file).name.replace(".fa.gz", "")

with open(fasta_file, "rt") as fp:
with open(fasta_file, "rt", encoding="latin-1") as fp:
lines = fp.readlines()
for i, line in enumerate(lines):
# Strip whitespace
Expand Down Expand Up @@ -114,7 +114,6 @@ def process_fasta_file(fasta_file, metadata, output_path, chunk_size=10_000):
date_lookup = dict(zip(metadata.index, metadata["submission_date"]))

for name, seq in entries:

# Flush results if chunk is full
if chunk_i == chunk_size:
print("Writing {} sequences".format(chunk_i))
Expand Down
Loading