Class: GeneValidator::Query

Inherits:
Object
  • Object
show all
Defined in:
lib/genevalidator/query.rb

Overview

This is a class for the storing data on each sequence

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeQuery

Returns a new instance of Query.



17
18
19
20
21
22
# File 'lib/genevalidator/query.rb', line 17

def initialize
  @hsp_list            = []
  @raw_sequence        = nil
  @protein_translation = nil
  @nucleotide_rf       = nil
end

Instance Attribute Details

#accession_noObject

Returns the value of attribute accession_no.



8
9
10
# File 'lib/genevalidator/query.rb', line 8

def accession_no
  @accession_no
end

#definitionObject

Returns the value of attribute definition.



5
6
7
# File 'lib/genevalidator/query.rb', line 5

def definition
  @definition
end

#hsp_listObject

array of Hsp objects



11
12
13
# File 'lib/genevalidator/query.rb', line 11

def hsp_list
  @hsp_list
end

#identifierObject

Returns the value of attribute identifier.



6
7
8
# File 'lib/genevalidator/query.rb', line 6

def identifier
  @identifier
end

#length_proteinObject

Returns the value of attribute length_protein.



9
10
11
# File 'lib/genevalidator/query.rb', line 9

def length_protein
  @length_protein
end

#nucleotide_rfObject

used only for nucleotides



15
16
17
# File 'lib/genevalidator/query.rb', line 15

def nucleotide_rf
  @nucleotide_rf
end

#protein_translationObject

used only for nucleotides



14
15
16
# File 'lib/genevalidator/query.rb', line 14

def protein_translation
  @protein_translation
end

#raw_sequenceObject

Returns the value of attribute raw_sequence.



13
14
15
# File 'lib/genevalidator/query.rb', line 13

def raw_sequence
  @raw_sequence
end

#reading_frameObject

Returns the value of attribute reading_frame.



10
11
12
# File 'lib/genevalidator/query.rb', line 10

def reading_frame
  @reading_frame
end

#speciesObject

Returns the value of attribute species.



7
8
9
# File 'lib/genevalidator/query.rb', line 7

def species
  @species
end

#typeObject

protein | mRNA



4
5
6
# File 'lib/genevalidator/query.rb', line 4

def type
  @type
end

Instance Method Details

#init_tabular_attribute(hash) ⇒ Object

Initializes the corresponding attribute of the sequence with respect to the column name of the tabular blast output



31
32
33
34
35
# File 'lib/genevalidator/query.rb', line 31

def init_tabular_attribute(hash)
  @identifier     = hash['sseqid'] if hash['sseqid']
  @accession_no   = hash['sacc'] if hash['sacc']
  @length_protein = hash['slen'].to_i if hash['slen']
end