<commit_before>define([
           'dojo/_base/declare',
           'dojo/_base/array',
           'dojo/Deferred',
           'JBrowse/Errors',
           'JBrowse/Store/SeqFeature/GlobalStatsEstimationMixin'
       ],
       function( declare, array, Deferred, Errors, GlobalStats ) {

return declare( GlobalStats, {

    /**
     * Fetch a region of the current reference sequence and use it to
     * estimate the feature density of the store.
     * @private
     */
    async _estimateGlobalStats(refseq) {
        refseq = refseq || this.refSeq
        let featCount
        if (this.indexedData) {
            featCount = await this.indexedData.featureCount(refseq.name)
        } else if (this.bam) {
            const chr = this.browser.regularizeReferenceName(refseq.name)
            const chrId = this.bam.chrToIndex && this.bam.chrToIndex[chr]
            featCount = await this.bam.index.featureCount(chrId, true)
        } else if (this.bam) {
            const chr = this.browser.regularizeReferenceName(refseq.name)
            const chrId = this.bam.chrToIndex && this.bam.chrToIndex[chr]
			featCount = await this.bam.index.lineCount(chrId, true)
        }
        if (featCount == -1) {
            return this.inherited('_estimateGlobalStats', arguments)
        }
        const correctionFactor = (this.getConf('topLevelFeaturesPercent') || 100) / 100
        const featureDensity = featCount / (refseq.end - refseq.start) * correctionFactor
        return { featureDensity }
    }

});
});<commit_msg>Retab [skip ci]<commit_after>define([
           'dojo/_base/declare',
           'dojo/_base/array',
           'dojo/Deferred',
           'JBrowse/Errors',
           'JBrowse/Store/SeqFeature/GlobalStatsEstimationMixin'
       ],
       function( declare, array, Deferred, Errors, GlobalStats ) {

return declare( GlobalStats, {

    /**
     * Fetch a region of the current reference sequence and use it to
     * estimate the feature density of the store.
     * @private
     */
    async _estimateGlobalStats(refseq) {
        refseq = refseq || this.refSeq
        let featCount
        if (this.indexedData) {
            featCount = await this.indexedData.featureCount(refseq.name)
        } else if (this.bam) {
            const chr = this.browser.regularizeReferenceName(refseq.name)
            const chrId = this.bam.chrToIndex && this.bam.chrToIndex[chr]
            featCount = await this.bam.index.lineCount(chrId, true)
        }
        if (featCount == -1) {
            return this.inherited('_estimateGlobalStats', arguments)
        }
        const correctionFactor = (this.getConf('topLevelFeaturesPercent') || 100) / 100
        const featureDensity = featCount / (refseq.end - refseq.start) * correctionFactor
        return { featureDensity }
    }

});
});
{'fraction_non_alphanumeric': 0.10707933119886162, 'fraction_numerical': 0.004980434009249377, 'mean_word_length': 2.2735739231664724, 'pattern_counts': {'":': 0, '<': 3, '<?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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5829532', 'n_tokens_mistral': 843, 'n_tokens_neox': 820, 'n_words': 176}