+ String min_pos = "";
+ String max_pos = "";
+ double min = 1;
+ double max = 0;
+ for( int i = 0; i <= msa.getLength() - 1; i += step ) {
+ int to = i + window - 1;
+ if ( to > ( msa.getLength() - 1 ) ) {
+ to = msa.getLength() - 1;
+ }
+ final DescriptiveStatistics stats = calc( i, to, msa );
+ final double mean = stats.arithmeticMean();
+ final String pos = i + "-" + to;
+ System.out.print( pos );
+ System.out.print( ":\t" );
+ System.out.print( mean );
+ if ( stats.getN() > 2 ) {
+ System.out.print( "\t" );
+ System.out.print( stats.median() );
+ System.out.print( "\t" );
+ System.out.print( stats.sampleStandardDeviation() );
+ }
+ System.out.println();
+ if ( mean > max ) {
+ max = mean;
+ max_pos = pos;
+ }
+ if ( mean < min ) {
+ min = mean;
+ min_pos = pos;
+ }
+ }
+ System.out.println( "Min: " + min_pos + ": " + min );
+ System.out.println( "Max: " + max_pos + ": " + max );
+ }
+
+ private static void singleCalc( final File in, int from, int to, final Msa msa ) {
+ if ( from < 0 ) {
+ from = 0;