<commit_before>package org.broadinstitute.sting.playground.gatk.walkers;

import org.broadinstitute.sting.gatk.walkers.LocusWalker;
import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker;
import org.broadinstitute.sting.gatk.contexts.ReferenceContext;
import org.broadinstitute.sting.gatk.contexts.AlignmentContext;
import org.broadinstitute.sting.utils.ReadBackedPileup;
import org.broadinstitute.sting.utils.BaseUtils;
import org.broadinstitute.sting.utils.BasicPileup;

/**
 * Created by IntelliJ IDEA.
 * User: chartl
 * Date: Oct 28, 2009
 * Time: 3:19:48 PM
 * To change this template use File | Settings | File Templates.
 */
public class IndelCounterWalker extends LocusWalker<Integer,Integer> {

    public Integer reduceInit() {
        return 0;
    }

    public Integer reduce( Integer prevReduce, Integer map ) {
        return map + prevReduce;
    }

    public Integer treeReduce( Integer reduce1, Integer reduce2 ) {
        return reduce(reduce1,reduce2);
    }

    public Integer map ( RefMetaDataTracker tracker, ReferenceContext ref, AlignmentContext context ) {
        if (BaseUtils.isRegularBase(ref.getBase()) ) {
            return numIndels(context);
        } else {
            return 0;
        }
    }

    public Integer numIndels ( AlignmentContext context ) {
        String[] indelPileup = BasicPileup.indelPileup(context.getReads(),context.getOffsets());<commit_msg>Whoops. Forgot the implements.<commit_after>package org.broadinstitute.sting.playground.gatk.walkers;

import org.broadinstitute.sting.gatk.walkers.LocusWalker;
import org.broadinstitute.sting.gatk.walkers.TreeReducible;
import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker;
import org.broadinstitute.sting.gatk.contexts.ReferenceContext;
import org.broadinstitute.sting.gatk.contexts.AlignmentContext;
import org.broadinstitute.sting.utils.ReadBackedPileup;
import org.broadinstitute.sting.utils.BaseUtils;
import org.broadinstitute.sting.utils.BasicPileup;

/**
 * Created by IntelliJ IDEA.
 * User: chartl
 * Date: Oct 28, 2009
 * Time: 3:19:48 PM
 * To change this template use File | Settings | File Templates.
 */
public class IndelCounterWalker extends LocusWalker<Integer,Integer> implements TreeReducible<Integer> {

    public Integer reduceInit() {
        return 0;
    }

    public Integer reduce( Integer prevReduce, Integer map ) {
        return map + prevReduce;
    }

    public Integer treeReduce(Integer lhs, Integer rhs) {
        return reduce(lhs,rhs);
    }

    public Integer map ( RefMetaDataTracker tracker, ReferenceContext ref, AlignmentContext context ) {
        if (BaseUtils.isRegularBase(ref.getBase()) ) {
            return numIndels(context);
        } else {
            return 0;
        }
    }

    public Integer numIndels ( AlignmentContext context ) {
        String[] indelPileup = BasicPileup.indelPileup(context.getReads(),context.getOffsets());
{'fraction_non_alphanumeric': 0.09386776293251113, 'fraction_numerical': 0.010277492291880781, 'mean_word_length': 3.8105436573311366, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, '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': '833433', 'n_tokens_mistral': 930, 'n_tokens_neox': 890, 'n_words': 187}