Skip to content

Commit

Permalink
Add control characters for fastx_handler.sanitize_filename as forbi…
Browse files Browse the repository at this point in the history
…dden chars
  • Loading branch information
akikuno committed May 29, 2024
1 parent 707906e commit 6b74fce
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/DAJIN2/utils/fastx_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@ def export_fasta_files(TEMPDIR: Path, FASTA_ALLELES: dict, NAME: str) -> None:
"""Save multiple FASTAs in separate single-FASTA format files."""
for identifier, sequence in FASTA_ALLELES.items():
contents = "\n".join([">" + identifier, sequence]) + "\n"
output_fasta = Path(TEMPDIR, NAME, "fasta", f"{identifier}.fasta")
Path(sanitize_filename(output_fasta)).write_text(contents)
path_output_fasta = Path(TEMPDIR, NAME, "fasta", f"{identifier}.fasta")
path_output_fasta = Path(sanitize_filename(path_output_fasta))
path_output_fasta.write_text(contents)


#################################################
Expand Down

0 comments on commit 6b74fce

Please sign in to comment.