def METHOD_NAME(args):
    contigs_db_path = args.contigs_db
    profile_db_path = args.specific_profile_db
    fasta_path = args.contigs_fasta
    min_nt_freq = args.min_nt_frequency
    max_var_positions = args.max_variable_positions
    overwrite_out_dest = args.overwrite_output_destinations
    contigs_db_info = DBInfo(contigs_db_path, expecting='contigs')
    if contigs_db_info.variant != 'trnaseq':
        raise ConfigError("The provided contigs database must be a 'trnaseq' variant. "
                          f"Yours was a '{contigs_db_info.variant}' variant.")
    profile_db_info = DBInfo(profile_db_path, expecting='profile')
    if profile_db_info.variant != 'trnaseq':
        raise ConfigError("The provided profile database must be a 'trnaseq' variant. "
                          f"Yours was a '{profile_db_info.variant}' variant.")
    filesnpaths.is_output_file_writable(fasta_path, ok_if_exists=overwrite_out_dest)
    with contigs_db_info.load_db() as contigs_db:
        contig_names_seqs = contigs_db.get_table_as_list_of_tuples('contig_sequences')
    with profile_db_info.load_db() as profile_db:
        var_nts_gb = get_var_nts_gb(profile_db)
    fasta = open(fasta_path, 'w')
    write_entries_to_fasta = partial(write_entries, fasta=fasta)
    get_var_nts_dict_with_min_nt_freq = partial(get_var_nts_dict, min_nt_freq=min_nt_freq)
    seed_count = -1
    seed_total = len(contig_names_seqs)
    permut_seq_count = 0
    max_permut_seq_count = 0
    progress.new("Writing output")
    for contig_name, contig_seq in contig_names_seqs:
        seed_count += 1
        if seed_count % 100 == 0:
            progress.update(f"{seed_count}/{seed_total} seeds")
        try:
            contig_var_nts_df = var_nts_gb.get_group(contig_name)
        except KeyError:
            write_entries_to_fasta(contig_name, contig_seq)
            continue
        var_nts_dict = get_var_nts_dict_with_min_nt_freq(contig_var_nts_df)
        if not var_nts_dict:
            write_entries_to_fasta(contig_name, contig_seq)
            continue
        permut_contigs_info = get_permut_contigs_info(var_nts_dict, max_var_positions, contig_seq)
        remove_orig_contig(permut_contigs_info, contig_seq)
        permut_seq_count += len(permut_contigs_info)
        max_permut_seq_count = max(len(permut_contigs_info), max_permut_seq_count)
        write_entries_to_fasta(contig_name, contig_seq, permut_contigs_info=permut_contigs_info)
    progress.end()
    run.info("Mean permuted seqs per contig", round(permut_seq_count / seed_total, 1))
    run.info("Max permuted seqs from a contig", pp(max_permut_seq_count))