From c0dfcc4b472831d18f4c48a42e5bd41117d44e02 Mon Sep 17 00:00:00 2001 From: "cmzmasek@gmail.com" Date: Thu, 21 Mar 2013 16:43:38 +0000 Subject: [PATCH] allow length based removal of seqs for non aligned msa --- forester/ruby/evoruby/lib/evo/msa/msa.rb | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/forester/ruby/evoruby/lib/evo/msa/msa.rb b/forester/ruby/evoruby/lib/evo/msa/msa.rb index 69a1f30..631eab0 100644 --- a/forester/ruby/evoruby/lib/evo/msa/msa.rb +++ b/forester/ruby/evoruby/lib/evo/msa/msa.rb @@ -370,20 +370,17 @@ module Evoruby def remove_sequences_by_non_gap_length!( min_non_gap_length ) - if ( !is_aligned() ) - error_msg = "attempt to remove sequences by non gap length on unaligned msa" - raise StandardError, error_msg, caller - end n = get_number_of_seqs - l = get_length removed = Array.new for s in 0 ... n - if ( ( l - get_sequence( ( n - 1 ) - s ).get_gap_length ) < min_non_gap_length ) + x = ( n - 1 ) - s + seq = get_sequence( x ) + if ( ( seq.get_length - seq.get_gap_length ) < min_non_gap_length ) if ( Evoruby::Constants::VERBOSE ) - puts( "removed: " + get_sequence( ( n - 1 ) - s ).get_name ) + puts( "removed: " + seq.get_name ) end - removed << get_sequence( ( n - 1 ) - s ).get_name - remove_sequence!( ( n - 1 ) - s ) + removed << seq.get_name + remove_sequence!( x ) end end removed -- 1.7.10.2