org.fhcrc.cpl.viewer
Class Application

java.lang.Object
  extended by org.fhcrc.cpl.viewer.Application
All Implemented Interfaces:
ApplicationContext.ApplicationContextProvider

public class Application
extends java.lang.Object
implements ApplicationContext.ApplicationContextProvider

If the "log" arg is specified, all ApplicationContext messages and all Log4J messages will all be appended to a log file. The user can specify a file for this purpose, or one can be written in the temp dir. If this logging is on and a CommandLineModule fails execution, the full log will be appended to the failure log. If a CLM fails execution and logging is NOT on, the user is prompted to re-run the command with logging on.


Field Summary
protected  boolean _isWorkbenchInitialized
           
protected static boolean enableLog
           
static java.lang.String FAILURE_REPORT_ERRORMESSAGE_TEXT
           
static java.lang.String FAILURE_REPORT_HEADER_TEXT
           
protected static java.io.File logFile
           
protected static java.lang.String LOGFILE_DUMMY_CALLER
           
protected static java.io.PrintWriter logPrintWriter
           
protected static java.lang.String MESSAGE_TYPE_ERROR
           
protected static java.lang.String MESSAGE_TYPE_INFO
           
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
           
 void addPropertyChangeListener(java.lang.String name, java.beans.PropertyChangeListener listener)
           
static void closeLog()
           
 void errorMessage(java.lang.String message, java.lang.Throwable t)
           
 javax.swing.JFrame getFrame()
           
static Application getInstance()
           
static java.io.File getLogFile()
           
protected static java.io.PrintWriter getPrintWriter(java.lang.String outFileName)
           
 java.lang.Object getProperty(java.lang.String name)
           
protected static boolean handleHardcodedCommand(java.lang.String command, java.lang.String[] args, java.lang.String revision)
          Checks if the command is one of the few that we handle in a hardcoded fashion.
 void infoMessage(java.lang.String message)
           
static boolean isLogEnabled()
           
static void main(java.lang.String[] args)
          Starts the application.
static void ms2Correct(java.lang.String[] args)
          TODO: we should remove this, probably
 void OpenFile(java.lang.String filename)
           
static boolean processRawArguments(CommandLineModule module, java.lang.String[] args)
          For CommandLineModule commands, parse the argument strings, digest the relevant arguments according to the definitions provided by the module.
static void quit()
           
static void quit(int status)
           
static void quit(java.lang.String err)
           
 void redrawWorkbench()
          start from scratch with a new Workbench.
protected static void runCommand(CommandLineModule module, java.lang.String[] args)
          Handle arguments and run a command
static void setMessage(java.lang.String message)
           
 void setProperty(java.lang.String name, java.lang.Object value)
           
protected static void showHelp(CommandLineModule module)
          Show help for a given module
protected  void showMessage(java.lang.String text, java.lang.String messageType)
           
static void showUsage()
          "--revision\n" + "--ms2Correct --features=ms1FeatureFile [--out=outfilename] [filterOptions] runFile" + "\n" + "--optimize [--out=outfilename] [--scanWindows=int,int,...] [--massWindows=float,float,float] [filterOptions] featureFiles..." + "\n" + "--deconvolute --quant [--out=outfilename] [--scanWindow=int] [--massWindow=float] [--lightTagWeight=float] [--heavyTagWeight=float] [--maxLabelCount=int] [--labeledResidue=char] [--intensityType={total,max,recalculated}] [--msFile=filepath] --deltaTime=[float] --deltaMass=[float][da|ppm] featureFile" + "\n" + " --deconvolute and --quant may be used together or separately\n" + "\n" + "[filterOptions] = \n" + "[--minMz=float] [--maxMz=float] [--minMass=float] [--maxMass=float]\n" + "[--minPeaks=int] [--minCharge=int] [--maxCharge=int] [--maxKL=float]\n" + "[--minIntensity=float] [--minTotalIntensity=float]\n" + "[--minTime=float] [--maxTime=float]\n" + "[--scanFirst=int] [scanLast=int] [--minScans=int]\n" + "scanFirst and scanLast filter the scan column.
 void status(java.lang.String message)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_isWorkbenchInitialized

protected boolean _isWorkbenchInitialized

enableLog

protected static boolean enableLog

logFile

protected static java.io.File logFile

logPrintWriter

protected static java.io.PrintWriter logPrintWriter

LOGFILE_DUMMY_CALLER

protected static final java.lang.String LOGFILE_DUMMY_CALLER
See Also:
Constant Field Values

MESSAGE_TYPE_INFO

protected static java.lang.String MESSAGE_TYPE_INFO

MESSAGE_TYPE_ERROR

protected static java.lang.String MESSAGE_TYPE_ERROR

FAILURE_REPORT_ERRORMESSAGE_TEXT

public static final java.lang.String FAILURE_REPORT_ERRORMESSAGE_TEXT
See Also:
Constant Field Values

FAILURE_REPORT_HEADER_TEXT

