def write_record_pair(read1, read2, fileobj):
 _rec_pair = (u'@%s\n%s\n+\n%s\n' * 2)
 _rec_pair_no_qual = (u'>%s\n%s\n' * 2)
 if hasattr(read1, u'quality'):
  assert hasattr(read2, u'quality')
  recstr = (_rec_pair % (read1.name, read1.sequence, read1.quality, read2.name, read2.sequence, read2.quality))
 else:
  recstr = (_rec_pair_no_qual % (read1.name, read1.sequence, read2.name, read2.sequence))
 try:
  fileobj.write(bytes(recstr, u'ascii'))
 except TypeError:
  fileobj.write(recstr)

def write_record_pair ( read1 , read2 , fileobj ) : _rec_pair = ( u'@%s\n%s\n+\n%s\n' * 2 ) _rec_pair_no_qual = ( u'>%s\n%s\n' * 2 ) if hasattr ( read1 , u'quality' ) : assert hasattr ( read2 , u'quality' ) recstr = ( _rec_pair % ( read1 . name , read1 . sequence , read1 . quality , read2 . name , read2 . sequence , read2 . quality ) ) else : recstr = ( _rec_pair_no_qual % ( read1 . name , read1 . sequence , read2 . name , read2 . sequence ) ) try : fileobj . write ( bytes ( recstr , u'ascii' ) ) except TypeError : fileobj . write ( recstr )
write a pair of sequence records to fileobj in fasta/fastq format .