Remove parenthesis from the FASTQ ID

This commit is contained in:
coolneng 2021-12-01 18:52:51 +01:00
parent 52eaee4568
commit e826d6f92b
Signed by: coolneng
GPG Key ID: 9893DA236405AF57
1 changed files with 4 additions and 1 deletions

View File

@ -1,6 +1,7 @@
from argparse import ArgumentParser from argparse import ArgumentParser
from glob import glob from glob import glob
from typing import List, Tuple from typing import List, Tuple
from re import sub
from pandas import DataFrame, read_html, Series from pandas import DataFrame, read_html, Series
@ -35,7 +36,9 @@ def preprocess_dataframe(adapters) -> Series:
def save_to_file(filename, adapters) -> None: def save_to_file(filename, adapters) -> None:
with open(filename, "w") as f: with open(filename, "w") as f:
for index, value in adapters.iteritems(): 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) f.write(fasta_entry)