From 3c1d183275de3007722f6d91b6e49e47448243c4 Mon Sep 17 00:00:00 2001 From: mazzalab Date: Sat, 23 Nov 2024 20:55:50 +0100 Subject: [PATCH] fixed redundant characters --- fastqwiper/fastq_gather.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/fastqwiper/fastq_gather.py b/fastqwiper/fastq_gather.py index dc3d8b2..87a966b 100644 --- a/fastqwiper/fastq_gather.py +++ b/fastqwiper/fastq_gather.py @@ -9,7 +9,7 @@ class GatherFastq(WiperTool): def __init__(self): super().__init__("fastqgather") - + # Inherited methods def set_parser(self, parser: argparse.ArgumentParser): class OsEnum(Enum): @@ -40,11 +40,11 @@ def run(self, argv: argparse.Namespace): def concatenate_fastq(input_directory, output_file, prefix, opsys): # List all files in the directory with the given prefix files = [os.path.join(input_directory, f) for f in os.listdir(input_directory) if f.startswith(prefix)] if prefix else [os.path.join(input_directory, f) for f in os.listdir(input_directory)] - + if not files: print(f"No files found in {input_directory} with prefix {prefix}.") return - + # Separate gzipped files from regular files gz_files = [f for f in files if f.endswith('.gz')] regular_files = [f for f in files if f.endswith('.fastq')] @@ -58,7 +58,7 @@ def concatenate_fastq(input_directory, output_file, prefix, opsys): print("Files concatenated successfully.") except Exception as e: print(f"Error while concatenating files: {e}") - + @staticmethod def __concat_unix(regular_files: str, gz_files: str, outfile: str): if regular_files: @@ -102,7 +102,6 @@ def __concat_unix(regular_files: str, gz_files: str, outfile: str): if process_compress.returncode != 0: print(f"Error occurred: {stderr.decode()}") - def __concat_windows(regular_files, gz_files, outfile: str): with gzip.open(outfile, 'wb') if outfile.endswith(".gz") else open(outfile, "w") as output_file: for file_path in regular_files: