in progress
[jalview.git] / forester / java / src / org / forester / archaeopteryx / tools / PhylogeneticInferrer.java
index e6fe009..0f29e93 100644 (file)
@@ -34,7 +34,7 @@ import java.util.List;
 import javax.swing.JOptionPane;
 
 import org.forester.archaeopteryx.MainFrameApplication;
-import org.forester.evoinference.distance.NeighborJoining;
+import org.forester.evoinference.distance.NeighborJoiningF;
 import org.forester.evoinference.distance.PairwiseDistanceCalculator;
 import org.forester.evoinference.matrix.distance.BasicSymmetricalDistanceMatrix;
 import org.forester.evoinference.tools.BootstrapResampler;
@@ -47,7 +47,7 @@ import org.forester.msa.MsaMethods;
 import org.forester.msa.ResampleableMsa;
 import org.forester.phylogeny.Phylogeny;
 import org.forester.phylogeny.PhylogenyMethods;
-import org.forester.sequence.Sequence;
+import org.forester.sequence.MolecularSequence;
 import org.forester.tools.ConfidenceAssessor;
 import org.forester.util.ForesterUtil;
 
@@ -56,12 +56,12 @@ public class PhylogeneticInferrer extends RunnableProcess {
     private Msa                                _msa;
     private final MainFrameApplication         _mf;
     private final PhylogeneticInferenceOptions _options;
-    private final List<Sequence>               _seqs;
+    private final List<MolecularSequence>      _seqs;
     private final boolean                      DEBUG           = true;
     public final static String                 MSA_FILE_SUFFIX = ".aln";
     public final static String                 PWD_FILE_SUFFIX = ".pwd";
 
-    public PhylogeneticInferrer( final List<Sequence> seqs,
+    public PhylogeneticInferrer( final List<MolecularSequence> seqs,
                                  final PhylogeneticInferenceOptions options,
                                  final MainFrameApplication mf ) {
         _msa = null;
@@ -142,8 +142,9 @@ public class PhylogeneticInferrer extends RunnableProcess {
                 e.printStackTrace();
             }
         }
-        final NeighborJoining nj = NeighborJoining.createInstance();
+        final NeighborJoiningF nj = NeighborJoiningF.createInstance( false, 5 );
         final Phylogeny phy = nj.execute( m );
+        PhylogenyMethods.addMolecularSeqsToTree( phy, msa );
         PhylogenyMethods.extractFastaInformation( phy );
         return phy;
     }
@@ -203,7 +204,7 @@ public class PhylogeneticInferrer extends RunnableProcess {
             }
             final MsaMethods msa_tools = MsaMethods.createInstance();
             if ( _options.isExecuteMsaProcessing() ) {
-                msa = msa_tools.removeGapColumns( _options.getMsaProcessingMaxAllowedGapRatio(),
+                msa = msa_tools.deleteGapColumns( _options.getMsaProcessingMaxAllowedGapRatio(),
                                                   _options.getMsaProcessingMinAllowedLength(),
                                                   msa );
                 if ( msa == null ) {
@@ -259,7 +260,8 @@ public class PhylogeneticInferrer extends RunnableProcess {
         }
     }
 
-    private Msa runMAFFT( final List<Sequence> seqs, final List<String> opts ) throws IOException, InterruptedException {
+    private Msa runMAFFT( final List<MolecularSequence> seqs, final List<String> opts ) throws IOException,
+            InterruptedException {
         Msa msa = null;
         final MsaInferrer mafft = Mafft.createInstance( _mf.getInferenceManager().getPathToLocalMafft()
                 .getCanonicalPath() );