--- /dev/null
+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;
+
+ }
+
+}
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++;
}
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 );