Module: Bio::BioAlignment::DelBridges
- Includes:
- MarkColumns
- Defined in:
- lib/bio-alignment/edit/del_bridges.rb
Instance Method Summary collapse
-
#del_bridges(percentage = 30) ⇒ Object
Return an alignment with the bridges removed.
-
#mark_bridges(percentage = 30) ⇒ Object
Return a new alignment with columns marked for deletion, i.e.
Methods included from MarkColumns
Instance Method Details
#del_bridges(percentage = 30) ⇒ Object
Return an alignment with the bridges removed
23 24 25 |
# File 'lib/bio-alignment/edit/del_bridges.rb', line 23 def del_bridges percentage=30 mark_bridges.columns_where { |col| !col.state.deleted? } end |
#mark_bridges(percentage = 30) ⇒ Object
Return a new alignment with columns marked for deletion, i.e. mark columns that mostly contain gaps (threshold percentage
). The alignment returned is a cloned copy
12 13 14 15 16 17 18 19 20 |
# File 'lib/bio-alignment/edit/del_bridges.rb', line 12 def mark_bridges percentage = 30 mark_columns { |state,column| num = column.count { |e| e.gap? or e.undefined? } if (num.to_f/column.length) > 1.0-percentage/100.0 state.delete! end state } end |