in progress
[jalview.git] / forester / java / src / org / forester / application / msa_quality.java
1
2 package org.forester.application;
3
4 import java.io.File;
5 import java.io.FileInputStream;
6 import java.io.FileNotFoundException;
7 import java.io.IOException;
8
9 import org.forester.io.parsers.GeneralMsaParser;
10 import org.forester.msa.Msa;
11 import org.forester.msa.MsaMethods;
12 import org.forester.util.BasicDescriptiveStatistics;
13 import org.forester.util.CommandLineArguments;
14 import org.forester.util.DescriptiveStatistics;
15
16 public class msa_quality {
17
18     public static void main( final String args[] ) {
19         CommandLineArguments cla = null;
20         try {
21             cla = new CommandLineArguments( args );
22         }
23         catch ( final Exception e ) {
24             // ForesterUtil.fatalError( PRG_NAME, e.getMessage() );
25         }
26         // if ( cla.isOptionSet( HELP_OPTION_1 ) || cla.isOptionSet( HELP_OPTION_2 ) || ( args.length == 0 ) ) {
27         //     printHelp();
28         //     System.exit( 0 );
29         // }
30         final File in = cla.getFile( 0 );
31         Msa msa = null;
32         try {
33             msa = GeneralMsaParser.parse( new FileInputStream( in ) );
34         }
35         catch ( final FileNotFoundException e ) {
36             // TODO Auto-generated catch block
37             e.printStackTrace();
38         }
39         catch ( final IOException e ) {
40             // TODO Auto-generated catch block
41             e.printStackTrace();
42         }
43         final int end = 2;
44         final int start = 6;
45         final DescriptiveStatistics stats = new BasicDescriptiveStatistics();
46         for( int c = start; c <= end; ++c ) {
47             stats.addValue( MsaMethods.calculateIdentityRatio( msa, c ) );
48         }
49     }
50 }