Class MakeTestsIntersectionTbl

java.lang.Object
  extended by MakeTestsIntersectionTbl

public class MakeTestsIntersectionTbl
extends java.lang.Object

Class MakeTestsIntersectionTbl to generate a Tests Intersection Table from the set of data specified by the {test-TODO-list.txt} table. It is invoked by the

 '-makeTestsIntersectionTbl:{testsToDoFile}' switch.
 Note: that it also uses switches: 
  (required)  -inputDirectory:{input dir} 
  (required)  -outputDirectory:{output directory}
  (optional)  -mapHdrNames:{mapHdrNamesFile,fromHdrName,toHdrName}
  (optional)  -noHTML
  (optional)  -saveEditedTable2File:{outTblFile,opt. "HTML"}
  (optional)  -filterTestTestIntersection:{testTableField,d1,d2,...,dn}
  (optional)  -filterDataTestIntersection:{dataTableField,d1,d2,...,dn}
  (optional)  -addFCrangesForTestsIntersectionTable
  (optional)  -addRangeOfMeansToTItable
  (optional)  -limitMaxTableRows:{maxNbrRows,(opt.)sortByCol,(opt.)'A'or 'D'}
  
 If HTML is generated, then the usual modifiers are used:
  (required)  -addProlog:{opt. prolog file name}'
  (required)  -addEpilogue:{opt. epilogue file name}'
  (optional)  -alternateRowBackgroundColor:{c} 
  (optional)  -mapDollarsigns:{$$keyword$$,toString} 
  (optional)  -mapQuestionmarks:{??keyword??,toString}
 

It generates a table ftTI (Tests-Intersection) that contains data from the individual tests from the '-inputDataDir:{inputDataDir}' organized by rows of +FC genes/Feature-IDs and -FC genes/Feature-IDs. The data from the {testsToDoFile} is read into ftGTT and is use to get additional information for each test as follows. The multi-row header includes: (starting in 4th column) with data from the testsToDoFile for each test used:

    'Tissue'          (from the "Test Name")
    'FC & pValue' (from the "p-Value test thresh." & "fold-change test thresh.")
    'Test label'      (from the "HTML page label')
    "MnA/MnB"         (fixed comment indicating fold-change)
    'testName'        (from the "Test Name")

 It is derived from all of the mAdb MRR test results data and 
 used the mAdb-TestsToDo.xls data for annotation.     

  ** Each row has 3 leading params  ("Gene" "Feature ID" "Well ID") that 
     can be hyperlinked in the HTML version of the table. 
  ** This is followed by the "A-B Mean Difference" value for that test
     (for all tests).
  ** The test name, tissue, A vs B names, "MnA/MnB" are part of the 5 
     line header.
  ** The +FC and -FC data are merged (since the same gene can not be found
     in both the +FC and -FC reports).
  ** All genes found in any test are included in the table. 
  ** Where a gene does not show up in a test because the FC was below
     threshold, that cell is left blank.
  ** if adding FC ranges (-addFCrangesForTestsIntersectionTable switch)
     then add three columns "Max FC", "Min FC" and "Range FC".
     Note that we can sort on these since the sorting is done after
     the table is computed.

 The following is a (BOGUS data) example of what it might look like.

   
                                  Erythroid      Liver           . . .
                                  Stat5KO vs WT  WT+GH vs WT-GH  . . .
                                  MnA/MnB        MnA/MnB         . . .
   "Gene" "Feature ID" "Well ID"  EG1-test-1     EG2-test-1      . . .
   ------ ------------ ---------  -------------  ---------------
   Stat3  1460700_at   123456      1.234         -3.1234         . . .
   Sox9   1451538_at   234567                     2.1234         . . .
   Sox3   1455899_x_at 345678      2.5432        -4.3210         . . .
           etc...
 
 Data in the Test-ToDo-List Table
 Column entry    Description 
 "Affy .CEL file (16)" - The Affymetrix .CEL file name in the 
                        GSP-Inventory.xls Egxxxx worksheets
 "Simple GSP ID (10)" - The Simple GSP ID sample name in the 
                        GSP-Inventory.xls Egxxxx worksheets
 "GSP ID (9)" - The default GSP ID sample name in the GSP-Inventory.xls 
                        EGxxxx worksheets
 "Class A" - The samples in class A for the test
 "Class B" - The samples in class B for the test
 "t-Test or Fold-Change Test" - A/B indicates a fold change reported
                        as A samples / B samples.
 "Test Name" - The unique name of the test  formed from the Egxxx number.
                        E.g., EG5.1-test-3
 "p-Value test thresh" -  If there are at least 2 samples for both A 
                        and B classes, this is the p-value threshold 
                        to be used. It is empty if there are not at 
                        least 2 samples/class.
 "fold-change test thresh" -  The fold-change threshold to be used. 
                        It is shown as +/-nX since we do the test for 
                        genes > nX and genes < 1/nX and report them 
                        separately.
 "HTML page label" - Converter web page content page label
 "HTML page description" - Converter web page description content page label
 "HTML tissue name" - Converter tissue name used in the Web page and in 
                        possibly in other  areas.
 "Relative directory" - Relative subdirectory entry in the directory 
                        tree used for a) mAdb tests results (.txt & .zip 
                        files) go, b) converter input data and HTML and 
                        JTV output data, and c) the Jak-Stat Prospector Web 
                        site subdirectory tree.
 
 Test name usage:  File names generated using the 'Test Name'
 tests
 Tests for samples:     
  {testName}+FC.txt       
  {testName}-FC.txt
 
 The converter output will be a mixture of .txt, .html files, and 
 processed JTV directories and .zip files.
 The JTV .zip files have the .zip removed and an HTML file generated 
 to start up the JTV applet from the Web page.
 
 List of variables set by switch:
 -makeTestsIntersectionTbl:{testsToDoFile}
 cvt.makeTestsIntersectionTableFlag
 cvt.testsToDoTblFile
 cvt.filterTestField
 cvt.filterTestsList
 cvt.filterDataField
 cvt.filterDataList
 cvt.addFCrangesForTestsIntersectionTableFlag
 cvt.addRangeOfMeansToTItableFlag

 List of Methods