public static final java.lang.String FAILURE_REPORT_HEADER_TEXT
See Also:
Constant Field Values
Method Detail

getInstance

public static Application getInstance()

setMessage

public static void setMessage(java.lang.String message)

redrawWorkbench

public void redrawWorkbench()
start from scratch with a new Workbench. For language changing


status

public void status(java.lang.String message)
Specified by:
status in interface ApplicationContext.ApplicationContextProvider

errorMessage

public void errorMessage(java.lang.String message,
                         java.lang.Throwable t)
Specified by:
errorMessage in interface ApplicationContext.ApplicationContextProvider

infoMessage

public void infoMessage(java.lang.String message)
Specified by:
infoMessage in interface ApplicationContext.ApplicationContextProvider

showMessage

protected void showMessage(java.lang.String text,
                           java.lang.String messageType)

getFrame

public javax.swing.JFrame getFrame()
Specified by:
getFrame in interface ApplicationContext.ApplicationContextProvider

setProperty

public void setProperty(java.lang.String name,
                        java.lang.Object value)
Specified by:
setProperty in interface ApplicationContext.ApplicationContextProvider

getProperty

public java.lang.Object getProperty(java.lang.String name)
Specified by:
getProperty in interface ApplicationContext.ApplicationContextProvider

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Specified by:
addPropertyChangeListener in interface ApplicationContext.ApplicationContextProvider

addPropertyChangeListener

public void addPropertyChangeListener(java.lang.String name,
                                      java.beans.PropertyChangeListener listener)
Specified by:
addPropertyChangeListener in interface ApplicationContext.ApplicationContextProvider

OpenFile

public void OpenFile(java.lang.String filename)

runCommand

protected static void runCommand(CommandLineModule module,
                                 java.lang.String[] args)
Handle arguments and run a command

Parameters:
module -
args -

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Starts the application. Application can be started in either interactive mode or specifically to find peptides in a file. Interactive Mode: Application [mzxmlfile] Find Peptides: Application --findPeptides [--out=outfile] mzxmlfile If outfile is not specified, outfile is mzxmlfile.peptides.tsv

Parameters:
args -
Throws:
java.lang.Exception

handleHardcodedCommand

protected static boolean handleHardcodedCommand(java.lang.String command,
                                                java.lang.String[] args,
                                                java.lang.String revision)
Checks if the command is one of the few that we handle in a hardcoded fashion. if so, do something about it and return true (or throw an exception, shut down, whatever). If not, return false;

Parameters:
command -
args -
revision -
Returns:
true iff the command entered is one we handle hardcoded

showHelp

protected static void showHelp(CommandLineModule module)
Show help for a given module

Parameters:
module -

processRawArguments

public static boolean processRawArguments(CommandLineModule module,
                                          java.lang.String[] args)
For CommandLineModule commands, parse the argument strings, digest the relevant arguments according to the definitions provided by the module. If any undefined arguments are specified, die

Parameters:
args -
Returns:

closeLog

public static void closeLog()

quit

public static void quit()

quit

public static void quit(java.lang.String err)

quit

public static void quit(int status)

showUsage

public static void showUsage()
"--revision\n" + "--ms2Correct --features=ms1FeatureFile [--out=outfilename] [filterOptions] runFile" + "\n" + "--optimize [--out=outfilename] [--scanWindows=int,int,...] [--massWindows=float,float,float] [filterOptions] featureFiles..." + "\n" + "--deconvolute --quant [--out=outfilename] [--scanWindow=int] [--massWindow=float] [--lightTagWeight=float] [--heavyTagWeight=float] [--maxLabelCount=int] [--labeledResidue=char] [--intensityType={total,max,recalculated}] [--msFile=filepath] --deltaTime=[float] --deltaMass=[float][da|ppm] featureFile" + "\n" + " --deconvolute and --quant may be used together or separately\n" + "\n" + "[filterOptions] = \n" + "[--minMz=float] [--maxMz=float] [--minMass=float] [--maxMass=float]\n" + "[--minPeaks=int] [--minCharge=int] [--maxCharge=int] [--maxKL=float]\n" + "[--minIntensity=float] [--minTotalIntensity=float]\n" + "[--minTime=float] [--maxTime=float]\n" + "[--scanFirst=int] [scanLast=int] [--minScans=int]\n" + "scanFirst and scanLast filter the scan column. minScans filters the scanCount column. Other filter parameters filter the column matching their name.";


getPrintWriter

protected static java.io.PrintWriter getPrintWriter(java.lang.String outFileName)
                                             throws java.io.FileNotFoundException
Throws:
java.io.FileNotFoundException

ms2Correct

public static void ms2Correct(java.lang.String[] args)
                       throws java.lang.Exception
TODO: we should remove this, probably

Parameters:
args -
Throws:
java.lang.Exception

isLogEnabled

public static boolean isLogEnabled()

getLogFile

public static java.io.File getLogFile()


Fred Hutchinson Cancer Research Center