Ejemplo n.º 1
0
def DrawBaseStats(options, base_lens, base_freqs, log, min_mult):
    hist_name1 = os.path.join(options.output_dir, "base_seq_lens.png")
    len_hist_settings = drawing_utils.GetGraphicalSettings(
        xlabel="Sequence length",
        ylabel="# sequences",
        output_filename=hist_name1)
    drawing_utils.DrawHistogram(base_lens, len_hist_settings)
    if os.path.exists(hist_name1):
        log.info(
            "* Histogram of distribution of base sequence lengths was written to "
            + hist_name1)
    else:
        log.info(
            "ERROR: Histogram of distribution of base sequence lengths was not found"
        )
        sys.exit(1)

    hist_name2 = os.path.join(options.output_dir, "base_seq_freqs.png")
    freq_hist_settings = drawing_utils.GetGraphicalSettings(
        xlabel="Base sequence frequency (>" + str(min_mult) + ")",
        ylabel="# sequences",
        output_filename=hist_name2)
    drawing_utils.DrawHistogram(base_freqs, freq_hist_settings)
    if os.path.exists(hist_name2):
        log.info(
            "* Histogram of distribution of base sequence frequencies was written to "
            + hist_name2)
    else:
        log.info(
            "ERROR: Histogram of distribution of base sequence frequencies was not found"
        )
        sys.exit(1)
Ejemplo n.º 2
0
def DrawMutatedStats(options, mutated_freqs, mutation_pos, log, min_mult):
    hist_name1 = os.path.join(options.output_dir, "mutated_seq_freqs.png")
    freq_hist_settings = drawing_utils.GetGraphicalSettings(
        xlabel="Mutated sequence frequency (>" + str(min_mult) + ")",
        ylabel="# sequences",
        output_filename=hist_name1)
    drawing_utils.DrawHistogram(mutated_freqs, freq_hist_settings)
    if os.path.exists(hist_name1):
        log.info(
            "* Histogram of distribution of mutated sequence frequencies was written to "
            + hist_name1)
    else:
        log.info(
            "ERROR: Histogram of distribution of mutated sequence frequencies was not found"
        )
        sys.exit(1)

    hist_name2 = os.path.join(options.output_dir, "shm_positions.png")
    pos_hist_settings = drawing_utils.GetGraphicalSettings(
        xlabel="Relative SHM position",
        ylabel="# SHMs",
        output_filename=hist_name2)
    drawing_utils.DrawMutationHistogram(mutation_pos, pos_hist_settings,
                                        options.chain_type)
    if os.path.exists(hist_name2):
        log.info(
            "* Histogram of distribution of SHM positions was written to " +
            hist_name2)
    else:
        log.info(
            "ERROR: Histogram of distribution of SHM positions was not found")
        sys.exit(1)