Class SearchGUI.SGstate

java.lang.Object
  extended by SearchGUI.SGstate
Enclosing class:
SearchGUI

 class SearchGUI.SGstate
extends java.lang.Object

Class SGstate contains the SearchGUI state as well as functions to maintain the state. List of functions ================= copyStateFromCvt() - copy the partial state from cvt Globals readSGstate() - read the state from a saved state file .ssg writeSGstate() - write the state to a saved state file .ssg copyGlobalsToSGstate() - save Globals instance in SGstate variables.


Field Summary
 java.lang.String classAsamples
          Currently specified EG samples assigned to class A.
 java.lang.String classBsamples
          Currently specified EG samples assigned to class B.
 CvtTabDelim2HTML cvt
           
 int dataPrecisionHTMLtable
           
 boolean[] egSelNamesFlag
          Number of EG samples selection Choice List.
 boolean evalSearchANDbooleanFlag
          Eval the search terms as an AND (if true) else OR (if false).
 java.lang.String filterRowStr
          Optional EG group filter if not null.
 java.lang.String[] flipColumnFile
           
 java.lang.String[] flipColumnName
           
 java.lang.String[][] flipColumnValues
           
 java.lang.String[] flipOrderHdrColList
           
 java.lang.String[] flipRowGSPIDfilters
           
 boolean flipTableUseExactMatchFlag
           
 float foldChangeThr
          Fold-change threshold value used from the Menu checkbox item foldChangeThrMCB for "Only keep genes/probes with |fold-change| >= threshold" that pops up a dialog to enter the threshold value between 0.0 and some large number.
 boolean foldChangeThrFlag
           
 int nEGSelNames
          Number of EG samples selection Choice List.
 int nEntries
          # of hash table entries after call readNameValuesHashTableFromFile()
 int nFlipColumns
           
 int nFlipOrderHdrColList
           
 int nRowGSPIDfilters
           
 int nStateEntries
          # of .sgs hash table entries
 java.lang.String outputSearchDir
           
 boolean reportFoldChangeFlag
          Flag for "Report Fold Change of 2 sample subsets" set by
 java.lang.String[] sampleRowFilter
           
 boolean sampleRowFilterALLflag
           
 java.lang.String searchResultsBaseFile
          Default Search-Results base file name if not null or "".
 java.lang.String searchTermFilterStr
           
 java.lang.String searchTermsDemoData
          The demo argument to load into the searchTermTextArea GUI Set by "-searchTermsDemoData:{list of search terms}"
 java.lang.String searchUserTermListColName
          The user column name to use when reading data from a user term list file Table to load into the the searchTermTextArea GUI.
 java.lang.String searchUserTermListFile
          The file name to use when reading data from a user term list file Table to load into the the searchTermTextArea GUI.
 java.lang.String searchUserTermListStr
          The user search terms list string to use when reading data from a user term list file Table to load into the the searchTermTextArea GUI.
 java.lang.String searchUserTermListTitle
          The user title string to use when reading data from a user term list file Table to load into the the searchTermTextArea GUI.
 java.util.Hashtable sgStateHT
          Hash table of .sgs values read
 SearchGUI sGui
           
 boolean showDataHeatmapFlipTableFlag
           
 java.lang.String sortFlipTableByColumnName
           
 
Constructor Summary
SearchGUI.SGstate(SearchGUI sGui)
          SGstate() - Constructor
 
Method Summary
 boolean copyGlobalsToSGstate(Globals glb)
          copyGlobalsToSGstate() - copy Globals instance in SGstate variables.
 boolean copySGstateInstance(SearchGUI.SGstate sg)
          copySGstateInstance() - copy from SGstate instance values to this.
 boolean copyStateFromCvt(CvtTabDelim2HTML cvt)
          copyStateFromCvt() - copy the partial state from cvt Globals
 java.lang.String cvtSGstateToStr()
          cvtSGstateToStr() - convert SGstate vars.
 java.lang.String getStateStr()
          getStateStr() - generate tab-delim SGstate string for writing .sgs state.
 boolean getStateValue(java.lang.String key, boolean def)
          getStateValue() - get boolean PARAM and use default if not found.
 float getStateValue(java.lang.String key, float def)
          getStateValue() - get float PARAM and use default if not found.
 int getStateValue(java.lang.String key, int def)
          getStateValue() - get int PARAM and use default if not found.
 long getStateValue(java.lang.String key, long def)
          getStateValue() - get float PARAM and use default if not found.
 java.lang.String getStateValue(java.lang.String key, java.lang.String def)
          getStateValue() - get PARAM and use default if not found.
 boolean parseHTtoSGstate()
          parseHTtoSGstate() - parse .sgs state hashtable to SGstate variables.
 java.util.Hashtable readNameValuesHashTableFromFile(java.lang.String fileName, int hashTableSize)
          readNameValuesHashTableFromFile() - read hashtable tab-delim name-value pairs from a file.
 boolean readSGstateFile(java.lang.String stateFile)
          readSGstateFile() - read the SearchGUI State file stateFile with a .sgs file extension.
 void setStateHashtableForGetValue(java.util.Hashtable ht)
          setStateHashtableForGetValue() - set working H.T.
 void setStateHashtableForGetValue(java.util.Hashtable ht, int nEntriesVal)
          setStateHashtableForGetValue() - set working H.T.
 boolean writeSGstate(java.lang.String fileStr)
          writeSGstate() - write SearchGUI state to .sgs SGstate file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sGui

