- synchronized final public static void removeGapColumns( final double max_allowed_gap_ratio, final DeleteableMsa msa ) {
- if ( ( max_allowed_gap_ratio < 0 ) || ( max_allowed_gap_ratio > 1 ) ) {
- throw new IllegalArgumentException( "max allowed gap ration is out of range: " + max_allowed_gap_ratio );
- }
- // final boolean ignore_too_short_seqs = min_allowed_length > 0;
- for( int col = msa.getLength() - 1; col >= 0 ; --col ) {
- final boolean delete = ( ( double ) calcGapSumPerColumn( msa, col ) / msa.getNumberOfSequences() ) >= max_allowed_gap_ratio;
- if ( delete ) {
- msa.deleteColumn( col );
- }
+ final public static DescriptiveStatistics calculateIdentityRatio( final int from, final int to, final Msa msa ) {
+ final DescriptiveStatistics stats = new BasicDescriptiveStatistics();
+ for( int c = from; c <= to; ++c ) {
+ stats.addValue( calculateIdentityRatio( msa, c ) );