Class: SequenceServer::BLAST::HSP

Inherits:
Struct
  • Object
show all
Defined in:
lib/sequenceserver/blast/hsp.rb

Overview

Structure to hold data for each HSP.

Constant Summary collapse

INTEGER_ARGS =
[1, 3].concat((5..15).to_a).freeze
FLOAT_ARGS =
[2, 4].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ HSP

Returns a new instance of HSP.



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/sequenceserver/blast/hsp.rb', line 11

def initialize(*args)
  INTEGER_ARGS.each do |i|
    args[i] = args[i].to_i
  end

  FLOAT_ARGS.each do |i|
    args[i] = args[i].to_f
  end

  super
end

Instance Attribute Details

#bit_scoreObject

Returns the value of attribute bit_score

Returns:

  • (Object)

    the current value of bit_score



5
6
7
# File 'lib/sequenceserver/blast/hsp.rb', line 5

def bit_score
  @bit_score
end

#evalueObject

Returns the value of attribute evalue

Returns:

  • (Object)

    the current value of evalue



5
6
7
# File 'lib/sequenceserver/blast/hsp.rb', line 5

def evalue
  @evalue
end

#gapsObject

Returns the value of attribute gaps

Returns:

  • (Object)

    the current value of gaps



5
6
7
# File 'lib/sequenceserver/blast/hsp.rb', line 5

def gaps
  @gaps
end

#hitObject

Returns the value of attribute hit

Returns:

  • (Object)

    the current value of hit



5
6
7
# File 'lib/sequenceserver/blast/hsp.rb', line 5

def hit
  @hit
end

#identityObject

Returns the value of attribute identity

Returns:

  • (Object)

    the current value of identity



5
6
7
# File 'lib/sequenceserver/blast/hsp.rb', line 5

def identity
  @identity
end

#lengthObject

Returns the value of attribute length

Returns:

  • (Object)

    the current value of length



5
6
7
# File 'lib/sequenceserver/blast/hsp.rb', line 5

def length
  @length
end

#midlineObject

Returns the value of attribute midline

Returns:

  • (Object)

    the current value of midline



5
6
7
# File 'lib/sequenceserver/blast/hsp.rb', line 5

def midline
  @midline
end

#numberObject

Returns the value of attribute number

Returns:

  • (Object)

    the current value of number



5
6
7
# File 'lib/sequenceserver/blast/hsp.rb', line 5

def number
  @number
end

#positivesObject

Returns the value of attribute positives

Returns:

  • (Object)

    the current value of positives



5
6
7
# File 'lib/sequenceserver/blast/hsp.rb', line 5

def positives
  @positives
end

#qcovhspObject

Returns the value of attribute qcovhsp

Returns:

  • (Object)

    the current value of qcovhsp



5
6
7
# File 'lib/sequenceserver/blast/hsp.rb', line 5

def qcovhsp
  @qcovhsp
end

#qendObject

Returns the value of attribute qend

Returns:

  • (Object)

    the current value of qend



5
6
7
# File 'lib/sequenceserver/blast/hsp.rb', line 5

def qend
  @qend
end

#qframeObject

Returns the value of attribute qframe

Returns:

  • (Object)

    the current value of qframe



5
6
7
# File 'lib/sequenceserver/blast/hsp.rb', line 5

def qframe
  @qframe
end

#qseqObject

Returns the value of attribute qseq

Returns:

  • (Object)

    the current value of qseq



5
6
7
# File 'lib/sequenceserver/blast/hsp.rb', line 5

def qseq
  @qseq
end

#qstartObject

Returns the value of attribute qstart

Returns:

  • (Object)

    the current value of qstart



5
6
7
# File 'lib/sequenceserver/blast/hsp.rb', line 5

def qstart
  @qstart
end

#scoreObject

Returns the value of attribute score

Returns:

  • (Object)

    the current value of score



5
6
7
# File 'lib/sequenceserver/blast/hsp.rb', line 5

def score
  @score
end

#sendObject

Returns the value of attribute send

Returns:

  • (Object)

    the current value of send



5
6
7
# File 'lib/sequenceserver/blast/hsp.rb', line 5

def send
  @send
end

#sframeObject

Returns the value of attribute sframe

Returns:

  • (Object)

    the current value of sframe



5
6
7
# File 'lib/sequenceserver/blast/hsp.rb', line 5

def sframe
  @sframe
end

#sseqObject

Returns the value of attribute sseq

Returns:

  • (Object)

    the current value of sseq



5
6
7
# File 'lib/sequenceserver/blast/hsp.rb', line 5

def sseq
  @sseq
end

#sstartObject

Returns the value of attribute sstart

Returns:

  • (Object)

    the current value of sstart



5
6
7
# File 'lib/sequenceserver/blast/hsp.rb', line 5

def sstart
  @sstart
end

Instance Method Details

#to_json(*args) ⇒ Object



23
24
25
26
27
28
29
30
# File 'lib/sequenceserver/blast/hsp.rb', line 23

def to_json(*args)
  %i[number bit_score score evalue qstart qend
     sstart send qframe sframe identity positives
     gaps length qcovhsp qseq sseq midline].inject({}) { |h, k|
    h[k] = self[k]
    h
  }.to_json(*args)
end