<commit_before>package org.broadinstitute.sting.secondarybase;

import org.broadinstitute.sting.utils.BaseUtils;

/**
 * BasecallingStats is a utility class to aggregate and emit basecalling
 * stats (total bases seen and consistency between basecalling methods).
 *
 * @author <NAME>
 */
public class BasecallingStats {
    private int basesConsistent = 0;
    private int basesTotal = 0;
    private int readsTotal = 0;

    /**
     * Constructor that does nothing.
     */
    public BasecallingStats() {}

    /**
     * Return the number of bases called identically by two different methods.
     *
     * @return the number of consistent bases.
     */
    public int getBasesConsistent() {
        return basesConsistent;
    }

    /**
     * Return the total number of bases seen.
     *
     * @return the total number of bases seen.
     */
    public int getBasesTotal() {
        return basesTotal;
    }

    /**
     * Return the total number of reads seen.
     *
     * @return the total number of reads seen.
     */
    public int getReadsTotal() {
        return readsTotal;
    }

    /**
     * Return the percent of bases called consistently by two different methods.
     *
     * @return the percent of bases called consistently
     */
    public double getPercentConsistent() {
        return ((double) getBasesConsistent())/((double) getReadsTotal());
    }

    /**
     * Updates the number of bases seen, the number of reads seen, and the number of consistent bases.
     *
     * @param rr   the raw Illumina read
     * @param fpr  the FourProb read
     */
    public void update(RawRead rr, FourProbRead fpr, int updateInterval) {
        for (int cycle = 0; cycle < fpr.size(); cycle++) {
            int rawBaseIndex = BaseUtils.simpleBaseToBaseIndex((char) rr.getSequence()[cycle]);
            int fpBaseIndex = fpr.get(cycle).indexAtRank(0);

            if (rawBaseIndex >= 0 && fpBaseIndex >= 0) {<commit_msg>Whoops.  Changed denominator from reads to bases.<commit_after>package org.broadinstitute.sting.secondarybase;

import org.broadinstitute.sting.utils.BaseUtils;

/**
 * BasecallingStats is a utility class to aggregate and emit basecalling
 * stats (total bases seen and consistency between basecalling methods).
 *
 * @author <NAME>
 */
public class BasecallingStats {
    private int basesConsistent = 0;
    private int basesTotal = 0;
    private int readsTotal = 0;

    /**
     * Constructor that does nothing.
     */
    public BasecallingStats() {}

    /**
     * Return the number of bases called identically by two different methods.
     *
     * @return the number of consistent bases.
     */
    public int getBasesConsistent() {
        return basesConsistent;
    }

    /**
     * Return the total number of bases seen.
     *
     * @return the total number of bases seen.
     */
    public int getBasesTotal() {
        return basesTotal;
    }

    /**
     * Return the total number of reads seen.
     *
     * @return the total number of reads seen.
     */
    public int getReadsTotal() {
        return readsTotal;
    }

    /**
     * Return the percent of bases called consistently by two different methods.
     *
     * @return the percent of bases called consistently
     */
    public double getPercentConsistent() {
        return ((double) getBasesConsistent())/((double) getBasesTotal());
    }

    /**
     * Updates the number of bases seen, the number of reads seen, and the number of consistent bases.
     *
     * @param rr   the raw Illumina read
     * @param fpr  the FourProb read
     */
    public void update(RawRead rr, FourProbRead fpr, int updateInterval) {
        for (int cycle = 0; cycle < fpr.size(); cycle++) {
            int rawBaseIndex = BaseUtils.simpleBaseToBaseIndex((char) rr.getSequence()[cycle]);
            int fpBaseIndex = fpr.get(cycle).indexAtRank(0);

            if (rawBaseIndex >= 0 && fpBaseIndex >= 0) {
{'fraction_non_alphanumeric': 0.09238578680203045, 'fraction_numerical': 0.003553299492385787, 'mean_word_length': 2.4630931458699474, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4442379', 'n_tokens_mistral': 1112, 'n_tokens_neox': 1071, 'n_words': 378}