Sha256: f9a29d611a60e017bd93f4bb2eadde574df86eed00d02dc1d01a13a4308a6cfa

Contents?: true

Size: 738 Bytes

Versions: 11

Compression:

Stored size: 738 Bytes

Contents

module SequenceServer
  # Define BLAST::Query.
  module BLAST
    # Capture results per query of a BLAST search.
    # @member [String]     number
    # @member [String]     def
    # @member [Fixnum]     length
    # @member [Array(Hit)] hits
    Query = Struct.new(:report, :number, :def, :length, :hits) do
      def initialize(*args)
        args[1] = args[1].to_i
        args[2] = "Query_#{args[1]}" if args[2] == 'No definition line'
        args[3] = args[3].to_i
        @id, *rest = args[2].split
        @title = rest.join(' ')
        super
      end

      def sort_hits_by_evalue!
        # change made here
        @hits = hits.sort_by { |h| [h.evalue, h.score] }
      end

      attr_reader :id, :title
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
sequenceserver-1.0.14 lib/sequenceserver/blast/query.rb
sequenceserver-1.0.13 lib/sequenceserver/blast/query.rb
sequenceserver-1.0.12 lib/sequenceserver/blast/query.rb
sequenceserver-1.0.11 lib/sequenceserver/blast/query.rb
sequenceserver-1.0.10 lib/sequenceserver/blast/query.rb
sequenceserver-1.0.9 lib/sequenceserver/blast/query.rb
sequenceserver-1.0.8 lib/sequenceserver/blast/query.rb
sequenceserver-1.0.7 lib/sequenceserver/blast/query.rb
sequenceserver-1.0.6 lib/sequenceserver/blast/query.rb
sequenceserver-1.0.5 lib/sequenceserver/blast/query.rb
sequenceserver-1.0.4 lib/sequenceserver/blast/query.rb