startup
Class FunSiPWorkflow

java.lang.Object
  extended by startup.FunSiPWorkflow
All Implemented Interfaces:
java.lang.Runnable

public class FunSiPWorkflow
extends java.lang.Object
implements java.lang.Runnable

This class represents the different actions etc. defined in a single configuration file. After being parsed, all these actions are launched by the workflow parameters also defined in the configuration file.

Author:
Michiel Van Bel

Nested Class Summary
static class FunSiPWorkflow.MULTITHREADING
          The different types of available multithreading: a) NO_MULTITHREADING : no multithreading at all b) SINGLE_PC_MULTITHREADING : launches each different ClassificationAction in a seperate thread, and waits until they're all finished; c) CLUSTER_MULTITHREADING : attempts to launch each ClassificationAction in a seperate job for the cluster (standard qsub-command).
 
Constructor Summary
FunSiPWorkflow(org.apache.log4j.Logger logger, java.lang.String fileName)
          Constructor, does nothing really but assigning the provided method parameters to local variables.
 
Method Summary
 void addClassificationAction(ClassificationAction ca)
           
 void addInputMergeFiles(java.util.List<java.lang.String> inputMerge)
           
 void addOutputMergeFile(java.lang.String outputMerge)
           
 void convertToGenomeViewOutput(java.io.File file)
           
 java.util.List<ClassificationAction> getClassificationActions()
           
 java.lang.String getFileName()
           
 java.util.List<java.util.List<java.lang.String>> getInputMergeFiles()
           
 java.lang.String getLoggingStyle()
           
 int getOptimizer_step()
           
 int[] getOptimizerData()
           
 java.util.List<java.lang.String> getOutputMergeFile()
           
 FunSiPWorkflow.MULTITHREADING getThreading()
           
 boolean isMergeResults()
           
 boolean isOptimizer()
           
 void run()
          Inherited because the workflow must be run as a thread.
 void setClassificationActions(java.util.List<ClassificationAction> caList)
           
 void setExplicitFiles(java.io.File[] files)
          This method is used when additional fastafiles that need to be evaluated are provided on the commandline by the user.
 void setFileName(java.lang.String s)
           
 void setInputMergeFiles(java.util.List<java.util.List<java.lang.String>> inputMergeFiles)
           
 void setMergeResults(boolean mergeResults)
           
 void setOptimizer_steps(int optimizer_start, int optimizer_stop, int optimizer_step)
           
 void setOptimizer(boolean optimizer)
           
 void setOutputMergeFile(java.util.List<java.lang.String> outputMergeFile)
           
 boolean setThreading(java.lang.String threading_style)
           
 java.util.List<startup.FunSiPWorkflow.OptimizationScore> sortScores(java.util.List<startup.FunSiPWorkflow.OptimizationScore> list)
          Dummy bubblesort algorithm (normally list only consists of 2-10 items) for the OptimizationScore type.
 void waitForSync()
          This method is used for synchronization purposes between the different spawned threads.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FunSiPWorkflow

public FunSiPWorkflow(org.apache.log4j.Logger logger,
                      java.lang.String fileName)
Constructor, does nothing really but assigning the provided method parameters to local variables.

Parameters:
logger - The logging facility
fileName - The name of the configurationfile by which this workflow is created. Can be null if this method is invoked by other means.
Method Detail

setExplicitFiles

public void setExplicitFiles(java.io.File[] files)
This method is used when additional fastafiles that need to be evaluated are provided on the commandline by the user. This method creates lists of files and to-merge-files and adds these to the workflow.

Parameters:
files - The files that need to be evaluated.

run

public void run()
Inherited because the workflow must be run as a thread. The method does three different things : a) it checks whether the workflow should run in optimization mode, and -if true- changes the classificationactions to adapt to this. b) it switches to the different methods according to the type of multithreading that should be used c) it checks whether the results should be merged, and acts accordingly

Specified by:
run in interface java.lang.Runnable

convertToGenomeViewOutput

public void convertToGenomeViewOutput(java.io.File file)

waitForSync

public void waitForSync()
                 throws java.lang.InterruptedException
This method is used for synchronization purposes between the different spawned threads. Every thread thats is finished, is halted by this method (acting as a barrier). Once all the threads have stopped, workflow is resumed.

Throws:
java.lang.InterruptedException

sortScores

public java.util.List<startup.FunSiPWorkflow.OptimizationScore> sortScores(java.util.List<startup.FunSiPWorkflow.OptimizationScore> list)
Dummy bubblesort algorithm (normally list only consists of 2-10 items) for the OptimizationScore type.

Parameters:
list - List that needs to be sorted (descending order)
Returns:
Sorted list

addClassificationAction

public void addClassificationAction(ClassificationAction ca)

getClassificationActions

public java.util.List<ClassificationAction> getClassificationActions()

setClassificationActions

public void setClassificationActions(java.util.List<ClassificationAction> caList)

setThreading

public boolean setThreading(java.lang.String threading_style)

getLoggingStyle

public java.lang.String getLoggingStyle()

getThreading

public FunSiPWorkflow.MULTITHREADING getThreading()

getInputMergeFiles

public java.util.List<java.util.List<java.lang.String>> getInputMergeFiles()

setInputMergeFiles

public void setInputMergeFiles(java.util.List<java.util.List<java.lang.String>> inputMergeFiles)

isMergeResults

public boolean isMergeResults()

setMergeResults

public void setMergeResults(boolean mergeResults)

getOutputMergeFile

public java.util.List<java.lang.String> getOutputMergeFile()

setOutputMergeFile

public void setOutputMergeFile(java.util.List<java.lang.String> outputMergeFile)

addInputMergeFiles

public void addInputMergeFiles(java.util.List<java.lang.String> inputMerge)

addOutputMergeFile

public void addOutputMergeFile(java.lang.String outputMerge)

isOptimizer

public boolean isOptimizer()

setOptimizer

public void setOptimizer(boolean optimizer)

getOptimizer_step

public int getOptimizer_step()

setOptimizer_steps

public void setOptimizer_steps(int optimizer_start,
                               int optimizer_stop,
                               int optimizer_step)

getOptimizerData

public int[] getOptimizerData()

setFileName

public void setFileName(java.lang.String s)

getFileName

public java.lang.String getFileName()