From: cmzmasek@gmail.com Date: Tue, 10 Jul 2012 06:32:14 +0000 (+0000) Subject: in progress X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=6961fa58876daec186c3ca56d535d40c23a1fd65;p=jalview.git in progress --- diff --git a/forester/java/src/org/forester/msa/MsaCompactor.java b/forester/java/src/org/forester/msa/MsaCompactor.java index 9e08de8..a268a24 100644 --- a/forester/java/src/org/forester/msa/MsaCompactor.java +++ b/forester/java/src/org/forester/msa/MsaCompactor.java @@ -1,5 +1,9 @@ package org.forester.msa; +import org.forester.sequence.Sequence; +import org.forester.util.BasicDescriptiveStatistics; +import org.forester.util.DescriptiveStatistics; + public class MsaCompactor { @@ -12,7 +16,20 @@ public class MsaCompactor { - private calc + private DescriptiveStatistics[] calc() { + final double gappiness[] = calcGappiness(); + final DescriptiveStatistics stats[] = new DescriptiveStatistics[ _msa.getNumberOfSequences() ]; + for ( int row = 0; row < _msa.getNumberOfSequences(); ++row ) { + stats[ row ] = new BasicDescriptiveStatistics(); + for( int col = 0; col < _msa.getLength(); ++col ) { + if ( _msa.getResidueAt( row, col ) != Sequence.GAP ) { + stats[ row ].addValue( gappiness[ col ] ); + + } + } + } + return stats; + } private double[] calcGappiness() { final double gappiness[] = new double[ _msa.getLength() ];