X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=forester%2Fjava%2Fsrc%2Forg%2Fforester%2Farchaeopteryx%2Ftools%2FPhylogeneticInferrer.java;h=cc627519c3625f4c51ce32aa4940589874eb4ea5;hb=3087ea10ac51cf1a8b2eb8d8abe010513ce9998f;hp=0f29e93523b61a10f71dca7115b27d8f1b2f1419;hpb=6b3ec0cd978bd692dfae1de3e076963283fdf322;p=jalview.git diff --git a/forester/java/src/org/forester/archaeopteryx/tools/PhylogeneticInferrer.java b/forester/java/src/org/forester/archaeopteryx/tools/PhylogeneticInferrer.java index 0f29e93..cc62751 100644 --- a/forester/java/src/org/forester/archaeopteryx/tools/PhylogeneticInferrer.java +++ b/forester/java/src/org/forester/archaeopteryx/tools/PhylogeneticInferrer.java @@ -37,6 +37,7 @@ import org.forester.archaeopteryx.MainFrameApplication; import org.forester.evoinference.distance.NeighborJoiningF; import org.forester.evoinference.distance.PairwiseDistanceCalculator; import org.forester.evoinference.matrix.distance.BasicSymmetricalDistanceMatrix; +import org.forester.evoinference.matrix.distance.DistanceMatrix; import org.forester.evoinference.tools.BootstrapResampler; import org.forester.msa.BasicMsa; import org.forester.msa.Mafft; @@ -116,7 +117,7 @@ public class PhylogeneticInferrer extends RunnableProcess { } private Phylogeny inferPhylogeny( final Msa msa ) { - BasicSymmetricalDistanceMatrix m = null; + DistanceMatrix m = null; switch ( _options.getPwdDistanceMethod() ) { case KIMURA_DISTANCE: m = PairwiseDistanceCalculator.calcKimuraDistances( msa ); @@ -167,8 +168,8 @@ public class PhylogeneticInferrer extends RunnableProcess { + _options.getMsaPrg() + "\" and the following parameters:\n\"" + _options.getMsaPrgParameters() + "\"\nError: " + e.getLocalizedMessage(), - "Failed to Calculate MSA", - JOptionPane.ERROR_MESSAGE ); + "Failed to Calculate MSA", + JOptionPane.ERROR_MESSAGE ); if ( DEBUG ) { e.printStackTrace(); } @@ -181,8 +182,8 @@ public class PhylogeneticInferrer extends RunnableProcess { + _options.getMsaPrg() + "\" and the following parameters:\n\"" + _options.getMsaPrgParameters() + "\"\nError: " + e.getLocalizedMessage(), - "Unexpected Exception During MSA Calculation", - JOptionPane.ERROR_MESSAGE ); + "Unexpected Exception During MSA Calculation", + JOptionPane.ERROR_MESSAGE ); if ( DEBUG ) { e.printStackTrace(); } @@ -194,8 +195,8 @@ public class PhylogeneticInferrer extends RunnableProcess { "Could not create multiple sequence alignment with " + _options.getMsaPrg() + "\nand the following parameters:\n\"" + _options.getMsaPrgParameters() + "\"", - "Failed to Calculate MSA", - JOptionPane.ERROR_MESSAGE ); + "Failed to Calculate MSA", + JOptionPane.ERROR_MESSAGE ); return; } if ( DEBUG ) { @@ -213,8 +214,8 @@ public class PhylogeneticInferrer extends RunnableProcess { "Less than two sequences longer than " + _options.getMsaProcessingMinAllowedLength() + " residues left after MSA processing", - "MSA Processing Settings Too Stringent", - JOptionPane.ERROR_MESSAGE ); + "MSA Processing Settings Too Stringent", + JOptionPane.ERROR_MESSAGE ); return; } } @@ -231,7 +232,7 @@ public class PhylogeneticInferrer extends RunnableProcess { if ( _options.isPerformBootstrapResampling() && ( n > 0 ) ) { final ResampleableMsa resampleable_msa = new ResampleableMsa( ( BasicMsa ) _msa ); final int[][] resampled_column_positions = BootstrapResampler.createResampledColumnPositions( _msa - .getLength(), n, seed ); + .getLength(), n, seed ); final Phylogeny[] eval_phys = new Phylogeny[ n ]; for( int i = 0; i < n; ++i ) { resampleable_msa.resample( resampled_column_positions[ i ] ); @@ -261,10 +262,10 @@ public class PhylogeneticInferrer extends RunnableProcess { } private Msa runMAFFT( final List seqs, final List opts ) throws IOException, - InterruptedException { + InterruptedException { Msa msa = null; final MsaInferrer mafft = Mafft.createInstance( _mf.getInferenceManager().getPathToLocalMafft() - .getCanonicalPath() ); + .getCanonicalPath() ); try { msa = mafft.infer( seqs, opts ); } @@ -274,15 +275,15 @@ public class PhylogeneticInferrer extends RunnableProcess { return msa; } - private void writeToFiles( final BasicSymmetricalDistanceMatrix m ) { + private void writeToFiles( final DistanceMatrix m ) { if ( !ForesterUtil.isEmpty( _options.getIntermediateFilesBase() ) ) { try { final BufferedWriter msa_writer = new BufferedWriter( new FileWriter( _options.getIntermediateFilesBase() - + MSA_FILE_SUFFIX ) ); + + MSA_FILE_SUFFIX ) ); _msa.write( msa_writer, MSA_FORMAT.PHYLIP ); msa_writer.close(); final BufferedWriter pwd_writer = new BufferedWriter( new FileWriter( _options.getIntermediateFilesBase() - + PWD_FILE_SUFFIX ) ); + + PWD_FILE_SUFFIX ) ); m.write( pwd_writer ); pwd_writer.close(); }