Skip to content

Commit bc335d3

Browse files
More bug fixes in extract_all_unmapped
1 parent 3b1a6a4 commit bc335d3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

kb_python/extract.py

+4
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,10 @@ def extract_matching_reads_by_header(input_fastq, reference_fastq, output_fastq)
115115
else:
116116
infile_opener = open(reference_fastq, "r")
117117

118+
# Ensure all intermediary folders exist for the output_fastq path
119+
output_dir = os.path.dirname(output_fastq)
120+
os.makedirs(output_dir, exist_ok=True)
121+
118122
with infile_opener as infile, gzip.open(output_fastq, "wt") as outfile:
119123
# Create a SeqIO writer for the output FASTQ file
120124
writer = SeqIO.write(

0 commit comments

Comments
 (0)