=================== MakeTestsIntersectionTbl() - Constructor setTestFilterList() - set list of test keywords for filtering tests. setDataFilterList() - set list of data keywords for filtering data. initTestsIntersection() - initialize the input files and I/O paths initTblHeaderIndexes() - get TestToDo Table header idx variables getTestToDoRowData() - get and save row data to class 's'prefix variables. createTestsIntersectionTable() - create the Tests-Intersection Table. addAllTestsDataToTI() - add all Tests Data to ftTI Table. addFCdataInstanceToTI() - add gene FC data to Test-Intersection Table. makeUniqueRelDirList() - generate unique list of Relative Dir. entries. getAllTestDataForRelDir() - get list of test data for rel-dir in tdfrd. cvtSimpleGspId2EG() - map Simple GSP ID to an EGxxxx.y matchTestFilter() - test current test tField name of ft Table matchDataFilter() - test the tField name of current MRR Table data. addFCrangesForTestsIntersectionTable() - adding FC range computations calcRunningMaxMinMeanABvalues() - calc row r ft max and min MeanA(B) values getFilterSummaryHTML() - get an HTML summary of the test/data filters used. Internal Class
=================== Class TestDataForRelDir contains lists of rows of data computed as side effect for computing active lists when calling getAllTestDataForRelDir().
*

This code is available at the HTMLtools project on SourceForge at http://htmltools.sourceforge.org/ under the "Common Public License Version 1.0" http://www.opensource.org/licenses/cpl1.0.php.

