From: cmzmasek@gmail.com Date: Tue, 10 Jul 2012 06:11:46 +0000 (+0000) Subject: in progress X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=10932f9386c7e444b2dffbac779282d5d1cc16a7;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 new file mode 100644 index 0000000..f6db9a0 --- /dev/null +++ b/forester/java/src/org/forester/msa/MsaCompactor.java @@ -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; + + } + +} diff --git a/forester/java/src/org/forester/test/Test.java b/forester/java/src/org/forester/test/Test.java index 7983cae..d6a70ee 100644 --- a/forester/java/src/org/forester/test/Test.java +++ b/forester/java/src/org/forester/test/Test.java @@ -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 opts = new ArrayList(); 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 );