in progress
authorcmzmasek@gmail.com <cmzmasek@gmail.com@ca865154-3058-d1c3-3e42-d8f55a55bdbd>
Thu, 31 May 2012 01:37:06 +0000 (01:37 +0000)
committercmzmasek@gmail.com <cmzmasek@gmail.com@ca865154-3058-d1c3-3e42-d8f55a55bdbd>
Thu, 31 May 2012 01:37:06 +0000 (01:37 +0000)
forester/java/src/org/forester/application/mcc.java [moved from forester/java/src/org/forester/application/msa_quality.java with 96% similarity]
forester/java/src/org/forester/archaeopteryx/tools/PhylogeneticInferrer.java
forester/java/src/org/forester/archaeopteryx/tools/RunnableProcess.java
forester/java/src/org/forester/archaeopteryx/tools/SequenceDataRetriver.java
forester/java/src/org/forester/archaeopteryx/tools/TaxonomyDataObtainer.java
forester/java/src/org/forester/util/ForesterUtil.java

@@ -36,7 +36,7 @@ import org.forester.util.CommandLineArguments;
 import org.forester.util.DescriptiveStatistics;
 import org.forester.util.ForesterUtil;
 
-public class msa_quality {
+public class mcc {
 
     final static private String HELP_OPTION_1 = "help";
     final static private String HELP_OPTION_2 = "h";
@@ -44,7 +44,8 @@ public class msa_quality {
     final static private String TO_OPTION     = "t";
     final static private String STEP_OPTION   = "s";
     final static private String WINDOW_OPTION = "w";
-    final static private String PRG_NAME      = "msa_quality";
+    final static private String PRG_NAME      = "mcc";
+    final static private String PRG_DESC      = "msa consensus conservation";
     final static private String PRG_VERSION   = "1.00";
     final static private String PRG_DATE      = "2012.05.18";
     final static private String E_MAIL        = "phylosoft@gmail.com";
@@ -89,7 +90,7 @@ public class msa_quality {
     }
 
     private static void printHelp() {
-        ForesterUtil.printProgramInformation( PRG_NAME, PRG_VERSION, PRG_DATE, E_MAIL, WWW );
+        ForesterUtil.printProgramInformation( PRG_NAME, PRG_DESC, PRG_VERSION, PRG_DATE, E_MAIL, WWW );
         System.out.println( "Usage:" );
         System.out.println();
         System.out.println( PRG_NAME + " <options> <msa input file>" );
index a6529a3..6cf6614 100644 (file)
@@ -58,7 +58,7 @@ import org.forester.sequence.Sequence;
 import org.forester.tools.ConfidenceAssessor;
 import org.forester.util.ForesterUtil;
 
-public class PhylogeneticInferrer implements Runnable {
+public class PhylogeneticInferrer extends RunnableProcess {
 
     private Msa                                _msa;
     private final MainFrameApplication         _mf;
@@ -156,12 +156,14 @@ public class PhylogeneticInferrer implements Runnable {
         if ( ( _msa == null ) && ( _seqs == null ) ) {
             throw new IllegalArgumentException( "cannot run phylogenetic analysis with null msa and seq array" );
         }
+        start( _mf, "phylogenetic inference" );
         if ( _msa == null ) {
             Msa msa = null;
             try {
                 msa = inferMsa();
             }
             catch ( final IOException e ) {
+                end( _mf );
                 JOptionPane.showMessageDialog( _mf,
                                                "Could not create multiple sequence alignment with \""
                                                        + _options.getMsaPrg() + "\" and the following parameters:\n\""
@@ -175,6 +177,7 @@ public class PhylogeneticInferrer implements Runnable {
                 return;
             }
             catch ( final Exception e ) {
+                end( _mf );
                 JOptionPane.showMessageDialog( _mf,
                                                "Could not create multiple sequence alignment with \""
                                                        + _options.getMsaPrg() + "\" and the following parameters:\n\""
@@ -188,6 +191,7 @@ public class PhylogeneticInferrer implements Runnable {
                 return;
             }
             if ( msa == null ) {
+                end( _mf );
                 JOptionPane.showMessageDialog( _mf,
                                                "Could not create multiple sequence alignment with "
                                                        + _options.getMsaPrg() + "\nand the following parameters:\n\""
@@ -206,6 +210,7 @@ public class PhylogeneticInferrer implements Runnable {
                                                   _options.getMsaProcessingMinAllowedLength(),
                                                   msa );
                 if ( msa == null ) {
+                    end( _mf );
                     JOptionPane.showMessageDialog( _mf,
                                                    "Less than two sequences longer than "
                                                            + _options.getMsaProcessingMinAllowedLength()
@@ -237,7 +242,8 @@ public class PhylogeneticInferrer implements Runnable {
             ConfidenceAssessor.evaluate( "bootstrap", eval_phys, master_phy, true, 1 );
         }
         _mf.getMainPanel().addPhylogenyInNewTab( master_phy, _mf.getConfiguration(), "nj", "njpath" );
-        _mf.getMainPanel().getCurrentTreePanel().setArrowCursor();
+        //  _mf.getMainPanel().getCurrentTreePanel().setArrowCursor();
+        end( _mf );
         JOptionPane.showMessageDialog( _mf,
                                        "Inference successfully completed",
                                        "Inference Completed",
index 159ee9b..b559fba 100644 (file)
@@ -18,7 +18,7 @@ public abstract class RunnableProcess implements Runnable {
     }
 
     void start( final MainFrame mf, final String name ) {
-        mf.getMainPanel().getCurrentTreePanel().setWaitCursor();
+        //mf.getMainPanel().getCurrentTreePanel().setWaitCursor();
         setProcessId( mf.getProcessPool().addProcess( name ) );
         mf.updateProcessMenu();
     }
@@ -29,7 +29,7 @@ public abstract class RunnableProcess implements Runnable {
             ForesterUtil.printWarningMessage( Constants.PRG_NAME, "could not remove process " + getProcessId()
                     + " from process pool" );
         }
-        mf.getMainPanel().getCurrentTreePanel().setArrowCursor();
+        //mf.getMainPanel().getCurrentTreePanel().setArrowCursor();
         mf.updateProcessMenu();
     }
 }
index 7aed148..4db8175 100644 (file)
@@ -47,7 +47,7 @@ import org.forester.ws.uniprot.DatabaseTools;
 import org.forester.ws.uniprot.SequenceDatabaseEntry;
 import org.forester.ws.uniprot.UniProtWsTools;
 
-public final class SequenceDataRetriver implements Runnable {
+public final class SequenceDataRetriver extends RunnableProcess {
 
     private final Phylogeny            _phy;
     private final MainFrameApplication _mf;
@@ -69,13 +69,12 @@ public final class SequenceDataRetriver implements Runnable {
     }
 
     private void execute() {
-        _mf.getMainPanel().getCurrentTreePanel().setWaitCursor();
+        start( _mf, "sequence data" );
         SortedSet<String> not_found = null;
         try {
             not_found = obtainSeqInformation( _phy );
         }
         catch ( final UnknownHostException e ) {
-            _mf.getMainPanel().getCurrentTreePanel().setArrowCursor();
             JOptionPane.showMessageDialog( _mf,
                                            "Could not connect to \"" + getBaseUrl() + "\"",
                                            "Network error during taxonomic information gathering",
@@ -83,7 +82,6 @@ public final class SequenceDataRetriver implements Runnable {
             return;
         }
         catch ( final IOException e ) {
-            _mf.getMainPanel().getCurrentTreePanel().setArrowCursor();
             e.printStackTrace();
             JOptionPane.showMessageDialog( _mf,
                                            e.toString(),
@@ -92,7 +90,7 @@ public final class SequenceDataRetriver implements Runnable {
             return;
         }
         finally {
-            _mf.getMainPanel().getCurrentTreePanel().setArrowCursor();
+            end( _mf );
         }
         _treepanel.setTree( _phy );
         _mf.showWhole();
index 40b02db..819466e 100644 (file)
@@ -39,7 +39,7 @@ import org.forester.archaeopteryx.TreePanel;
 import org.forester.phylogeny.Phylogeny;
 import org.forester.ws.uniprot.UniProtWsTools;
 
-public class TaxonomyDataObtainer implements Runnable {
+public class TaxonomyDataObtainer extends RunnableProcess {
 
     private final Phylogeny            _phy;
     private final MainFrameApplication _mf;
@@ -68,7 +68,7 @@ public class TaxonomyDataObtainer implements Runnable {
     }
 
     private void execute() {
-        _mf.getMainPanel().getCurrentTreePanel().setWaitCursor();
+        start( _mf, "taxonomy data" );
         SortedSet<String> not_found = null;
         try {
             not_found = AncestralTaxonomyInference.obtainDetailedTaxonomicInformation( _phy, _delete );
@@ -100,7 +100,7 @@ public class TaxonomyDataObtainer implements Runnable {
             return;
         }
         finally {
-            _mf.getMainPanel().getCurrentTreePanel().setArrowCursor();
+            end( _mf );
         }
         _treepanel.setTree( _phy );
         _mf.showWhole();
index 58dbf45..fcc7278 100644 (file)
@@ -731,13 +731,18 @@ public final class ForesterUtil {
     }
 
     final public static void printProgramInformation( final String prg_name,
+                                                      final String desc,
                                                       final String prg_version,
                                                       final String date,
                                                       final String email,
                                                       final String www ) {
-        final int l = prg_name.length() + prg_version.length() + date.length() + 4;
+        String my_prg_name = new String( prg_name );
+        if ( !ForesterUtil.isEmpty( desc ) ) {
+            my_prg_name += ( " - " + desc );
+        }
+        final int l = my_prg_name.length() + prg_version.length() + date.length() + 4;
         System.out.println();
-        System.out.println( prg_name + " " + prg_version + " (" + date + ")" );
+        System.out.println( my_prg_name + " " + prg_version + " (" + date + ")" );
         for( int i = 0; i < l; ++i ) {
             System.out.print( "_" );
         }
@@ -752,6 +757,14 @@ public final class ForesterUtil {
         System.out.println();
     }
 
+    final public static void printProgramInformation( final String prg_name,
+                                                      final String prg_version,
+                                                      final String date,
+                                                      final String email,
+                                                      final String www ) {
+        printProgramInformation( prg_name, null, prg_version, date, email, www );
+    }
+
     final public static void printWarningMessage( final String prg_name, final String message ) {
         System.out.println( "[" + prg_name + "] > warning: " + message );
     }