From e826d6f92b53a3e9f57f1327d54c6ea9cadcb310 Mon Sep 17 00:00:00 2001 From: coolneng Date: Wed, 1 Dec 2021 18:52:51 +0100 Subject: [PATCH] Remove parenthesis from the FASTQ ID --- parser.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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)