|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectGenBatchScripts
public class GenBatchScripts
Class GenBatchScripts to generate a set of scripts to batch convert a set of data specified by the {test-TODO-list.txt} table. It is invoked by '-genBatchScripts:{mAdb-TestsToDo.txt,batchScripts,ParamsScripts, InputTree,Summary,Analyses,JTV}'.
It generates a set of parameter .map files in the batchDir directory. These can then be run by a converter batch file called with the same base name as the {test-TODO-list.txt} file, but with a ".doit" file extension. The operation also creates a BAT script to start the converter on this data called {test-TODO-list.bat} for use with Windows. The paths created in the used for the inputTreeDir and outputTreeDir base paths and use the "Relative directory" data in the {test-TODO-list.txt} within those directories. This will process a data set to generate a set of HTML pages and converted database .txt files defined by the {test-TODO-list.txt} database. Default is no batch script generation.
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 (MRR & JTV) input: Converter output: Tests for samples: {testName}+FC.txt {testName}+FC.html {testName}+FC-keep.html {testName}-FC.txt {testName}-FC.html {testName}-FC-keep.html AND of above tests for ALL samples: {testName}+FC-ALL.txt {testName}+FC-ALL.html {testName}+FC-ALL-keep.html {testName}-FC-ALL.txt {testName}-FC-ALL.html {testName}-FC-ALL-keep.html JTV for test samples: (must have >= 3 samples between both classes) {testName}+FC-JTV.zip {testName}+FC-JTV/ {testName}+FC-JTV.html {testName}-FC-JTV.zip {testName}-FC-JTV/ {testName}-FC-JTV.html JTV above for and of above test with ALL Samples: {testName}+FC-ALL-JTV.zip {testName}+FC-ALL-JTV/ {testName}+FC-ALL-JTV.html {testName}-FC-ALL-JTV.zip {testName}-FC-ALL-JTV/ {testName}-FC-ALL-JTV.html Generated params .map scripts to process the data The -genBatchScripts function will generate the following converter scripts to process the data: params-+FC.map params- -FC.map params- +FC-keep.map params- -FC-keep.map params- +FC-ALL.map params- -FC-ALL.map params- +FC-JTV.map (must have >= 3 samples between both classes) params- -FC-JTV.map (must have >= 3 samples between both classes) params- +FC-ALL-JTV.map params- -FC-ALL-JTV.map 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: -genBatchScript:{test-TODO-list.txt,batchDir,inputTreeDir, outputTreeDir} cvt.genTestToDoListFile cvt.genBatchDir cvt.genInputTreeDir cvt.genOutputTreeDir cvt.genBatchScriptFlag List of Methods
=================== GenBatchScripts() - Constructor initGenBatch() - initialize the input files and I/O paths initTblHeaderIndexes() - get TestToDo Table header idx variables getTestToDoRowData() - get and save the row data to class variables. createBatchScripts() - generate the batch scripts generateHTMLsummaryFile() - Generate HTML summary file parameter map file. generateParamMapTestFiles() - Generate an HTML test file parameter map file. generateJTV_HTMLfile() - Generate a JTV HTML file parameter map file getAllTestDataForRelDir() - get list of test data for rel-dir in tdfrd instance. makeUniqueRelDirList() - generate unique list of Relative Dir. entries. makeBatFile() - Windows .bat string to run -batchProcess generated batch copySupportFiles() - copy support files to the batchScriptsDir. getExperGroupsInTestList() get unique list of EG groups in list of tests. cvtSimpleGspId2EG() - map Simple GSP ID to an EGxxxx.y 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/15 11:45:56 $ $Revision: 1.27 $
Copyright 2008, 2009 by Peter Lemkin
E-Mail: lemkin@users.sourceforge.net
http://lemkingroup.com/
Nested Class Summary | |
---|---|
(package private) class |
GenBatchScripts.TestDataForRelDir
Class to contain lists of rows of data computed as side effect for computing active lists when calling getAllTestDataForRelDir(). |
Field Summary | |
---|---|
private java.lang.String |
analysesPath
The directory where save the generated Analyses files when the subsequent batch job is run. |
java.lang.String |
batchConversionDate
Date stamp for batch conversion |
java.lang.String |
batchDoitFile
Batch .doit file name for the created batch output file. |
java.lang.String |
batchPath
Path batch top level directory |
HTMLtools |
cvt
|
FileTable |
fio
Global fileTable instance |
FileTable |
ftCTT
FileTable created from the {CellTypeTissue.map} used to map "CellTypeTissue" data to the "Introduction" data.. |
FileTable |
ftEG
FileTable created from the {experimentGroups.map} Table that 'could' be used to get other experiment group data for the summaries if we decide we want to add it. |
FileTable |
ftGTT
The FileTable created from the {test-ToDo-list.txt} file. |
FileTable |
ftL2S
FileTable created from the {long2ShortHdrNamesTable.map} Table that 'could' be used to map 'Short GSP ID's to 'GSP ID's if we decide to list the members of 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 |
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. |
int |
idxParamJTV
Indexes into Parameter templates lists. |
int |
idxParamMRR
Indexes into Parameter templates lists. |
int |
idxParamMRRkeep
Indexes into Parameter templates lists. |
int |
idxParamMRRsaveFile
Indexes into Parameter templates lists. |
int |
idxParamTI
Indexes into Parameter templates lists. |
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 java.lang.String |
inputTreePath
The directory where the subsequent batch job gets its input data files. |
private java.lang.String |
jtvPath
The directory where save the generated JTV files when the subsequent batch job is run. |
int |
nParamScripts
Counter for generated parameter scripts. |
int |
nParamTemplates
Size of list of Parameter template names and file names |
int |
nSummaryHTMLfiles
Counter for generated Summary HTML files. |
private java.lang.String |
paramsTestDir
The directory where save the generated params .map files. |
java.lang.String[] |
paramTemplates
List of Parameter template strings |
java.lang.String[] |
paramTemplatesFiles
List of default Parameter template file names. |
java.lang.String[] |
paramTemplatesNames
List of Parameter template names |
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 |
java.lang.String |
sBatchDoitData
Batch Data as the file name used to create the batch output file. |
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 java.lang.String |
summaryPath
The directory where save the generated Summary HTML files. |
private GenBatchScripts.TestDataForRelDir |
tdfrd
Class to contain lists of rows of data computed as side effect for computing active lists when calling getAllTestDataForRelDir(). |
java.lang.String[] |
uniqueRelDir
Unique list of Relative Directory entries. |
Constructor Summary | |
---|---|
GenBatchScripts(HTMLtools cvt)
GenBatchScripts() - Constructor |
Method Summary | |
---|---|
private boolean |
copySupportFiles(java.lang.String batchScriptsDir,
java.lang.String[] genSupportFilesToCopy,
int nGenSupportFilesToCopy)
copySupportFiles() - copy support files to the batchScriptsDir. |
boolean |
createBatchScripts()
createBatchScripts() - generate the batch scripts. |
private boolean |
createWriteParamMapFile(int nMaps,
java.lang.String[] keyList,
java.lang.String[] toStrList,
java.lang.String paramTestDir,
java.lang.String paramTemplate,
java.lang.String paramMapNameFile)
createAndWriteParamMapFile() - create and write a parameter map file. |
private java.lang.String |
cvtSimpleGspId2EG(java.lang.String sgi)
cvtSimpleGspId2EG() - map Simple GSP ID to an EGxxxx.y |
private boolean |
generateHTMLsummaryFile(java.lang.String summaryFileDir,
java.lang.String tissueName,
java.lang.String relativeDir,
int[] rowListForTest,
java.lang.String sTemplate)
generateHTMLsummaryFile() - Generate an HTML summary file parameter map file. |
private boolean |
genParamMapTestFiles(java.lang.String paramTestPath,
java.lang.String analysesPath,
java.lang.String tissueName,
java.lang.String relativeDir)
generateParamMapTestFiles() - Generate parameter map files for tissue. |
private boolean |
getAllTestDataForRelDir(java.lang.String relDir)
getAllTestDataForRelDir() - get list of test data for a relative directory in tdfrd class instance. |
private boolean |
getTestToDoRowData(int r)
getTestToDoRowData() - get and save the row data to class variables. |
boolean |
initGenBatch(java.lang.String baseDataDir,
java.lang.String genTestToDoListPath,
java.lang.String cellTypeTissuePath,
java.lang.String long2ShortHdrNamesTablePath,
java.lang.String experimentGroupsPath)
initGenBatch() - initialize the input files and I/O paths to make sure they are well formed and exist. |
private boolean |
initTblHeaderIndexes()
initTblHeaderIndexes() - get TestToDo Table header idx variables [REFACTOR] so that the ftGTT files are not hardwired. |
private java.lang.String |
makeBatFileStr(java.lang.String batchScriptsDir,
java.lang.String doitScriptName,
java.lang.String batFileName)
makeBatFile() - Windows .bat string to run -batchProcess generated batch |
private java.lang.String[] |
makeUniqueRelDirList()
makeUniqueRelDirList() - generate unique list of Relative Directory entries. |
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 GenBatchScripts.TestDataForRelDir tdfrd
private java.lang.String paramsTestDir
private java.lang.String inputTreePath
private java.lang.String summaryPath
private java.lang.String analysesPath
private java.lang.String jtvPath
public java.lang.String[] uniqueRelDir
public FileTable ftGTT
public FileTable ftCTT
public FileTable ftL2S
public FileTable ftEG
public java.lang.String batchPath
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
public java.lang.String[] paramTemplatesNames
public java.lang.String[] paramTemplatesFiles
public java.lang.String[] paramTemplates
public int nParamTemplates
public int idxParamMRR
public int idxParamMRRkeep
public int idxParamJTV
public int idxParamMRRsaveFile
public int idxParamTI
public java.lang.String batchDoitFile
public java.lang.String sBatchDoitData
public java.lang.String batchConversionDate
public int nParamScripts
public int nSummaryHTMLfiles
Constructor Detail |
---|
public GenBatchScripts(HTMLtools cvt)
cvt
- is instance of HTMLtoolsUtilCM.dateStr()
,
GenBatchScripts.TestDataForRelDir
Method Detail |
---|
public boolean initGenBatch(java.lang.String baseDataDir, java.lang.String genTestToDoListPath, java.lang.String cellTypeTissuePath, java.lang.String long2ShortHdrNamesTablePath, java.lang.String experimentGroupsPath)
genTestToDoListPath
- - path of test ToDo filecellTypeTissuePath
- - path of test CellTypeTissue.map filelong2ShortHdrNamesTablePath
- - path to long2ShortHdrNames.map fileexperimentGroupsPath
- - path to ExperimentGroups.map 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)
,
FileIO.makePathSubDirs(java.lang.String)
,
initTblHeaderIndexes()
,
makeUniqueRelDirList()
,
UtilCM.logMsg(java.lang.String)
private boolean initTblHeaderIndexes()
FileTable.lookupFieldIdx(java.lang.String)
,
FileIO.mapPathFileSeparators(java.lang.String)
private boolean getTestToDoRowData(int r)
r
- - is row to get from the table
public boolean createBatchScripts()
UtilCM.logMsg(java.lang.String)
,
FileIO.readFileAsString(java.lang.String)
,
FileIO.makeDirectory(java.lang.String, boolean)
,
FileIO.makePathSubDirs(java.lang.String)
,
FileIO.writeStringToFile(java.lang.String, java.lang.String)
,
FileIO.cvtRelDirToHyphenStr(java.lang.String)
,
getAllTestDataForRelDir(java.lang.String)
,
getTestToDoRowData(int)
,
genParamMapTestFiles(java.lang.String, java.lang.String, java.lang.String, java.lang.String)
,
makeBatFileStr(java.lang.String, java.lang.String, java.lang.String)
,
copySupportFiles(java.lang.String, java.lang.String[], int)
,
#copyDirectoryTree
private boolean generateHTMLsummaryFile(java.lang.String summaryFileDir, java.lang.String tissueName, java.lang.String relativeDir, int[] rowListForTest, java.lang.String sTemplate)
Note: it gets the prolog and epilogue HTML templages from the switch '-genHTMLsummary:{orderNbr,name,htmlFile}' entries.
It also updates the nSummaryHTMLfiles counter.
summaryFileDir
- - directory of the summary filetissueName
- - is the main CellTypeTissue for headerrelativeDir
- - is the main Relative Directory for headerrowListForTest
- - is list of ftGTT data rows for summary page -
this is tdfrd.rowListForRelDir[0:nTestDataForRelDir-1].sTemplate
- - is the template HTML file to map.
FileIO.cvtRelDirToHyphenStr(java.lang.String)
,
FileTable.lookupRowDataFromColumnData(java.lang.String, java.lang.String, java.lang.String)
,
FileIO.makeDirectory(java.lang.String, boolean)
,
FileIO.writeStringToFile(java.lang.String, java.lang.String)
,
UtilCM.replaceSubstrInString(java.lang.String, java.lang.String, java.lang.String)
private boolean genParamMapTestFiles(java.lang.String paramTestPath, java.lang.String analysesPath, java.lang.String tissueName, java.lang.String relativeDir)
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.cvtRelDirToHyphenStr(java.lang.String)
,
UtilCM#.replaceSubstrInString
,
createWriteParamMapFile(int, java.lang.String[], java.lang.String[], java.lang.String, java.lang.String, java.lang.String)
private boolean createWriteParamMapFile(int nMaps, java.lang.String[] keyList, java.lang.String[] toStrList, java.lang.String paramTestDir, java.lang.String paramTemplate, java.lang.String paramMapNameFile)
UtilCM.mapAllkeywords(java.lang.String, java.lang.String[], java.lang.String[], int)
,
UtilCM.replaceSubstrInString(java.lang.String, java.lang.String, java.lang.String)
,
UtilCM.logMsg(java.lang.String)
,
FileIO.writeStringToFile(java.lang.String, 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 makeBatFileStr(java.lang.String batchScriptsDir, java.lang.String doitScriptName, java.lang.String batFileName)
batchScriptsDir
- to run the .doit batch scriptdoitScriptName
- is batch .doit script to runbatFileName
- is the name of the Windows .bat file to generate in the
batchScriptsDir.
private boolean copySupportFiles(java.lang.String batchScriptsDir, java.lang.String[] genSupportFilesToCopy, int nGenSupportFilesToCopy)
batchScriptsDir
- - where run the .doit batch script and
where we copy the support files.
FileIO.mapPathFileSeparators(java.lang.String)
,
FileIO.makeDirectory(java.lang.String, boolean)
,
FileIO.copyFile(java.lang.String, java.lang.String)
private java.lang.String cvtSimpleGspId2EG(java.lang.String sgi)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |