nodes: 0, module; 1, function_definition; 2, function_name:usearch_cluster_error_correction; 3, parameters; 4, block; 5, identifier:fasta_filepath; 6, default_parameter; 7, default_parameter; 8, default_parameter; 9, default_parameter; 10, default_parameter; 11, default_parameter; 12, default_parameter; 13, default_parameter; 14, default_parameter; 15, default_parameter; 16, default_parameter; 17, default_parameter; 18, default_parameter; 19, default_parameter; 20, expression_statement; 21, if_statement; 22, expression_statement; 23, expression_statement; 24, expression_statement; 25, if_statement; 26, expression_statement; 27, if_statement; 28, if_statement; 29, expression_statement; 30, return_statement; 31, identifier:output_filepath; 32, None; 33, identifier:output_uc_filepath; 34, None; 35, identifier:percent_id_err; 36, float:0.97; 37, identifier:sizein; 38, True; 39, identifier:sizeout; 40, True; 41, identifier:w; 42, integer:64; 43, identifier:slots; 44, integer:16769023; 45, identifier:maxrejects; 46, integer:64; 47, identifier:log_name; 48, string:"usearch_cluster_err_corrected.log"; 49, identifier:usersort; 50, False; 51, identifier:HALT_EXEC; 52, False; 53, identifier:save_intermediate_files; 54, False; 55, identifier:remove_usearch_logs; 56, False; 57, identifier:working_dir; 58, None; 59, comment:""" Cluster for err. correction at percent_id_err, output consensus fasta
  
      fasta_filepath = input fasta file, generally a dereplicated fasta
      output_filepath = output error corrected fasta filepath
      percent_id_err = minimum identity percent.
      sizein = not defined in usearch helpstring
      sizeout = not defined in usearch helpstring
      w = Word length for U-sorting
      slots = Size of compressed index table. Should be prime, e.g. 40000003.
       Should also specify --w, typical is --w 16 or --w 32.
      maxrejects = Max rejected targets, 0=ignore, default 32.
      log_name = string specifying output log name
      usersort = Enable if input fasta not sorted by length purposefully, lest
       usearch will raise an error.
      HALT_EXEC: Used for debugging app controller
      save_intermediate_files: Preserve all intermediate files created.
      """; 60, not_operator; 61, block; 62, assignment; 63, assignment; 64, assignment; 65, identifier:usersort; 66, block; 67, assignment; 68, not_operator; 69, block; 70, identifier:output_uc_filepath; 71, block; 72, assignment; 73, expression_list; 74, identifier:output_filepath; 75, expression_statement; 76, identifier:log_filepath; 77, call; 78, identifier:params; 79, dictionary; 80, identifier:app; 81, call; 82, expression_statement; 83, identifier:data; 84, dictionary; 85, identifier:remove_usearch_logs; 86, expression_statement; 87, expression_statement; 88, identifier:app_result; 89, call; 90, identifier:app_result; 91, identifier:output_filepath; 92, assignment; 93, identifier:join; 94, argument_list; 95, pair; 96, pair; 97, pair; 98, pair; 99, pair; 100, pair; 101, identifier:Usearch; 102, argument_list; 103, call; 104, pair; 105, pair; 106, assignment; 107, assignment; 108, identifier:app; 109, argument_list; 110, pattern_list; 111, call; 112, identifier:working_dir; 113, identifier:log_name; 114, string; 115, identifier:sizein; 116, string; 117, identifier:sizeout; 118, string; 119, identifier:percent_id_err; 120, string; 121, identifier:w; 122, string; 123, identifier:slots; 124, string; 125, identifier:maxrejects; 126, identifier:params; 127, keyword_argument; 128, keyword_argument; 129, attribute; 130, argument_list; 131, string; 132, identifier:fasta_filepath; 133, string; 134, identifier:output_filepath; 135, subscript; 136, identifier:log_filepath; 137, subscript; 138, identifier:output_uc_filepath; 139, identifier:data; 140, identifier:_; 141, identifier:output_filepath; 142, identifier:mkstemp; 143, argument_list; 144, string_content:--sizein; 145, string_content:--sizeout; 146, string_content:--id; 147, string_content:--w; 148, string_content:--slots; 149, string_content:--maxrejects; 150, identifier:WorkingDir; 151, identifier:working_dir; 152, identifier:HALT_EXEC; 153, identifier:HALT_EXEC; 154, subscript; 155, identifier:on; 156, string_content:--cluster; 157, string_content:--consout; 158, identifier:data; 159, string; 160, identifier:data; 161, string; 162, keyword_argument; 163, keyword_argument; 164, attribute; 165, string; 166, string_content:--log; 167, string_content:--uc; 168, identifier:prefix; 169, string; 170, identifier:suffix; 171, string; 172, identifier:app; 173, identifier:Parameters; 174, string_content:--usersort; 175, string_content:usearch_cluster_err_corrected; 176, string_content:.fasta
code: def usearch_cluster_error_correction(
          fasta_filepath,
          output_filepath=None,
          output_uc_filepath=None,
          percent_id_err=0.97,
          sizein=True,
          sizeout=True,
          w=64,
          slots=16769023,
          maxrejects=64,
          log_name="usearch_cluster_err_corrected.log",
          usersort=False,
          HALT_EXEC=False,
          save_intermediate_files=False,
          remove_usearch_logs=False,
          working_dir=None):
      """ Cluster for err. correction at percent_id_err, output consensus fasta
  
      fasta_filepath = input fasta file, generally a dereplicated fasta
      output_filepath = output error corrected fasta filepath
      percent_id_err = minimum identity percent.
      sizein = not defined in usearch helpstring
      sizeout = not defined in usearch helpstring
      w = Word length for U-sorting
      slots = Size of compressed index table. Should be prime, e.g. 40000003.
       Should also specify --w, typical is --w 16 or --w 32.
      maxrejects = Max rejected targets, 0=ignore, default 32.
      log_name = string specifying output log name
      usersort = Enable if input fasta not sorted by length purposefully, lest
       usearch will raise an error.
      HALT_EXEC: Used for debugging app controller
      save_intermediate_files: Preserve all intermediate files created.
      """
      if not output_filepath:
          _, output_filepath = mkstemp(prefix='usearch_cluster_err_corrected',
                                       suffix='.fasta')
  
      log_filepath = join(working_dir, log_name)
  
      params = {'--sizein': sizein,
                '--sizeout': sizeout,
                '--id': percent_id_err,
                '--w': w,
                '--slots': slots,
                '--maxrejects': maxrejects}
  
      app = Usearch(params, WorkingDir=working_dir, HALT_EXEC=HALT_EXEC)
  
      if usersort:
          app.Parameters['--usersort'].on()
  
      data = {'--cluster': fasta_filepath,
              '--consout': output_filepath
              }
  
      if not remove_usearch_logs:
          data['--log'] = log_filepath
  
      if output_uc_filepath:
          data['--uc'] = output_uc_filepath
  
      app_result = app(data)
  
      return app_result, output_filepath