Skip to content

Commit

Permalink
change to singe file input
Browse files Browse the repository at this point in the history
  • Loading branch information
riasc committed Feb 27, 2024
1 parent fe10948 commit e77f6d4
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions workflow/scripts/finalize_mhcII_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,20 @@ def split(infile, out_fwd, out_rev):
print("Done.")

def main():
input_files = sys.argv[1]
inputfile = sys.argv[1]
out_fwd = sys.argv[2]
out_rev = sys.argv[3]

fext = Path(input_files[0]).suffix # determine file extension
fext = Path(inputfile).suffix # determine file extension
print("Detected File extension: ", fext)
if fext == ".fq":
in_fh = open(input_files[0], "r")
in_fh = open(inputfile, "r")
first_line = in_fh.readline()

# check if fq is interleaved (paired-end)
if "/" in first_line:
print(f"Interleaved fastq file detected. Splitting into two files...")
split(input_files[0], out_fwd, out_rev)
split(inputfile, out_fwd, out_rev)

else:
print(f"Single-end fastq file detected. Splitting into two files...")
Expand Down

0 comments on commit e77f6d4

Please sign in to comment.