Skip to content

Commit

Permalink
fixed redundant characters
Browse files Browse the repository at this point in the history
  • Loading branch information
mazzalab committed Nov 23, 2024
1 parent e8b9647 commit 3c1d183
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions fastqwiper/fastq_gather.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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')]
Expand All @@ -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:
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 3c1d183

Please sign in to comment.