Skip to content

Commit

Permalink
careful output storage based on compression
Browse files Browse the repository at this point in the history
closes #29
  • Loading branch information
meren committed Jul 29, 2021
1 parent a6fcb58 commit cd87a73
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions IlluminaUtils/lib/fastqlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,16 @@ def __init__(self, file_path, compressed = False):
super(FastQOutput, self).__init__(file_path, compressed)

def store_entry(self, e):
self.file_pointer.write('@' + e.header_line + '\n')
self.file_pointer.write(e.sequence + '\n')
self.file_pointer.write('+' + e.optional + '\n')
self.file_pointer.write(e.qual_scores + '\n')
if self.compressed_output:
self.file_pointer.write(('@' + e.header_line + '\n').encode())
self.file_pointer.write((e.sequence + '\n').encode())
self.file_pointer.write(('+' + e.optional + '\n').encode())
self.file_pointer.write((e.qual_scores + '\n').encode())
else:
self.file_pointer.write('@' + e.header_line + '\n')
self.file_pointer.write(e.sequence + '\n')
self.file_pointer.write('+' + e.optional + '\n')
self.file_pointer.write(e.qual_scores + '\n')


class FastQSource:
Expand Down

0 comments on commit cd87a73

Please sign in to comment.