Class: Bio::Sequence::NA

Inherits:
Object
  • Object
show all
Defined in:
lib/bio/sequence/na/na.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#mut_posObject

Returns the value of attribute mut_pos.



2
3
4
# File 'lib/bio/sequence/na/na.rb', line 2

def mut_pos
  @mut_pos
end

Instance Method Details

#dist_from_polvsObject

return an array of distances from each polv



53
54
55
# File 'lib/bio/sequence/na/na.rb', line 53

def dist_from_polvs
  [polv1_dna_pos, polv2_dna_pos, polv3_dna_pos, polv4_dna_pos]
end

#polv1_dna_posObject



36
37
38
# File 'lib/bio/sequence/na/na.rb', line 36

def polv1_dna_pos
  mut_pos.map{|mut| mut - (aa_seq.polv1_pos * 3)}
end

#polv2_dna_posObject



40
41
42
# File 'lib/bio/sequence/na/na.rb', line 40

def polv2_dna_pos
  mut_pos.map{|mut| mut - (aa_seq.polv2_pos * 3)}
end

#polv3_dna_posObject



44
45
46
# File 'lib/bio/sequence/na/na.rb', line 44

def polv3_dna_pos
  mut_pos.map{|mut| mut - (aa_seq.polv3_pos * 3)}
end

#polv4_dna_posObject



48
49
50
# File 'lib/bio/sequence/na/na.rb', line 48

def polv4_dna_pos
  mut_pos.map{|mut| mut - (aa_seq.polv4_pos * 3)}
end

#pspb1_dna(anchor_pos = 0, win_len = 42) ⇒ Object

position specific polymorphic block 1



5
6
7
# File 'lib/bio/sequence/na/na.rb', line 5

def pspb1_dna(anchor_pos=0,win_len=42)
  self[42 + anchor_pos,win_len]
end

#pspb2_dna(anchor_pos = 0, win_len = 42) ⇒ Object

position specific polymorphic block 2



10
11
12
13
14
15
16
17
18
# File 'lib/bio/sequence/na/na.rb', line 10

def pspb2_dna(anchor_pos=0,win_len=42)
  if !ww_missing?
    return self[(ww_pos * 3) - 12 - anchor_pos - win_len, win_len]
  elsif !vw_missing?
    return self[(vw_pos * 3) - 36 - win_len - anchor_pos, win_len]
  else
    return '....'
  end
end

#pspb3_dna(anchor_pos = 0, win_len = 42) ⇒ Object

position specific polymorphic block 3



21
22
23
24
25
26
27
28
29
# File 'lib/bio/sequence/na/na.rb', line 21

def pspb3_dna(anchor_pos=0,win_len=42)
  if !ww_missing?
    return self[(ww_pos * 3) + 42 + anchor_pos, win_len]
  elsif !vw_missing?
    return self[(vw_pos * 3) + 8 + anchor_pos, win_len]
  else
    return '....'
  end
end

#pspb4_dna(anchor_pos = 0, win_len = 42) ⇒ Object

position specific polymorphic block 4



32
33
34
# File 'lib/bio/sequence/na/na.rb', line 32

def pspb4_dna(anchor_pos=0,win_len=42)
  self[self.length - 36 - win_len - anchor_pos, win_len]
end