Class: Bio::Sequence::NA
- Inherits:
-
Object
- Object
- Bio::Sequence::NA
- Defined in:
- lib/bio/sequence/na/na.rb
Instance Attribute Summary collapse
-
#mut_pos ⇒ Object
Returns the value of attribute mut_pos.
Instance Method Summary collapse
-
#dist_from_polvs ⇒ Object
return an array of distances from each polv.
- #polv1_dna_pos ⇒ Object
- #polv2_dna_pos ⇒ Object
- #polv3_dna_pos ⇒ Object
- #polv4_dna_pos ⇒ Object
-
#pspb1_dna(anchor_pos = 0, win_len = 42) ⇒ Object
position specific polymorphic block 1.
-
#pspb2_dna(anchor_pos = 0, win_len = 42) ⇒ Object
position specific polymorphic block 2.
-
#pspb3_dna(anchor_pos = 0, win_len = 42) ⇒ Object
position specific polymorphic block 3.
-
#pspb4_dna(anchor_pos = 0, win_len = 42) ⇒ Object
position specific polymorphic block 4.
Instance Attribute Details
#mut_pos ⇒ Object
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_polvs ⇒ Object
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_pos ⇒ Object
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_pos ⇒ Object
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_pos ⇒ Object
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_pos ⇒ Object
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 |