def clusterization_by_length(_debug = false,
                                 lst = @hits,
                                 predicted_seq = @prediction)
      raise TypeError unless lst[0].is_a?(Query) && predicted_seq.is_a?(Query)

      contents = lst.map { |x| x.length_protein.to_i }.sort { |a, b| a <=> b }

      hc = HierarchicalClusterization.new(contents)
      clusters = hc.hierarchical_clusterization

      max_density             = 0
      max_density_cluster_idx = 0
      clusters.each_with_index do |item, i|
        next unless item.density > max_density
        max_density             = item.density
        max_density_cluster_idx = i
      end

      [clusters, max_density_cluster_idx]
    rescue TypeError => error
      error_location = error.backtrace[0].scan(%r{([^/]+:\d+):.*})[0][0]
      warn "Type error at #{error_location}."
      warn ' Possible cause: one of the arguments of the' \
                   ' "clusterization_by_length" method has not the proper type.'
      exit 1
    end
def clusterization_by_length(_debug = false,
                                 lst = @hits,
                                 predicted_seq = @prediction)
      raise TypeError unless lst[0].is_a?(Query) && predicted_seq.is_a?(Query)

      contents = lst.map { |x| x.length_protein.to_i }.sort { |a, b| a <=> b }

      hc = HierarchicalClusterization.new(contents)
      clusters = hc.hierarchical_clusterization

      max_density             = 0
      max_density_cluster_idx = 0
      clusters.each_with_index do |item, i|
        next unless item.density > max_density
        max_density             = item.density
        max_density_cluster_idx = i
      end

      [clusters, max_density_cluster_idx]
    rescue TypeError => error
      error_location = error.backtrace[0].scan(%r{([^/]+:\d+):.*})[0][0]
      warn "Type error at #{error_location}."
      warn ' Possible cause: one of the arguments of the' \
                   ' "clusterization_by_length" method has not the proper type.'
      exit 1
    end
Clusterization by length from a list of sequences
 Params:
 +debug+ (optional):: true to display debug information, false by default
 +lst+:: array of +Query+ objects
 +predicted_seq+:: +Query+ objetc
 Output
 output 1:: array of Cluster objects
 output 2:: the index of the most dense cluster