public SearchGUI sGui

cvt

public CvtTabDelim2HTML cvt

sgStateHT

public java.util.Hashtable sgStateHT
Hash table of .sgs values read


nStateEntries

public int nStateEntries
# of .sgs hash table entries


nEntries

public int nEntries
# of hash table entries after call readNameValuesHashTableFromFile()


flipOrderHdrColList

public java.lang.String[] flipOrderHdrColList

nFlipOrderHdrColList

public int nFlipOrderHdrColList

nFlipColumns

public int nFlipColumns

flipColumnFile

public java.lang.String[] flipColumnFile

flipColumnName

public java.lang.String[] flipColumnName

flipColumnValues

public java.lang.String[][] flipColumnValues

sampleRowFilterALLflag

public boolean sampleRowFilterALLflag

sampleRowFilter

public java.lang.String[] sampleRowFilter

reportFoldChangeFlag

public boolean reportFoldChangeFlag
Flag for "Report Fold Change of 2 sample subsets" set by


foldChangeThrFlag

public boolean foldChangeThrFlag

foldChangeThr

public float foldChangeThr
Fold-change threshold value used from the Menu checkbox item foldChangeThrMCB for "Only keep genes/probes with |fold-change| >= threshold" that pops up a dialog to enter the threshold value between 0.0 and some large number.


dataPrecisionHTMLtable

public int dataPrecisionHTMLtable

sortFlipTableByColumnName

public java.lang.String sortFlipTableByColumnName

showDataHeatmapFlipTableFlag

public boolean showDataHeatmapFlipTableFlag

flipTableUseExactMatchFlag

public boolean flipTableUseExactMatchFlag

outputSearchDir

public java.lang.String outputSearchDir

searchResultsBaseFile

public java.lang.String searchResultsBaseFile
Default Search-Results base file name if not null or "". It is used for "-flipSaveOutputFile:{flipSaveOutputFile}" in the generated param map file.


searchTermsDemoData

public java.lang.String searchTermsDemoData
The demo argument to load into the searchTermTextArea GUI Set by "-searchTermsDemoData:{list of search terms}"


searchTermFilterStr

public java.lang.String searchTermFilterStr

searchUserTermListFile

public java.lang.String searchUserTermListFile
The file name to use when reading data from a user term list file Table to load into the the searchTermTextArea GUI. Set by "-searchUserTermList:{userListTable,colName,title string}"


searchUserTermListColName

public java.lang.String searchUserTermListColName
The user column name to use when reading data from a user term list file Table to load into the the searchTermTextArea GUI. Set by "-searchUserTermList:{userListTable,colName,title string}"


searchUserTermListTitle

public java.lang.String searchUserTermListTitle
The user title string to use when reading data from a user term list file Table to load into the the searchTermTextArea GUI. Set by "-searchUserTermList:{userListTable,colName,title string}"


searchUserTermListStr

public java.lang.String searchUserTermListStr
The user search terms list string to use when reading data from a user term list file Table to load into the the searchTermTextArea GUI. Set by "-searchUserTermList:{userListTable,colName,title string}"


evalSearchANDbooleanFlag

public boolean evalSearchANDbooleanFlag
Eval the search terms as an AND (if true) else OR (if false). Set by the andEGnamesRB and orEGnamesRB radio buttons and action commands.


filterRowStr

public java.lang.String filterRowStr
Optional EG group filter if not null. This is set by the GUI JTextField filterRowTextField.


nEGSelNames

public int nEGSelNames
Number of EG samples selection Choice List. Used with boolean egSelNames[] data.


egSelNamesFlag

public boolean[] egSelNamesFlag
Number of EG samples selection Choice List. Used with boolean egSelNames[] data.


flipRowGSPIDfilters

public java.lang.String[] flipRowGSPIDfilters

nRowGSPIDfilters

public int nRowGSPIDfilters

classAsamples

public java.lang.String classAsamples
Currently specified EG samples assigned to class A. -flipAclass:"{classAsamples}" [if reportFoldChangeFlag]


classBsamples

public java.lang.String classBsamples
Currently specified EG samples assigned to class B. -flipBclass:"{classBsamples}" [if reportFoldChangeFlag].

Constructor Detail

SearchGUI.SGstate

public SearchGUI.SGstate(SearchGUI sGui)
SGstate() - Constructor

Parameters:
sGui - is an instance of the SearchGUI class
Method Detail

