X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=forester%2Fjava%2Fsrc%2Forg%2Fforester%2Farchaeopteryx%2Ftools%2FPhylogeneticInferrer.java;h=9e651fb227444b1ef1546b9e3cb946f84de73735;hb=72c535142a5e6b0da9c7edb2f605eb835b43e6fb;hp=c1aefc5b5cb15dcb62a6214e6047ea40009dffa2;hpb=0f62196182c853236023fce71ca24db42b591a36;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 c1aefc5..9e651fb2 100644 --- a/forester/java/src/org/forester/archaeopteryx/tools/PhylogeneticInferrer.java +++ b/forester/java/src/org/forester/archaeopteryx/tools/PhylogeneticInferrer.java @@ -26,7 +26,6 @@ package org.forester.archaeopteryx.tools; import java.io.BufferedWriter; -import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.util.ArrayList; @@ -86,7 +85,7 @@ public class PhylogeneticInferrer extends RunnableProcess { _options = options; } - private Msa inferMsa() throws IOException, InterruptedException { + private Msa inferMsa( final MSA_PRG msa_prg ) throws IOException, InterruptedException { // final File temp_seqs_file = File.createTempFile( "__msa__temp__", ".fasta" ); // if ( DEBUG ) { // System.out.println(); @@ -97,8 +96,14 @@ public class PhylogeneticInferrer extends RunnableProcess { // final BufferedWriter writer = new BufferedWriter( new FileWriter( temp_seqs_file ) ); // SequenceWriter.writeSeqs( _seqs, writer, SEQ_FORMAT.FASTA, 100 ); // writer.close(); - final List opts = processMafftOptions(); - return runMAFFT( _seqs, opts ); + switch ( msa_prg ) { + case MAFFT: + return runMAFFT( _seqs, processMafftOptions() ); + case CLUSTAL_O: + return runClustalOmega( _seqs, processMafftOptions() ); + default: + return null; + } } private List processMafftOptions() { @@ -160,7 +165,7 @@ public class PhylogeneticInferrer extends RunnableProcess { if ( _msa == null ) { Msa msa = null; try { - msa = inferMsa(); + msa = inferMsa( MSA_PRG.MAFFT ); } catch ( final IOException e ) { end( _mf ); @@ -275,13 +280,13 @@ public class PhylogeneticInferrer extends RunnableProcess { return msa; } - private Msa runClustalOmega( final File input_seqs, final List opts ) throws IOException, + private Msa runClustalOmega( final List seqs, final List opts ) throws IOException, InterruptedException { Msa msa = null; final MsaInferrer clustalo = ClustalOmega.createInstance( _mf.getInferenceManager().getPathToLocalClustalo() .getCanonicalPath() ); try { - msa = clustalo.infer( input_seqs, opts ); + msa = clustalo.infer( seqs, opts ); } catch ( final IOException e ) { System.out.println( clustalo.getErrorDescription() ); @@ -338,4 +343,8 @@ public class PhylogeneticInferrer extends RunnableProcess { } } } + + public enum MSA_PRG { + MAFFT, CLUSTAL_O; + } }