<commit_before>define( ['dojo/_base/declare',
         'dojo/_base/array',
         'JBrowse/View/Track/Wiggle',
         'JBrowse/Util'
        ],
        function( declare, array, Wiggle, Util ) {

// feature class for the features we make for the calculated coverage
// values
var CoverageFeature = Util.fastDeclare(
    {
        get: function(f) { return this[f]; },
        tags: function() { return [ 'start', 'end', 'score' ]; },
        score: 0,
        constructor: function( args ) {
            this.start = args.start;
            this.end = args.end;
            this.score = args.score;
        }
    });

return declare( Wiggle,
{
    getGlobalStats: function() {
        return {};
    },

    getFeatures: function( query, featureCallback, finishCallback, errorCallback ) {
        var leftBase  = query.start;
        var rightBase = query.end;
        var coverage = new Array( rightBase-leftBase );
        this.store.getFeatures(
            query,
            dojo.hitch( this, function( feature ) {
                            var end = feature.get('end');
                            for( var i = feature.get('start')+1; i <= end; i++ ) {
                                coverage[i-leftBase] = (coverage[i-leftBase] || 0) + 1;
                            }
                        }),
            function () {
                // make fake features from the coverage
                var currFeat;
                array.forEach( coverage, function( c, i ) {
                    if( currFeat && c == currFeat.score ) {
                            currFeat.end = leftBase+i;
                    } else {
                        if( currFeat )
                            featureCallback( currFeat );
                        currFeat = new CoverageFeature({ start: leftBase + i - 1, end: leftBase+i, score: c || 0 });
                    }
                });

                finishCallback();
            }
        );
    }
});
});<commit_msg>make FeatureCoverage tracks have a default min_score of 0<commit_after>define( ['dojo/_base/declare',
         'dojo/_base/array',
         'JBrowse/View/Track/Wiggle',
         'JBrowse/Util'
        ],
        function( declare, array, Wiggle, Util ) {

// feature class for the features we make for the calculated coverage
// values
var CoverageFeature = Util.fastDeclare(
    {
        get: function(f) { return this[f]; },
        tags: function() { return [ 'start', 'end', 'score' ]; },
        score: 0,
        constructor: function( args ) {
            this.start = args.start;
            this.end = args.end;
            this.score = args.score;
        }
    });

return declare( Wiggle,
{

    _defaultConfig: function() {
        return Util.deepUpdate(
            dojo.clone( this.inherited(arguments) ),
            {
                min_score: 0
            }
        );
    },

    getGlobalStats: function() {
        return {};
    },

    getFeatures: function( query, featureCallback, finishCallback, errorCallback ) {
        var leftBase  = query.start;
        var rightBase = query.end;
        var coverage = new Array( rightBase-leftBase );
        this.store.getFeatures(
            query,
            dojo.hitch( this, function( feature ) {
                            var end = feature.get('end');
                            for( var i = feature.get('start')+1; i <= end; i++ ) {
                                coverage[i-leftBase] = (coverage[i-leftBase] || 0) + 1;
                            }
                        }),
            function () {
                // make fake features from the coverage
                var currFeat;
                array.forEach( coverage, function( c, i ) {
                    if( currFeat && c == currFeat.score ) {
                            currFeat.end = leftBase+i;
                    } else {
                        if( currFeat )
                            featureCallback( currFeat );
                        currFeat = new CoverageFeature({ start: leftBase + i - 1, end: leftBase+i, score: c || 0 });
                    }
                });

                finishCallback();
            }
        );
    }
});
});
{'fraction_non_alphanumeric': 0.11646297627606039, 'fraction_numerical': 0.0033549005511622335, 'mean_word_length': 1.295929592959296, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3421307', 'n_tokens_mistral': 1142, 'n_tokens_neox': 1103, 'n_words': 270}