Class: Orf

Inherits:
Object
  • Object
show all
Defined in:
lib/full_lengther_next/classes/orf.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(orf_seq, t_start, t_end, frame, stop_codon, type) ⇒ Orf

Returns a new instance of Orf.



6
7
8
9
10
11
12
13
14
15
16
# File 'lib/full_lengther_next/classes/orf.rb', line 6

def initialize(orf_seq, t_start, t_end, frame, stop_codon, type)
	@seq=orf_seq
	@t_start=t_start
	@t_end=t_end
	@frame=frame
	@stop_codon=stop_codon
	@type=type # :N_terminus,:C_terminus,:Complete,:Internal,:Putative_Complete,:Putative_N_terminus
	@status = :unknown # :unknown,:putative_coding,:coding
	@score = 0
	@more_than_one_frame = false
end

Instance Attribute Details

#frameObject

Returns the value of attribute frame.



4
5
6
# File 'lib/full_lengther_next/classes/orf.rb', line 4

def frame
  @frame
end

#more_than_one_frameObject

Returns the value of attribute more_than_one_frame.



4
5
6
# File 'lib/full_lengther_next/classes/orf.rb', line 4

def more_than_one_frame
  @more_than_one_frame
end

#scoreObject

Returns the value of attribute score.



4
5
6
# File 'lib/full_lengther_next/classes/orf.rb', line 4

def score
  @score
end

#seqObject

Returns the value of attribute seq.



4
5
6
# File 'lib/full_lengther_next/classes/orf.rb', line 4

def seq
  @seq
end

#statusObject

Returns the value of attribute status.



4
5
6
# File 'lib/full_lengther_next/classes/orf.rb', line 4

def status
  @status
end

#stop_codonObject

Returns the value of attribute stop_codon.



4
5
6
# File 'lib/full_lengther_next/classes/orf.rb', line 4

def stop_codon
  @stop_codon
end

#t_endObject

Returns the value of attribute t_end.



4
5
6
# File 'lib/full_lengther_next/classes/orf.rb', line 4

def t_end
  @t_end
end

#t_startObject

Returns the value of attribute t_start.



4
5
6
# File 'lib/full_lengther_next/classes/orf.rb', line 4

def t_start
  @t_start
end

#typeObject

Returns the value of attribute type.



4
5
6
# File 'lib/full_lengther_next/classes/orf.rb', line 4

def type
  @type
end

Instance Method Details

#overlaps?(other_orf) ⇒ Boolean

Returns:

  • (Boolean)


18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/full_lengther_next/classes/orf.rb', line 18

def overlaps?(other_orf)
	overlap_status = false
	i1 = self.t_start
	i2 = other_orf.t_start
	e1 = self.t_end
	e2 = other_orf.t_end
	
	if (e1 > i2) && (e1 < e2)
		overlap_status = true
	end
	
	return overlap_status
end