Esempio n. 1
0
def search(sphmm_directory, prot_family_name, cohort_name, nucl_seq_directory,
           prot_seq_directory, seq_fmt, pair_fmt, r1_file_suffix,
           r2_file_suffix, max_dist, min_samples, min_reads_bin, min_abund_bin,
           hmm_search_directory, blastn_search_directory,
           blast_db_directory_map_file, output_directory, cpu):
    logging.basicConfig(filename=os.path.join(output_directory, 'metabgc.log'),
                        level=logging.INFO)
    logging.info('Invoking MetaBGC search...')
    click.echo('Invoking MetaBGC search...')
    t0 = time()
    ident_reads_file = mbgcidentify(sphmm_directory, cohort_name,
                                    nucl_seq_directory, prot_seq_directory,
                                    seq_fmt, pair_fmt, r1_file_suffix,
                                    r2_file_suffix, prot_family_name,
                                    hmm_search_directory, output_directory,
                                    cpu)

    abund_file, abund_wide_table = mbgcquantify(
        ident_reads_file, prot_family_name, cohort_name, nucl_seq_directory,
        seq_fmt, pair_fmt, r1_file_suffix, r2_file_suffix,
        blast_db_directory_map_file, blastn_search_directory, output_directory,
        cpu)

    summary_file, cluster_file = mbgccluster(abund_file, abund_wide_table,
                                             ident_reads_file, max_dist,
                                             min_samples, min_reads_bin,
                                             min_abund_bin, cpu)
    click.echo('Cluster summary file: ' + summary_file)
    click.echo('Cluster detail file: ' + cluster_file)
    logging.info('Cluster summary file: ' + summary_file)
    logging.info('Cluster detail file: ' + cluster_file)
    t1 = time() - t0
    logging.info("Time elapsed: " + str(t1))
    logging.info("MetaBGC search complete...")
    click.echo("MetaBGC search complete...")
Esempio n. 2
0
def quantify(identify_fasta, prot_family_name, cohort_name, nucl_seq_directory,
             seq_fmt, pair_fmt, r1_file_suffix, r2_file_suffix,
             blastn_search_directory, output_directory, cpu):
    click.echo('Invoking MetaBGC Quantify...')
    abund_file = mbgcquantify(identify_fasta, prot_family_name, cohort_name,
                              nucl_seq_directory, seq_fmt, pair_fmt,
                              r1_file_suffix, r2_file_suffix,
                              blastn_search_directory, output_directory, cpu)
    print('Reads abundance file: ' + abund_file)
Esempio n. 3
0
def search(sphmm_directory, prot_family_name, cohort_name, nucl_seq_directory,
           prot_seq_directory, seq_fmt, pair_fmt, r1_file_suffix,
           r2_file_suffix, max_dist, min_samples, hmm_search_directory,
           blastn_search_directory, output_directory, cpu):
    click.echo('Invoking MetaBGC search...')
    ident_reads_file = mbgcidentify(sphmm_directory, cohort_name,
                                    nucl_seq_directory, prot_seq_directory,
                                    seq_fmt, pair_fmt, r1_file_suffix,
                                    r2_file_suffix, prot_family_name,
                                    hmm_search_directory, output_directory,
                                    cpu)

    abund_file = mbgcquantify(ident_reads_file, prot_family_name, cohort_name,
                              nucl_seq_directory, seq_fmt, pair_fmt,
                              r1_file_suffix, r2_file_suffix,
                              blastn_search_directory, output_directory, cpu)

    cluster_file = mbgccluster(abund_file, max_dist, min_samples, cpu)

    print('Clustered file: ' + cluster_file)