def set_sff_trimpoints(sff_dir, technical_lengths):
 for (lib_id, sff_fp) in get_per_lib_sff_fps(sff_dir):
  try:
   readlength = technical_lengths[lib_id]
  except KeyError:
   continue
  sff_data = parse_binary_sff(open(sff_fp), True)
  (clipped_header, clipped_reads) = set_clip_qual_left(sff_data, readlength)
  (fd, temp_fp) = mkstemp(dir=sff_dir)
  close(fd)
  with open(temp_fp, 'w') as f:
   write_binary_sff(f, clipped_header, clipped_reads)
  move(temp_fp, sff_fp)

def set_sff_trimpoints ( sff_dir , technical_lengths ) : for ( lib_id , sff_fp ) in get_per_lib_sff_fps ( sff_dir ) : try : readlength = technical_lengths [ lib_id ] except KeyError : continue sff_data = parse_binary_sff ( open ( sff_fp ) , True ) ( clipped_header , clipped_reads ) = set_clip_qual_left ( sff_data , readlength ) ( fd , temp_fp ) = mkstemp ( dir = sff_dir ) close ( fd ) with open ( temp_fp , 'w' ) as f : write_binary_sff ( f , clipped_header , clipped_reads ) move ( temp_fp , sff_fp )
set trimpoints to end of technical read for all sff files in directory .