in progress
authorcmzmasek@gmail.com <cmzmasek@gmail.com@ca865154-3058-d1c3-3e42-d8f55a55bdbd>
Tue, 10 Jul 2012 06:11:46 +0000 (06:11 +0000)
committercmzmasek@gmail.com <cmzmasek@gmail.com@ca865154-3058-d1c3-3e42-d8f55a55bdbd>
Tue, 10 Jul 2012 06:11:46 +0000 (06:11 +0000)
forester/java/src/org/forester/msa/MsaCompactor.java [new file with mode: 0644]
forester/java/src/org/forester/test/Test.java

diff --git a/forester/java/src/org/forester/msa/MsaCompactor.java b/forester/java/src/org/forester/msa/MsaCompactor.java
new file mode 100644 (file)
index 0000000..f6db9a0
--- /dev/null
@@ -0,0 +1,28 @@
+package org.forester.msa;
+
+
+public class MsaCompactor {
+    
+    final private Msa _msa;
+    
+    public MsaCompactor( Msa msa ) {
+        
+        _msa = msa;
+    }
+    
+    
+    
+    private calc
+    
+    private double[] calcGappiness() {
+        final double gappiness[] = new double[ _msa.getLength() ];
+        final int seqs =     _msa.getNumberOfSequences();
+        for( int i = 0; i < gappiness.length; ++i ) {
+            gappiness[ i ] = ( double ) MsaMethods.calcGapSumPerColumn( _msa, i )  / _msa.getNumberOfSequences();
+            
+        }
+        return gappiness;
+        
+    }
+    
+}
index 7983cae..d6a70ee 100644 (file)
@@ -699,9 +699,15 @@ public final class Test {
         else {
             path = "/home/czmasek/bin/mafft";
         }
+        if ( !Mafft.isInstalled( path ) ) {
+            path = "mafft";
+        }
+        if ( !Mafft.isInstalled( path ) ) {
+            path = "/usr/local/bin/mafft";
+        }
         if ( Mafft.isInstalled( path ) ) {
             System.out.print( "MAFFT (external program): " );
-            if ( Test.testMafft() ) {
+            if ( Test.testMafft( path ) ) {
                 System.out.println( "OK." );
                 succeeded++;
             }
@@ -7957,24 +7963,15 @@ public final class Test {
         return true;
     }
 
-    private static boolean testMafft() {
+    private static boolean testMafft( final String path ) {
         try {
             final List<String> opts = new ArrayList<String>();
             opts.add( "--maxiterate" );
             opts.add( "1000" );
             opts.add( "--localpair" );
             opts.add( "--quiet" );
-            String path = "";
-            final String os = ForesterUtil.OS_NAME.toLowerCase();
-            if ( ( os.indexOf( "mac" ) >= 0 ) && ( os.indexOf( "os" ) > 0 ) ) {
-                path = "/usr/local/bin/mafft";
-            }
-            else if ( os.indexOf( "win" ) >= 0 ) {
-                path = "C:\\Program Files\\mafft-win\\mafft.bat";
-            }
-            else {
-                path = "/home/czmasek/bin/mafft";
-            }
+        
+         
             Msa msa = null;
             final MsaInferrer mafft = Mafft.createInstance( path );
             msa = mafft.infer( new File( PATH_TO_TEST_DATA + "ncbi_sn.fasta" ), opts );