It was derived and refactored from the open source MAExplorer (http://maexplorer.sourceforge.org/), and Open2Dprot (http://Open2Dprot.sourceforge.net/) Table modules.

$Date: 2009/07/20 11:45:56 $ $Revision: 1.28 $
Copyright 2008, 2009 by Peter Lemkin E-Mail: lemkin@users.sourceforge.net http://lemkingroup.com/


Nested Class Summary
(package private)  class MakeTestsIntersectionTbl.TestDataForRelDir
          Class to contain lists of rows of data computed as side effect for computing active lists when calling getAllTestDataForRelDir().
 
Field Summary
 HTMLtools cvt
           
private  java.lang.String filterDataField
          Specifies the tField name of MRR Table data to test.
private  java.lang.String[] filterDataList
          Specifies the list of filter instances to test.
private  java.lang.String filterTestField
          Specifies the tField name of Tests-ToDo Table data to test.
private  java.lang.String[] filterTestsList
          Specifies the list of filter instances to test.
 FileTable fio
          Global fileTable instance
 FileTable ftGTT
          The FileTable created from the {test-ToDo-list.txt} file.
 FileTable ftTI
          The FileTable Test-Intersection Table created from the tests data that intersection the genes in the tests.
private  int idx_pValueThr
          The index variables for the Test-ToDo ftGTT Table instance variables.
private  int idxAffyCELfile
          The index variables for the Test-ToDo ftGTT Table instance variables.
private  int idxClassA
          The index variables for the Test-ToDo ftGTT Table instance variables.
private  int idxClassB
          The index variables for the Test-ToDo ftGTT Table instance variables.
private  int idxFCcalc
          The index variables for the Test-ToDo ftGTT Table instance variables.
private  int idxFCthr
          The index variables for the Test-ToDo ftGTT Table instance variables.
private  int idxFeatureIDftTI
          The index variables for the ftTI Tests-Intersection Table instance variables.
private  int idxGeneftTI
          The index variables for the ftTI Tests-Intersection Table instance variables.
private  int idxGSP_ID
          The index variables for the Test-ToDo ftGTT Table instance variables.
private  int idxHTMLpageDescr
          The index variables for the Test-ToDo ftGTT Table instance variables.
private  int idxHTMLpageLabel
          The index variables for the Test-ToDo ftGTT Table instance variables.
private  int idxHTMLtissueName
          The index variables for the Test-ToDo ftGTT Table instance variables.
private  int idxMaxFCftTI
          The following are computed AFTER the TI is built
private  int idxMinFCftTI
          The following are computed AFTER the TI is built
private  int idxPercentFCftTI
          The following are computed AFTER the TI is built
private  int idxRangeFCftTI
          The following are computed AFTER the TI is built
private  int idxRangeMeanAftTI
          The following are computed AFTER the TI is built
private  int idxRangeMeanBftTI
          The following are computed AFTER the TI is built
private  int idxRelDir
          The index variables for the Test-ToDo ftGTT Table instance variables.
private  int idxSimpleGSP_ID
          The index variables for the Test-ToDo ftGTT Table instance variables.
private  int idxTestName
          The index variables for the Test-ToDo ftGTT Table instance variables.
private  int idxWellIDftTI
          The index variables for the ftTI Tests-Intersection Table instance variables.
private  float[] maxMeanA
          Data accumulated while reading the individual tests and then used to compute the ranges of the means for inclusion in the final ftTI Table.
private  float[] maxMeanB
          Data accumulated while reading the individual tests and then used to compute the ranges of the means for inclusion in the final ftTI Table.
private  int MEANS_ALLOC
          Allocate xxxMeanX[] and rangeMeanX[] to MEANS_ALLOC, but then only use the data up to ftTI.tRows (before -limitMaxRows of the Table).
private  float[] minMeanA
          Data accumulated while reading the individual tests and then used to compute the ranges of the means for inclusion in the final ftTI Table.
private  float[] minMeanB
          Data accumulated while reading the individual tests and then used to compute the ranges of the means for inclusion in the final ftTI Table.
private  java.lang.String s_pValueThr
          The Test-ToDo ftGTT Table instance variables
private  java.lang.String sAffyCELfile
          The Test-ToDo ftGTT Table instance variables
private  java.lang.String sClassA
          The Test-ToDo ftGTT Table instance variables
private  java.lang.String sClassB
          The Test-ToDo ftGTT Table instance variables
private  java.lang.String sFCcalc
          The Test-ToDo ftGTT Table instance variables
private  java.lang.String sFCthr
          The Test-ToDo ftGTT Table instance variables
private  java.lang.String sGSP_ID
          The Test-ToDo ftGTT Table instance variables
private  java.lang.String sHTMLpageDescr
          The Test-ToDo ftGTT Table instance variables
private  java.lang.String sHTMLpageLabel
          The Test-ToDo ftGTT Table instance variables
private  java.lang.String sHTMLtissueName
          The Test-ToDo ftGTT Table instance variables
private  java.lang.String sRelDir
          The Test-ToDo ftGTT Table instance variables
private  java.lang.String sSimpleGSP_ID
          The Test-ToDo ftGTT Table instance variables
private  java.lang.String sTestName
          The Test-ToDo ftGTT Table instance variables
private  MakeTestsIntersectionTbl.TestDataForRelDir tdfrd
          Class to contain lists of rows of data computed as side effect for computing active lists when calling getAllTestDataForRelDir().
 java.lang.String testsInputTreePath
          Input tree dir path from current directory
 boolean testsSizeLimitedFlag
           
private  java.lang.String testsToDoTblPath
          The path for the tests directory from the current directory.
 java.lang.String[] uniqueRelDir
          Unique list of Relative Directory entries.
 
Constructor Summary
MakeTestsIntersectionTbl(HTMLtools cvt)
          MakeTestsIntersectionTbl() - Constructor
 
Method Summary
private  boolean addAllTestsDataToTI(FileTable ftGTT, java.lang.String tissueName, java.lang.String relativeDir)
          addAllTestsDataToTI() - add all Tests Data to ftTI Table for a Tissue.
private  boolean addFCdataInstanceToTI(FileTable ftFCplus, FileTable ftFCminus, FileTable ftTI, java.lang.String tissueName, java.lang.String testName, java.lang.String pValueFCthrs, java.lang.String pageLabel, java.lang.String AsampleName, java.lang.String BsampleName)
          addFCdataInstanceToTI() - add gene FC data to Test-Intersection Table.
private  boolean addFCrangesForTestsIntersectionTable()
          addFCrangesForTestsIntersectionTable() - adding FC range computations which expands the table and adds the three columns ("Max FC", "Min FC", "Range FC").
private  boolean calcRunningMaxMinMeanABvalues(int rM, int rD, FileTable ftD, int idxMeanA_FC, int idxMeanB_FC)
          calcRunningMaxMinMeanABvalues() - calc row r ftData max and min MeanA(B) values Get the data from the ft fields "A Mean" and "B Mean".
 boolean createTestsIntersectionTable()
          createTestsIntersectionTable() - create the Tests-Intersection Table.
private  java.lang.String cvtSimpleGspId2EG(java.lang.String sgi)
          cvtSimpleGspId2EG() - map Simple GSP ID to an EGxxxx.y
private  boolean getAllTestDataForRelDir(java.lang.String relDir)
          getAllTestDataForRelDir() - get list of test data for a relative directory in tdfrd class instance.
 java.lang.String getFilterSummaryHTML(java.lang.String baseFileName)
          getFilterSummaryHTML() - get an HTML summary of the test/data filters used.
private  boolean getTestToDoRowData(int r)
          getTestToDoRowData() - get and save row data to class 's'prefix variables.
private  boolean initTblHeaderIndexes()
          initTblHeaderIndexes() - get TestToDo Table header idx variables [REFACTOR] so that the ftGTT files are not hardwired.
 boolean initTestsIntersection(java.lang.String testsToDoPath)
          initTestsIntersection() - initialize the input files and I/O paths to make sure they are well formed and exist.
private  java.lang.String[] makeUniqueRelDirList()
          makeUniqueRelDirList() - generate unique list of Relative Dir.
private  boolean matchDataFilter(FileTable ftMRR, int rowNbr)
          matchDataFilter() - test the tField name of current MRR Table data.
private  boolean matchTestFilter(FileTable ft, int rowToTest)
          matchTestFilter() - test current test tField name of ft Table data to test.
 boolean setDataFilterList(java.lang.String filterDataField, java.lang.String[] filterDataList)
          setDataFilterList() - set list of data keywords for filtering data.
 boolean setTestFilterList(java.lang.String filterTestField, java.lang.String[] filterTestsList)
          setTestFilterList() - set list of test keywords for filtering tests.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cvt

public HTMLtools cvt

fio

public FileTable fio
Global fileTable instance


tdfrd

private MakeTestsIntersectionTbl.TestDataForRelDir tdfrd
Class to contain lists of rows of data computed as side effect for computing active lists when calling getAllTestDataForRelDir().


uniqueRelDir

public java.lang.String[] uniqueRelDir
Unique list of Relative Directory entries.


ftGTT

public FileTable ftGTT
The FileTable created from the {test-ToDo-list.txt} file. Set with '-MakeTestsIntersectionTbl:{mAdb-TestsToDo.txt}'.


ftTI

public FileTable ftTI
The FileTable Test-Intersection Table created from the tests data that intersection the genes in the tests.


testsToDoTblPath

private java.lang.String testsToDoTblPath
The path for the tests directory from the current directory.


testsInputTreePath

public java.lang.String testsInputTreePath
Input tree dir path from current directory


idxAffyCELfile

private int idxAffyCELfile
The index variables for the Test-ToDo ftGTT Table instance variables.


idxSimpleGSP_ID

private int idxSimpleGSP_ID
The index variables for the Test-ToDo ftGTT Table instance variables.


idxGSP_ID

private int idxGSP_ID
The index variables for the Test-ToDo ftGTT Table instance variables.


idxClassA

private int idxClassA
The index variables for the Test-ToDo ftGTT Table instance variables.


idxClassB

private int idxClassB
The index variables for the Test-ToDo ftGTT Table instance variables.


idxFCcalc

private int idxFCcalc
The index variables for the Test-ToDo ftGTT Table instance variables.


idxTestName

private int idxTestName
The index variables for the Test-ToDo ftGTT Table instance variables.


idx_pValueThr

private int idx_pValueThr
The index variables for the Test-ToDo ftGTT Table instance variables.


idxFCthr

private int idxFCthr
The index variables for the Test-ToDo ftGTT Table instance variables.


idxHTMLpageLabel

private int idxHTMLpageLabel
The index variables for the Test-ToDo ftGTT Table instance variables.


idxHTMLpageDescr

private int idxHTMLpageDescr
The index variables for the Test-ToDo ftGTT Table instance variables.


idxHTMLtissueName

private int idxHTMLtissueName
The index variables for the Test-ToDo ftGTT Table instance variables.


idxRelDir

private int idxRelDir
The index variables for the Test-ToDo ftGTT Table instance variables.


sAffyCELfile

private java.lang.String sAffyCELfile
The Test-ToDo ftGTT Table instance variables


sSimpleGSP_ID

private java.lang.String sSimpleGSP_ID
The Test-ToDo ftGTT Table instance variables


sGSP_ID

private java.lang.String sGSP_ID
The Test-ToDo ftGTT Table instance variables


sClassA

private java.lang.String sClassA
The Test-ToDo ftGTT Table instance variables


sClassB

private java.lang.String sClassB
The Test-ToDo ftGTT Table instance variables


sFCcalc

private java.lang.String sFCcalc
The Test-ToDo ftGTT Table instance variables


sTestName

private java.lang.String sTestName
The Test-ToDo ftGTT Table instance variables


s_pValueThr

private java.lang.String s_pValueThr
The Test-ToDo ftGTT Table instance variables


sFCthr

private java.lang.String sFCthr
The Test-ToDo ftGTT Table instance variables


sHTMLpageLabel

private java.lang.String sHTMLpageLabel
The Test-ToDo ftGTT Table instance variables


sHTMLpageDescr

private java.lang.String sHTMLpageDescr
The Test-ToDo ftGTT Table instance variables


sHTMLtissueName

private java.lang.String sHTMLtissueName
The Test-ToDo ftGTT Table instance variables


sRelDir

private java.lang.String sRelDir
The Test-ToDo ftGTT Table instance variables


idxGeneftTI

private int idxGeneftTI
The index variables for the ftTI Tests-Intersection Table instance variables.


idxFeatureIDftTI

private int idxFeatureIDftTI
The index variables for the ftTI Tests-Intersection Table instance variables.


idxWellIDftTI

private int idxWellIDftTI
The index variables for the ftTI Tests-Intersection Table instance variables.


idxMinFCftTI

private int idxMinFCftTI
The following are computed AFTER the TI is built


idxMaxFCftTI

private int idxMaxFCftTI
The following are computed AFTER the TI is built


idxRangeFCftTI

private int idxRangeFCftTI
The following are computed AFTER the TI is built


idxRangeMeanAftTI

private int idxRangeMeanAftTI
The following are computed AFTER the TI is built


idxRangeMeanBftTI

private int idxRangeMeanBftTI
The following are computed AFTER the TI is built


idxPercentFCftTI

private int idxPercentFCftTI
The following are computed AFTER the TI is built


maxMeanA

private float[] maxMeanA
Data accumulated while reading the individual tests and then used to compute the ranges of the means for inclusion in the final ftTI Table. Allocate these to MEANS_ALLOC, but then only use the data up to ftTI.tRows (before -limitMaxRows of the Table). The data actually used is [0:ftTI.tRows-1]. Note: only used if '-addRangeOfMeansToTItable' is set.


minMeanA

private float[] minMeanA
Data accumulated while reading the individual tests and then used to compute the ranges of the means for inclusion in the final ftTI Table. Allocate these to MEANS_ALLOC, but then only use the data up to ftTI.tRows (before -limitMaxRows of the Table). The data actually used is [0:ftTI.tRows-1]. Note: only used if '-addRangeOfMeansToTItable' is set.


maxMeanB

private float[] maxMeanB
Data accumulated while reading the individual tests and then used to compute the ranges of the means for inclusion in the final ftTI Table. Allocate these to MEANS_ALLOC, but then only use the data up to ftTI.tRows (before -limitMaxRows of the Table). The data actually used is [0:ftTI.tRows-1]. Note: only used if '-addRangeOfMeansToTItable' is set.


minMeanB

private float[] minMeanB
Data accumulated while reading the individual tests and then used to compute the ranges of the means for inclusion in the final ftTI Table. Allocate these to MEANS_ALLOC, but then only use the data up to ftTI.tRows (before -limitMaxRows of the Table). The data actually used is [0:ftTI.tRows-1]. Note: only used if '-addRangeOfMeansToTItable' is set.


MEANS_ALLOC

private final int MEANS_ALLOC
Allocate xxxMeanX[] and rangeMeanX[] to MEANS_ALLOC, but then only use the data up to ftTI.tRows (before -limitMaxRows of the Table).

See Also:
Constant Field Values

filterTestField

private java.lang.String filterTestField
Specifies the tField name of Tests-ToDo Table data to test. It is set by setTestFilterList(). This is used when deciding which tests in Tests-ToDo Table to include. All tests are included if there is no filterTests. Otherwise, only use those that match the filter. The matchTestFilter() tests the current data against the filter data.


filterTestsList

private java.lang.String[] filterTestsList
Specifies the list of filter instances to test. It is set by setTestFilterList(). This is used when deciding which tests in Tests-ToDo Table to include. All tests are included if there is no filterTests. Otherwise, only use those that match the filter. The matchTestFilter() tests the current data against the filter data.


filterDataField

private java.lang.String filterDataField
Specifies the tField name of MRR Table data to test. It is set by setDataFilterList(). This is used when deciding which data rows in MRR Table to include. All tests are included if there is no filterTests. Otherwise, only use those that match the filter. The matchDataFilter() tests the current data against the filter data.


filterDataList

private java.lang.String[] filterDataList
Specifies the list of filter instances to test. It is set by setDataFilterList(). This is used when deciding which data rows in MRR Table to include. All tests are included if there is no filterTests. Otherwise, only use those that match the filter. The matchDataFilter() tests the current data against the filter data.


testsSizeLimitedFlag

public boolean testsSizeLimitedFlag
Constructor Detail

MakeTestsIntersectionTbl

public MakeTestsIntersectionTbl(HTMLtools cvt)
MakeTestsIntersectionTbl() - Constructor

Parameters:
cvt - is instance of HTMLtools
See Also:
setTestFilterList(java.lang.String, java.lang.String[]), setDataFilterList(java.lang.String, java.lang.String[])
Method Detail

setTestFilterList

public boolean setTestFilterList(java.lang.String filterTestField,
                                 java.lang.String[] filterTestsList)
setTestFilterList() - set list of test keywords for filtering tests. This is used when deciding which tests in Tests-ToDo Table to include. All tests are included if there is no filterTests. Otherwise, only use those that match the filter.

Parameters:
filterTestField - - tField name of Tests-ToDo Table data to test
filterTests - - list of filter instances to test.
Returns:
true if valid test data.

setDataFilterList

public boolean setDataFilterList(java.lang.String filterDataField,
                                 java.lang.String[] filterDataList)
setDataFilterList() - set list of data keywords for filtering data. This is used when deciding which data rows in MRR Table to include. All tests are included if there is no filterTests. Otherwise, only use those that match the filter.

Parameters:
filterDataField - - tField name of MRR Table data to test
filterDataList - - list of filter instances to test.
Returns:
true if valid test data.

initTestsIntersection

public boolean initTestsIntersection(java.lang.String testsToDoPath)
initTestsIntersection() - initialize the input files and I/O paths to make sure they are well formed and exist. It creates, loads and validates the ftGTT (the "Test-ToDo-List" Table). It creates ftTI (the "Test-Intersection" Table) and sets up the header and the field indexes. It generates the unique list of Relative Directory entries. It sets up the this.testsToDoTblPath Set by -makeTestsIntersectionTable:{testsToDoFile}.

Parameters:
testsToDoPath - - path of test ToDo file
Returns:
true if data exists, false if any errors
See Also:
FileTable, FileTable.setHasTableHeaderFlag(boolean), FileTable.setRmvTrailingBlankLinesFlag(boolean), FileTable.setRmvTrailingEmptyColumnsFlag(boolean), FileTable.readAndParseTableAll(java.lang.String), FileTable.trimTableEnclWhitespace(boolean, boolean), FileTable.setFieldsToTable(java.lang.String[]), FileTable.setHeadersToTable(java.lang.String[][], int, int), FileTable.lookupFieldIdx(java.lang.String), FileIO.mapPathFileSeparators(java.lang.String), initTblHeaderIndexes(), makeUniqueRelDirList(), UtilCM.logMsg(java.lang.String)

initTblHeaderIndexes

private boolean initTblHeaderIndexes()
initTblHeaderIndexes() - get TestToDo Table header idx variables [REFACTOR] so that the ftGTT files are not hardwired.

Returns:
true if there is valid data
See Also:
FileIO.mapPathFileSeparators(java.lang.String)

getTestToDoRowData

private boolean getTestToDoRowData(int r)
getTestToDoRowData() - get and save row data to class 's'prefix variables. This assumes that the TestToDo Table header idx variables have been initialized successfully with initTblHeaderIndexes().

Parameters:
r - - is row to get from the table
Returns:
true if there is valid data

createTestsIntersectionTable

public boolean createTestsIntersectionTable()
createTestsIntersectionTable() - create the Tests-Intersection Table. Process the Test-ToDo Table for each Rel.Dir. Filter out tests that do not match the -filterTest or -filterData filters then compute the FC for each gene row and then add a new labeled column to the ftTI Table. If adding FC range computations, then expand the table and add the three columns "Min FC" "Max FC" FC Range". This is set by the '-addFCrangesForTestsIntersectionTable' switch.

Returns:
true if created the Tests-Intersection Table.
See Also:
getAllTestDataForRelDir(java.lang.String), matchTestFilter(FileTable, int), addAllTestsDataToTI(FileTable, java.lang.String, java.lang.String), addFCrangesForTestsIntersectionTable(), UtilCM.logMsg(java.lang.String)

addAllTestsDataToTI

private boolean addAllTestsDataToTI(FileTable ftGTT,
                                    java.lang.String tissueName,
                                    java.lang.String relativeDir)
addAllTestsDataToTI() - add all Tests Data to ftTI Table for a Tissue. This is done by computing the compute the FC for each gene row where it will be either +FC or -FC since they are mutually exclusive and then add a new labeled column to the ftTI Table.

Parameters:
ftGTT - - tests-todo Table used in the filter if we are filtering.
paramTestPath - - directory to put parameter map files
tissueName - - is the main CellTypeTissue for header
relativeDir - - is the main Relative Directory for header where to put the HTML files.
Returns:
true if succeed, else 0
See Also:
FileIO.mapPathFileSeparators(java.lang.String), FileTable.setHasTableHeaderFlag(boolean), FileTable.setDuplicateFieldsFlag(boolean), FileTable.setNbrTableHdrLines(int), FileTable.setRmvTrailingBlankLinesFlag(boolean), FileTable.setRmvTrailingEmptyColumnsFlag(boolean), FileTable.setHasEmptyLineBeforeTableFlag(boolean), FileTable.setStartTableAtColStr(java.lang.String), FileTable.readAndParseTableAll(java.lang.String), addFCdataInstanceToTI(FileTable, FileTable, FileTable, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String), UtilCM.logMsg(java.lang.String)

addFCdataInstanceToTI

private boolean addFCdataInstanceToTI(FileTable ftFCplus,
                                      FileTable ftFCminus,
                                      FileTable ftTI,
                                      java.lang.String tissueName,
                                      java.lang.String testName,
                                      java.lang.String pValueFCthrs,
                                      java.lang.String pageLabel,
                                      java.lang.String AsampleName,
                                      java.lang.String BsampleName)
addFCdataInstanceToTI() - add gene FC data to Test-Intersection Table. This is done by computing the FC for each gene row where it will be either +FC or -FC since they are mutually exclusive and then add a new labeled column to the ftTI Table.

Parameters:
ftFCplus - - the +FC tests data instance FileTable
ftFCminus - - the -FC tests data instance FileTable
ftTI - - the Tests-Intersection FileTable
tissueName - - name of the tissue
testName - - test name ("EGn.m-test-k+FC or -FC)
pValueFCthrs - - "p-Value<={value} |FC|<={value}"
pageLabel - - contains the "A vs B" label
AsampleName - - contains "A" label
BsampleName - - contains "B" label
Returns:
true if succeed
See Also:
FileTable.addColumnToTable(java.lang.String, java.lang.String[]), FileTable.appendRowToTable(java.lang.String[]), FileTable.lookupFieldIdx(java.lang.String), UtilCM.logMsg(java.lang.String)

makeUniqueRelDirList

private java.lang.String[] makeUniqueRelDirList()
makeUniqueRelDirList() - generate unique list of Relative Dir. entries.

Returns:
list of relative directories if succeed, else null

getAllTestDataForRelDir

private boolean getAllTestDataForRelDir(java.lang.String relDir)
getAllTestDataForRelDir() - get list of test data for a relative directory in tdfrd class instance. These include the following class variables:
 
 It computes the sorted lists [0:nTestDataForRelDir-1] of data for 
 documenting the tests for the relative directory.
   (EGlistForRelDir, EGSummaryTitleForRelDir, classAforRelDir,
    classBforRelDir, pageLabelListForRelDir, pageDescrForRelDir,
    testNameListForRelDir, rowListForRelDir). 
 It also computes a list uniqueEGgroups[0:-1].
 
The data is saved, in global class instance tdfrd, as a list of rows of matching test data found.

Parameters:
lookForRelDir - is the relative directory to look for
Returns:
true if succeed with data left in class variables, else false if an error.

cvtSimpleGspId2EG

private java.lang.String cvtSimpleGspId2EG(java.lang.String sgi)
cvtSimpleGspId2EG() - map Simple GSP ID to an EGxxxx.y


matchTestFilter

private boolean matchTestFilter(FileTable ft,
                                int rowToTest)
matchTestFilter() - test current test tField name of ft Table data to test. This is used when deciding which tests in Tests- Table to include. All tests are included if there is no filterTests. Otherwise, only use those that match the filter.

Parameters:
ft - - Table to test
rowToTest - - entry to test with the filter.
Returns:
true if matches or not doing filtering or bad filter data.
See Also:
FileTable.lookupFieldIdx(java.lang.String)

matchDataFilter

private boolean matchDataFilter(FileTable ftMRR,
                                int rowNbr)
matchDataFilter() - test the tField name of current MRR Table data. This is used when deciding which data rows in MRR Table to include. All tests are included if there is no filterTests. Otherwise, only use those that match the filter.

Parameters:
ftMRR - - data that is used if it passes the filter
rowNbr - - row to test with filter.
Returns:
true if matches or not doing filtering or bad filter data.
See Also:
FileTable.lookupFieldIdx(java.lang.String)

addFCrangesForTestsIntersectionTable

private boolean addFCrangesForTestsIntersectionTable()
addFCrangesForTestsIntersectionTable() - adding FC range computations which expands the table and adds the three columns ("Max FC", "Min FC", "Range FC").

Returns:
true if succeed, false if there is a problem or less than 2 data columns.
See Also:
FileTable.addColumnToTable(java.lang.String, java.lang.String[]), FileTable.lookupFieldIdx(java.lang.String)

calcRunningMaxMinMeanABvalues

private boolean calcRunningMaxMinMeanABvalues(int rM,
                                              int rD,
                                              FileTable ftD,
                                              int idxMeanA_FC,
                                              int idxMeanB_FC)
calcRunningMaxMinMeanABvalues() - calc row r ftData max and min MeanA(B) values Get the data from the ft fields "A Mean" and "B Mean". Save data in maxMeanA[rM], minMeanA[rM], maxMeanB[rM],minMeanB[rM]

Parameters:
rM - index for max/min arrays and matches ftTI data.
rD - is row to get means data from the current test Table
ftD - is the data table to use
idxMeanA_FC - is the index of "A Mean"
idxMeanB_FC - is the index of "B Mean"
Returns:
true if succeed.

getFilterSummaryHTML

public java.lang.String getFilterSummaryHTML(java.lang.String baseFileName)
getFilterSummaryHTML() - get an HTML summary of the test/data filters used. This adds additional documentation based on which options were selected.

Returns:
summary else "";