Module: Bio::BioAlignment::MarkRows

Included in:
DelNonInformativeSequences, DelShortSequences, MaskIslands, MaskSerialMutations
Defined in:
lib/bio-alignment/edit/edit_rows.rb

Overview

Function for marking rows (sequences), when a row block returns the new state, and returning a newly cloned alignment

Instance Method Summary collapse

Instance Method Details

#mark_row_elements(&block) ⇒ Object

allow the marking of elements in a copied alignment, making sure each element is a proper Element object that can contain state. A Sequence alignment will be turned into an Elements alignment.



20
21
22
23
24
25
26
27
# File 'lib/bio-alignment/edit/edit_rows.rb', line 20

def mark_row_elements &block
  aln = markrows_clone
  aln.rows.each_with_index do | row,rownum |
    new_seq = block.call(row.to_elements,rownum)
    aln.rows[rownum] = new_seq
  end
  aln
end

#mark_rows(&block) ⇒ Object

Mark each seq



9
10
11
12
13
14
15
# File 'lib/bio-alignment/edit/edit_rows.rb', line 9

def mark_rows &block
  aln = markrows_clone
  aln.rows.each do | row |
    row.state = block.call(row.state,row)
  end
  aln
end