From 6961fa58876daec186c3ca56d535d40c23a1fd65 Mon Sep 17 00:00:00 2001 From: "cmzmasek@gmail.com" Date: Tue, 10 Jul 2012 06:32:14 +0000 Subject: [PATCH] in progress --- .../java/src/org/forester/msa/MsaCompactor.java | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) 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() ]; -- 1.7.10.2