|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object MakeTestsIntersectionTbl
public class MakeTestsIntersectionTbl
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 |
---|
public HTMLtools cvt
public FileTable fio
private MakeTestsIntersectionTbl.TestDataForRelDir tdfrd
public java.lang.String[] uniqueRelDir
public FileTable ftGTT
public FileTable ftTI
private java.lang.String testsToDoTblPath
public java.lang.String testsInputTreePath
private int idxAffyCELfile
private int idxSimpleGSP_ID
private int idxGSP_ID
private int idxClassA
private int idxClassB
private int idxFCcalc
private int idxTestName
private int idx_pValueThr
private int idxFCthr
private int idxHTMLpageLabel
private int idxHTMLpageDescr
private int idxHTMLtissueName
private int idxRelDir
private java.lang.String sAffyCELfile
private java.lang.String sSimpleGSP_ID
private java.lang.String sGSP_ID
private java.lang.String sClassA
private java.lang.String sClassB
private java.lang.String sFCcalc
private java.lang.String sTestName
private java.lang.String s_pValueThr
private java.lang.String sFCthr
private java.lang.String sHTMLpageLabel
private java.lang.String sHTMLpageDescr
private java.lang.String sHTMLtissueName
private java.lang.String sRelDir
private int idxGeneftTI
private int idxFeatureIDftTI
private int idxWellIDftTI
private int idxMinFCftTI
private int idxMaxFCftTI
private int idxRangeFCftTI
private int idxRangeMeanAftTI
private int idxRangeMeanBftTI
private int idxPercentFCftTI
private float[] maxMeanA
private float[] minMeanA
private float[] maxMeanB
private float[] minMeanB
private final int MEANS_ALLOC
private java.lang.String filterTestField
private java.lang.String[] filterTestsList
private java.lang.String filterDataField
private java.lang.String[] filterDataList
public boolean testsSizeLimitedFlag
Constructor Detail |
---|
public MakeTestsIntersectionTbl(HTMLtools cvt)
cvt
- is instance of HTMLtoolssetTestFilterList(java.lang.String, java.lang.String[])
,
setDataFilterList(java.lang.String, java.lang.String[])
Method Detail |
---|
public boolean setTestFilterList(java.lang.String filterTestField, java.lang.String[] filterTestsList)
filterTestField
- - tField name of Tests-ToDo Table data to testfilterTests
- - list of filter instances to test.
public boolean setDataFilterList(java.lang.String filterDataField, java.lang.String[] filterDataList)
filterDataField
- - tField name of MRR Table data to testfilterDataList
- - list of filter instances to test.
public boolean initTestsIntersection(java.lang.String testsToDoPath)
testsToDoPath
- - path of test ToDo file
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)
private boolean initTblHeaderIndexes()
FileIO.mapPathFileSeparators(java.lang.String)
private boolean getTestToDoRowData(int r)
r
- - is row to get from the table
public boolean createTestsIntersectionTable()
getAllTestDataForRelDir(java.lang.String)
,
matchTestFilter(FileTable, int)
,
addAllTestsDataToTI(FileTable, java.lang.String, java.lang.String)
,
addFCrangesForTestsIntersectionTable()
,
UtilCM.logMsg(java.lang.String)
private boolean addAllTestsDataToTI(FileTable ftGTT, java.lang.String tissueName, java.lang.String relativeDir)
ftGTT
- - tests-todo Table used in the filter if we are filtering.paramTestPath
- - directory to put parameter map filestissueName
- - is the main CellTypeTissue for headerrelativeDir
- - is the main Relative Directory for header
where to put the HTML files.
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)
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)
ftFCplus
- - the +FC tests data instance FileTableftFCminus
- - the -FC tests data instance FileTableftTI
- - the Tests-Intersection FileTabletissueName
- - name of the tissuetestName
- - test name ("EGn.m-test-k+FC or -FC)pValueFCthrs
- - "p-Value<={value} |FC|<={value}"pageLabel
- - contains the "A vs B" labelAsampleName
- - contains "A" labelBsampleName
- - contains "B" label
FileTable.addColumnToTable(java.lang.String, java.lang.String[])
,
FileTable.appendRowToTable(java.lang.String[])
,
FileTable.lookupFieldIdx(java.lang.String)
,
UtilCM.logMsg(java.lang.String)
private java.lang.String[] makeUniqueRelDirList()
private boolean getAllTestDataForRelDir(java.lang.String relDir)
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.
lookForRelDir
- is the relative directory to look for
private java.lang.String cvtSimpleGspId2EG(java.lang.String sgi)
private boolean matchTestFilter(FileTable ft, int rowToTest)
ft
- - Table to testrowToTest
- - entry to test with the filter.
FileTable.lookupFieldIdx(java.lang.String)
private boolean matchDataFilter(FileTable ftMRR, int rowNbr)
ftMRR
- - data that is used if it passes the filterrowNbr
- - row to test with filter.
FileTable.lookupFieldIdx(java.lang.String)
private boolean addFCrangesForTestsIntersectionTable()
FileTable.addColumnToTable(java.lang.String, java.lang.String[])
,
FileTable.lookupFieldIdx(java.lang.String)
private boolean calcRunningMaxMinMeanABvalues(int rM, int rD, FileTable ftD, int idxMeanA_FC, int idxMeanB_FC)
rM
- index for max/min arrays and matches ftTI data.rD
- is row to get means data from the current test TableftD
- is the data table to useidxMeanA_FC
- is the index of "A Mean"idxMeanB_FC
- is the index of "B Mean"
public java.lang.String getFilterSummaryHTML(java.lang.String baseFileName)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |