diff --git a/parser.py b/parser.py index 328c3a5..4111ff5 100644 --- a/parser.py +++ b/parser.py @@ -1,6 +1,7 @@ from argparse import ArgumentParser from glob import glob from typing import List, Tuple +from re import sub from pandas import DataFrame, read_html, Series @@ -35,7 +36,9 @@ def preprocess_dataframe(adapters) -> Series: def save_to_file(filename, adapters) -> None: with open(filename, "w") as f: for index, value in adapters.iteritems(): - fasta_entry = f">{index}\n{value}\n" + sequence_str = "".join(map(str, index)) + sequence_id = sub(r"[()]", "", sequence_str) + fasta_entry = f">{sequence_id}\n{value}\n" f.write(fasta_entry)