def run
      raise NotEnoughHitsError if hits.length < opt[:min_blast_hits]
      raise unless prediction.is_a?(Query) && hits[0].is_a?(Query)

      start = Time.now
      # get [clusters, max_density_cluster_idx]
      clusterization = clusterization_by_length

      @clusters = clusterization[0]
      @max_density_cluster = clusterization[1]
      limits = @clusters[@max_density_cluster].get_limits
      query_length = @prediction.length_protein

      @validation_report = LengthClusterValidationOutput.new(@short_header,
                                                             @header,
                                                             @description,
                                                             query_length,
                                                             limits)
      plot1 = plot_histo_clusters
      @validation_report.plot_files.push(plot1)

      @validation_report.run_time = Time.now - start

      @validation_report
    rescue NotEnoughHitsError
      @validation_report = ValidationReport.new('Not enough evidence', :warning,
                                                @short_header, @header,
                                                @description)
    rescue StandardError
      @validation_report = ValidationReport.new('Unexpected error', :error,
                                                @short_header, @header,
                                                @description)
      @validation_report.errors.push 'Unexpected Error'
    end
def run
      raise NotEnoughHitsError if hits.length < opt[:min_blast_hits]
      raise unless prediction.is_a?(Query) && hits[0].is_a?(Query)

      start = Time.now
      # get [clusters, max_density_cluster_idx]
      clusterization = clusterization_by_length

      @clusters = clusterization[0]
      @max_density_cluster = clusterization[1]
      limits = @clusters[@max_density_cluster].get_limits
      query_length = @prediction.length_protein

      @validation_report = LengthClusterValidationOutput.new(@short_header,
                                                             @header,
                                                             @description,
                                                             query_length,
                                                             limits)
      plot1 = plot_histo_clusters
      @validation_report.plot_files.push(plot1)

      @validation_report.run_time = Time.now - start

      @validation_report
    rescue NotEnoughHitsError
      @validation_report = ValidationReport.new('Not enough evidence', :warning,
                                                @short_header, @header,
                                                @description)
    rescue StandardError
      @validation_report = ValidationReport.new('Unexpected error', :error,
                                                @short_header, @header,
                                                @description)
      @validation_report.errors.push 'Unexpected Error'
    end
Initilizes the object
 Params:
 +type+: type of the predicted sequence (:nucleotide or :protein)
 +prediction+: a +Sequence+ object representing the blast query
 +hits+: a vector of +Sequence+ objects (representing blast hits)
 +dilename+: +String+ with the name of the fasta file

 Validates the length of the predicted gene by comparing the length
 of the prediction to the most dense cluster
 The most dense cluster is obtained by hierarchical clusterization
 Plots are generated if required (see +plot+ variable)
 Output:
 +LengthClusterValidationOutput+ object