def _fastq_generic(in_handle, out_handle, mapping):
 from Bio.SeqIO.QualityIO import FastqGeneralIterator
 count = 0
 null = chr(0)
 for (title, seq, old_qual) in FastqGeneralIterator(in_handle):
  count += 1
  qual = old_qual.translate(mapping)
  if (null in qual):
   raise ValueError('Invalid character in quality string')
  out_handle.write(('@%s\n%s\n+\n%s\n' % (title, seq, qual)))
 return count

def _fastq_generic ( in_handle , out_handle , mapping ) : from Bio . SeqIO . QualityIO import FastqGeneralIterator count = 0 null = chr ( 0 ) for ( title , seq , old_qual ) in FastqGeneralIterator ( in_handle ) : count += 1 qual = old_qual . translate ( mapping ) if ( null in qual ) : raise ValueError ( 'Invalid character in quality string' ) out_handle . write ( ( '@%s\n%s\n+\n%s\n' % ( title , seq , qual ) ) ) return count
fastq helper function where cant have data loss by truncation .