<commit_before>module Transrate

  # This class is currently only used to calculate the basic transrate score.
  # In future it will be used to automatically optimised the score by
  # taking the optimal subset of contigs.
  class ScoreOptimiser

    def initialize assembly, read_metrics
      @assembly = assembly
      read_stats = read_metrics.read_stats
      total = read_stats[:fragments]
      good = read_stats[:good_mappings]
      raw_score
      @score = Score.new @contig_score, good, total
    end

    def raw_score
      @contig_score = geomean assembly.assembly.values.map do |contig|
        contig.score
      end
      @contig_score * (@good / @total.to_f)
    end

  end # ScoreOptimiser

end
<commit_msg>refer to assembly ivar in scoreoptimiser<commit_after>module Transrate

  # This class is currently only used to calculate the basic transrate score.
  # In future it will be used to automatically optimised the score by
  # taking the optimal subset of contigs.
  class ScoreOptimiser

    def initialize assembly, read_metrics
      @assembly = assembly
      read_stats = read_metrics.read_stats
      total = read_stats[:fragments]
      good = read_stats[:good_mappings]
      raw_score
      @score = Score.new @contig_score, good, total
    end

    def raw_score
      @contig_score = geomean @assembly.assembly.values.map do |contig|
        contig.score
      end
      @contig_score * (@good / @total.to_f)
    end

  end # ScoreOptimiser

end

{'fraction_non_alphanumeric': 0.06013513513513514, 'fraction_numerical': 0.0, 'mean_word_length': 2.9598930481283423, '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': '3375839', 'n_tokens_mistral': 438, 'n_tokens_neox': 430, 'n_words': 143}