def get_chimeras_from_Nast_aligned(seqs_fp, ref_db_aligned_fp=None, ref_db_fasta_fp=None, HALT_EXEC=False, min_div_ratio=None, keep_intermediates=False):
 files_to_remove = []
 seqs_fp = str(seqs_fp)
 seqs_fp = seqs_fp.rstrip('"')
 seqs_fp = seqs_fp.lstrip('"')
 (seqs_dir, new_seqs_fp) = split(seqs_fp)
 if (seqs_dir == ''):
  seqs_dir = './'
 params = {'--query_NAST': new_seqs_fp, '--exec_dir': seqs_dir}
 if ((ref_db_aligned_fp is None) and (ref_db_fasta_fp is None)):
  pass
 else:
  if (not ref_db_fasta_fp):
   ref_db_fasta_fp = write_degapped_fasta_to_file(parse_fasta(open(ref_db_aligned_fp)))
   files_to_remove.append(ref_db_fasta_fp)
  params.update({'--db_NAST': abspath(ref_db_aligned_fp), '--db_FASTA': abspath(ref_db_fasta_fp)})
 if (min_div_ratio is not None):
  params.update({'-R': min_div_ratio})
 app = ChimeraSlayer(params=params, HALT_EXEC=HALT_EXEC)
 app_results = app()
 chimeras = parse_CPS_file(app_results['CPS'])
 if (not keep_intermediates):
  app.remove_intermediate_files()
  remove_files(files_to_remove)
 return chimeras

def get_chimeras_from_Nast_aligned ( seqs_fp , ref_db_aligned_fp = None , ref_db_fasta_fp = None , HALT_EXEC = False , min_div_ratio = None , keep_intermediates = False ) : files_to_remove = [ ] seqs_fp = str ( seqs_fp ) seqs_fp = seqs_fp . rstrip ( '"' ) seqs_fp = seqs_fp . lstrip ( '"' ) ( seqs_dir , new_seqs_fp ) = split ( seqs_fp ) if ( seqs_dir == '' ) : seqs_dir = './' params = { '--query_NAST' : new_seqs_fp , '--exec_dir' : seqs_dir } if ( ( ref_db_aligned_fp is None ) and ( ref_db_fasta_fp is None ) ) : pass else : if ( not ref_db_fasta_fp ) : ref_db_fasta_fp = write_degapped_fasta_to_file ( parse_fasta ( open ( ref_db_aligned_fp ) ) ) files_to_remove . append ( ref_db_fasta_fp ) params . update ( { '--db_NAST' : abspath ( ref_db_aligned_fp ) , '--db_FASTA' : abspath ( ref_db_fasta_fp ) } ) if ( min_div_ratio is not None ) : params . update ( { '-R' : min_div_ratio } ) app = ChimeraSlayer ( params = params , HALT_EXEC = HALT_EXEC ) app_results = app ( ) chimeras = parse_CPS_file ( app_results [ 'CPS' ] ) if ( not keep_intermediates ) : app . remove_intermediate_files ( ) remove_files ( files_to_remove ) return chimeras
remove chimeras from seqs_fp using chimeraslayer .