nodes: 0, module; 1, function_definition; 2, function_name:usearch_chimera_filter_de_novo; 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, expression_statement; 16, if_statement; 17, if_statement; 18, expression_statement; 19, expression_statement; 20, expression_statement; 21, if_statement; 22, expression_statement; 23, if_statement; 24, expression_statement; 25, if_statement; 26, return_statement; 27, identifier:output_chimera_filepath; 28, None; 29, identifier:output_non_chimera_filepath; 30, None; 31, identifier:abundance_skew; 32, float:2.0; 33, identifier:log_name; 34, string:"uchime_de_novo_chimera_filtering.log"; 35, identifier:usersort; 36, False; 37, identifier:HALT_EXEC; 38, False; 39, identifier:save_intermediate_files; 40, False; 41, identifier:remove_usearch_logs; 42, False; 43, identifier:working_dir; 44, None; 45, comment:""" Chimera filter de novo, output chimeras and non-chimeras to fastas
  
      fasta_filepath = input fasta file, generally a dereplicated fasta
      output_chimera_filepath = output chimera filepath
      output_non_chimera_filepath = output non chimera filepath
      abundance_skew = abundance skew setting for de novo filtering.
      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.
      """; 46, not_operator; 47, block; 48, not_operator; 49, block; 50, assignment; 51, assignment; 52, assignment; 53, identifier:usersort; 54, block; 55, assignment; 56, not_operator; 57, block; 58, assignment; 59, not_operator; 60, block; 61, expression_list; 62, identifier:output_chimera_filepath; 63, expression_statement; 64, identifier:output_non_chimera_filepath; 65, expression_statement; 66, identifier:log_filepath; 67, call; 68, identifier:params; 69, dictionary; 70, identifier:app; 71, call; 72, expression_statement; 73, identifier:data; 74, dictionary; 75, identifier:remove_usearch_logs; 76, expression_statement; 77, identifier:app_result; 78, call; 79, identifier:save_intermediate_files; 80, expression_statement; 81, identifier:app_result; 82, identifier:output_non_chimera_filepath; 83, assignment; 84, assignment; 85, identifier:join; 86, argument_list; 87, pair; 88, identifier:Usearch; 89, argument_list; 90, call; 91, pair; 92, pair; 93, pair; 94, assignment; 95, identifier:app; 96, argument_list; 97, call; 98, pattern_list; 99, call; 100, pattern_list; 101, call; 102, identifier:working_dir; 103, identifier:log_name; 104, string; 105, identifier:abundance_skew; 106, identifier:params; 107, keyword_argument; 108, keyword_argument; 109, attribute; 110, argument_list; 111, string; 112, identifier:fasta_filepath; 113, string; 114, identifier:output_chimera_filepath; 115, string; 116, identifier:output_non_chimera_filepath; 117, subscript; 118, identifier:log_filepath; 119, identifier:data; 120, identifier:remove_files; 121, argument_list; 122, identifier:_; 123, identifier:output_chimera_filepath; 124, identifier:mkstemp; 125, argument_list; 126, identifier:_; 127, identifier:output_non_chimera_filepath; 128, identifier:mkstemp; 129, argument_list; 130, string_content:--abskew; 131, identifier:WorkingDir; 132, identifier:working_dir; 133, identifier:HALT_EXEC; 134, identifier:HALT_EXEC; 135, subscript; 136, identifier:on; 137, string_content:--uchime; 138, string_content:--chimeras; 139, string_content:--nonchimeras; 140, identifier:data; 141, string; 142, list; 143, keyword_argument; 144, keyword_argument; 145, keyword_argument; 146, keyword_argument; 147, attribute; 148, string; 149, string_content:--log; 150, identifier:output_chimera_filepath; 151, identifier:prefix; 152, string; 153, identifier:suffix; 154, string; 155, identifier:prefix; 156, string; 157, identifier:suffix; 158, string; 159, identifier:app; 160, identifier:Parameters; 161, string_content:--usersort; 162, string_content:uchime_chimeras_; 163, string_content:.fasta; 164, string_content:uchime_non_chimeras_; 165, string_content:.fasta
code: def usearch_chimera_filter_de_novo(
          fasta_filepath,
          output_chimera_filepath=None,
          output_non_chimera_filepath=None,
          abundance_skew=2.0,
          log_name="uchime_de_novo_chimera_filtering.log",
          usersort=False,
          HALT_EXEC=False,
          save_intermediate_files=False,
          remove_usearch_logs=False,
          working_dir=None):
      """ Chimera filter de novo, output chimeras and non-chimeras to fastas
  
      fasta_filepath = input fasta file, generally a dereplicated fasta
      output_chimera_filepath = output chimera filepath
      output_non_chimera_filepath = output non chimera filepath
      abundance_skew = abundance skew setting for de novo filtering.
      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_chimera_filepath:
          _, output_chimera_filepath = mkstemp(prefix='uchime_chimeras_',
                                               suffix='.fasta')
  
      if not output_non_chimera_filepath:
          _, output_non_chimera_filepath = mkstemp(prefix='uchime_non_chimeras_',
                                                   suffix='.fasta')
  
      log_filepath = join(working_dir, log_name)
  
      params = {'--abskew': abundance_skew}
  
      app = Usearch(params, WorkingDir=working_dir, HALT_EXEC=HALT_EXEC)
  
      if usersort:
          app.Parameters['--usersort'].on()
  
      data = {'--uchime': fasta_filepath,
              '--chimeras': output_chimera_filepath,
              '--nonchimeras': output_non_chimera_filepath
              }
  
      if not remove_usearch_logs:
          data['--log'] = log_filepath
  
      app_result = app(data)
  
      if not save_intermediate_files:
          remove_files([output_chimera_filepath])
  
      return app_result, output_non_chimera_filepath