copyStateFromCvt

public boolean copyStateFromCvt(CvtTabDelim2HTML cvt)
copyStateFromCvt() - copy the partial state from cvt Globals

Parameters:
cvt - instance of CvtTabDelim2HTML
Returns:
true if succeed

copySGstateInstance

public boolean copySGstateInstance(SearchGUI.SGstate sg)
copySGstateInstance() - copy from SGstate instance values to this.

Parameters:
sg - - instance to copy FROM
Returns:
SGstate string in .sps file format. if succeed.

cvtSGstateToStr

public java.lang.String cvtSGstateToStr()
cvtSGstateToStr() - convert SGstate vars. to .sgs state string to write to file. It makes lists of variables of the form "param=value\n" called the .sgs file format.

Returns:
SGstate string in .sps file format. if succeed.

copyGlobalsToSGstate

public boolean copyGlobalsToSGstate(Globals glb)
copyGlobalsToSGstate() - copy Globals instance in SGstate variables. The file being imported was a previous paramsSearchFlip.map file created by createParamsMapFile().
This method parses and sets following parameters if the switch exists from the list:
   -flipOrderHdrColNames:"*LIST*,Stat5a,"
   -flipColumnName:"*LIST*,Gene,Stat5a,Stat5b"
   -flipColumnName:"*LIST*,Feature ID,1438470_at,1441476_at,1446085_at"
   -flipRowFilterNames:\"*LIST*,EG003.1,EG003.2"
  
   -flipRowGSPIDfilterSubstring:"AND,.stat,.GH"
   -flipAclass:"{classAsamples}"  [if reportFoldChangeFlag]
   -flipAclass:"{classBsamples}"  [if reportFoldChangeFlag]
   -flipFCthreshold:{foldChangeThr} [if foldChangeThrFlag && foldChangeThr>0.0F]
   -dataPrecisionHTMLtable:{precision of HTML table}
   -sortFlipTableByColumnName:{sort column}
   -showDataHeatmapFlipTable
   -flipUseExactColumnNameMatch:{glb.flipTableUseExactMatchFlag}
   -flipDirectory:"{outputSearchDir}"
   -flipSaveOutputFile:"{searchResultsBaseFile}"
 

Parameters:
glb - Globals instance of parsed data file
Returns:
true if succeed.

readSGstateFile

public boolean readSGstateFile(java.lang.String stateFile)
readSGstateFile() - read the SearchGUI State file stateFile with a .sgs file extension.

Parameters:
stateFile - is the name of the Flicker state file
Returns:
true if setup and parsed the .sgs hashtable correctly

parseHTtoSGstate

public boolean parseHTtoSGstate()
parseHTtoSGstate() - parse .sgs state hashtable to SGstate variables. It checks for each of the variables and then sets the corresponding SGstate variable.

Returns:
set the state variables if succeed and return true.

writeSGstate

public boolean writeSGstate(java.lang.String fileStr)
writeSGstate() - write SearchGUI state to .sgs SGstate file.

Parameters:
fileStr - - name of file to write
Returns:
true if succeed.

readNameValuesHashTableFromFile

public java.util.Hashtable readNameValuesHashTableFromFile(java.lang.String fileName,
                                                           int hashTableSize)
readNameValuesHashTableFromFile() - read hashtable tab-delim name-value pairs from a file. Convert the (name\tvalue\n) data to a hashtable.

Parameters:
fileName - is the name of the file to read
hashTableSize - initial size of hashtable
Returns:
hashtable else null if not found. The global variable nEntries contains the number of entries.

setStateHashtableForGetValue

public void setStateHashtableForGetValue(java.util.Hashtable ht,
                                         int nEntriesVal)
setStateHashtableForGetValue() - set working H.T. for next getStateValue calls

Parameters:
ht - is hashtable to use
nEntriesVal - is the number of elements used in the hash table.

setStateHashtableForGetValue

public void setStateHashtableForGetValue(java.util.Hashtable ht)
setStateHashtableForGetValue() - set working H.T. for next getStateValue calls

Parameters:
ht - is hashtable to use

getStateStr

public java.lang.String getStateStr()
getStateStr() - generate tab-delim SGstate string for writing .sgs state. The format is tab-delimited (name \t value \n) with one entry/line.

Returns:
the state string

getStateValue

public java.lang.String getStateValue(java.lang.String key,
                                      java.lang.String def)
getStateValue() - get PARAM and use default if not found.


getStateValue

public int getStateValue(java.lang.String key,
                         int def)
getStateValue() - get int PARAM and use default if not found.


getStateValue

public long getStateValue(java.lang.String key,
                          long def)
getStateValue() - get float PARAM and use default if not found.


getStateValue

public float getStateValue(java.lang.String key,
                           float def)
getStateValue() - get float PARAM and use default if not found.


getStateValue

public boolean getStateValue(java.lang.String key,
                             boolean def)
getStateValue() - get boolean PARAM and use default if not found.