|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectJTVconvert
public class JTVconvert
Class JTVconvert to convert a Java Tree View (JTV) set of input sub directories of JTV files to a remapped Array Name labels of the .cdt files to a corresponding set of output JTV sub directories with renamed (.atr,.cdt,.gtr) files. This code was developed for use of mAdb JTV clustered heatmap data with the Group STAT Project (GSP) database.
[REFACTOR] to separate JTVconverter program from HTMLtools.
List of Methods
=================== JTVconvert() - Constructor convertAllJTVfiles() - convert a list of sub directories of JTV getUnzippedJTVzipFileData() - get array of name & data for zip file. getJTVsubDirData() - get array of name & data for the JTV directory. cvtJTVfileSet() - convert a sub directory JTV file set createTableFromStr() - create Table by parsing tab-delim. string createTableFromFile() - create Table from file tab-delim. string. createTableAtKeywordLine() - create Table starting at hdr keyword. makeMapTable() - create map Table from ftL2S and ftMAS. applyMapTableToCDT() - map 'mAdb ID's to CDT array names. reorderNAMEsubfieldsInCDT() - reorder 'NAME' subfields in CDT all data rows copyJTVjarFilesToJTVOutputDir() - copy JTV jar files to JTVOutputDir. reZipConvertedFiles() - ReZip converted files to output JTV directory.
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/13 11:45:56 $ $Revision: 1.28 $
Copyright 2008, 2009 by Peter Lemkin
E-Mail: lemkin@users.sourceforge.net
http://lemkingroup.com/
Field Summary | |
---|---|
HTMLtools |
cvt
|
FileTable |
fio
Global fileTable instance |
Constructor Summary | |
---|---|
JTVconvert(HTMLtools cvt)
JTVconvert() - Constructor |
Method Summary | |
---|---|
private boolean |
applyMapTableToCDT(FileTable ftM,
FileTable ftCDT,
int idx_useToName_M,
int idx_mAdbID_M)
applyMapTableToCDT() - map 'mAdb ID's to CDT array names. |
boolean |
convertAllJTVfiles()
convertAllJTVfiles() - convert a list of sub directories of JTV file sets by reading the three files from the each of the sub directories in the jtvInputDir directory. |
private boolean |
copyJTVjarFilesToJTVOutputDir()
copyJTVjarFilesToJTVOutputDir() - copy JTV jar files to JTVOutputDir. |
private FileTable |
createTableAtKeywordLine(java.lang.String filePath,
java.lang.String tblName,
java.lang.String keyword)
createTableAtKeywordLine() - create Table starting at hdr keyword. |
private FileTable |
createTableFromFile(java.lang.String filePath,
java.lang.String tblName)
createTableFromFile() - create Table from file tab-delim. |
private FileTable |
createTableFromStr(java.lang.String tblStr,
java.lang.String tblName)
createTableFromStr() - create Table by parsing tab-delim. |
private boolean |
cvtJTVfileSet(java.lang.String jtvInputFilePath,
java.lang.String jtvFileBaseName,
java.lang.String jtvInputDir,
java.lang.String jtvOutputDir,
int fromL2SmapColIdx,
int toL2SmapColIdx,
java.lang.String jtv_mAdbArraySummaryFile,
java.lang.String jtv_mapHdrNamesFile)
cvtJTVfileSet() - convert a sub directory JTV file set by reading the three files from the (jtvInputDir+inputSubDir) sub directory with (.atr,.cdt,.gtr) file extensions. |
private java.lang.String[][] |
getJTVsubDirData(java.lang.String inputSubDir)
getJTVsubDirData() - get array of name & data for the JTV directory. |
private java.lang.String[][] |
getUnzippedJTVzipFileData(java.lang.String jtvZipFileNamePath)
getUnzippedJTVzipFileData() - get array of name & data for zip file. |
private FileTable |
makeMapTable(FileTable ftL2S,
FileTable ftMAS,
int fromL2SmapColIdx,
int toL2SmapColIdx,
java.lang.String tblName)
makeMapTable() - create map Table from ftL2S and ftMAS. |
private boolean |
reorderNAMEsubfieldsInCDT(FileTable ftCDT)
reorderNAMEsubfieldsInCDT() - reorder 'NAME' subfields in CDT all data rows to improve usability in JTV browser. |
private boolean |
reZipConvertedFiles(java.lang.String baseDirToZip)
reZipConvertedFiles() - ReZip the converted files in the output JTV directory baseDataDir in a file with the same name. |
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
Constructor Detail |
---|
public JTVconvert(HTMLtools cvt)
Method Detail |
---|
public boolean convertAllJTVfiles()
The full switch is four arguments: '-jtvNamesMap:{mAdbArraySummaryFile,mapHdrFile,fromHdrName,toHdrName}'. The optional switches are: '-jtvInputDir:{jtvInputDir}' and '-jtvOutputDir:{jtvOutputSubDir}' to set the directories to other than the defaults ("JTVinput" and "JTVoutput"). The JTV Global variable definitions are: jtvInputDir - where JTV input sub directories are found jtvOutputDir - where JTV output sub directories are written jtvUseMapColName - column name used when remap the 'mAdb ID' data jtv_mAdbArraySummaryFile - mAdb Array Summary file Table of "mAdb ID"s jtv_mapHdrNamesFile - long to short Affy name mapping Table.
private java.lang.String[][] getUnzippedJTVzipFileData(java.lang.String jtvZipFileNamePath)
Unzip the JTV data into dataList[0:nEntries-1][0:1]. where: dataList[*][0] = file names dataList[*][1] = unzipped data for each file
zipFileName
- is a JTV zip file to read
private java.lang.String[][] getJTVsubDirData(java.lang.String inputSubDir)
Return the JTV data in dataList[0:nEntries-1][0:1]. where: dataList[*][0] = file names dataList[*][1] = data for each file
inputSubDir
- is a JTV subdiredtory to read
private boolean cvtJTVfileSet(java.lang.String jtvInputFilePath, java.lang.String jtvFileBaseName, java.lang.String jtvInputDir, java.lang.String jtvOutputDir, int fromL2SmapColIdx, int toL2SmapColIdx, java.lang.String jtv_mAdbArraySummaryFile, java.lang.String jtv_mapHdrNamesFile)
[REFACTOR] to separate JTVconverter program from HTMLtools.
jtvInputFilePath
- - is the input sub directory to process (not
the full path - need to preface with jtvInputDir
to get the full path). If the inputSubDir is
a file ending in .zip, then read the dataList
by unzipping that file. *jtvFileBaseName
- is the single JTV directory or zip file base namejtvInputDir
- - directory to find the set of input JTV
sub directories, each with (.atr,.cdt,.gtr)
extension files.jtvOutputDir
- - directory to write the converted JTV output
sub directory.fromL2SmapColIdx
- - column index used when remap the
'mAdb ID' data FROM a mapping data name with this
column in the jtv_mapHdrNamesFile map.toL2SmapColIdx
- - column index used when remap the
'mAdb ID' data TO a new data name with this column in
the jtv_mapHdrNamesFile map.jtv_mAdbArraySummaryFile
- - name of the mAdb Array Summary file
that contains a (MAS) Table with "mAdb ID" and
the corresponding "Array Name".jtv_mapHdrNamesFile
- - is the name of the Long to
Short array name mapping file that contains a
(L2S)Table with the array names as well as the
alternate array names that are used in the mapping.
private FileTable createTableFromStr(java.lang.String tblStr, java.lang.String tblName)
tblStr
- - a tab-delimited stringtblName
- - of the table
private FileTable createTableFromFile(java.lang.String filePath, java.lang.String tblName)
filePath
- - full path of the table file to readtblName
- - of the table
private FileTable createTableAtKeywordLine(java.lang.String filePath, java.lang.String tblName, java.lang.String keyword)
filePath
- - full path of the table file to readtblName
- - of the tablekeyword
- - contained in the table header row.
private FileTable makeMapTable(FileTable ftL2S, FileTable ftMAS, int fromL2SmapColIdx, int toL2SmapColIdx, java.lang.String tblName)
ftL2S
- - LongToShortMap TableftMAS
- - mAdb Array Summary TablefromL2SmapColIdx
- - column index used when remap the
'mAdb ID' data FROM a mapping data name with this
column in the jtv_mapHdrNamesFile map.toL2SmapColIdx
- - column index used when remap the
'mAdb ID' data TO a new data name with this column in
the jtv_mapHdrNamesFile map.tblName
- - of the table
private boolean applyMapTableToCDT(FileTable ftM, FileTable ftCDT, int idx_useToName_M, int idx_mAdbID_M)
ftM
- - name Mapping TableftCDT
- - CDT Table to map the sample names in the ftCDT.tFieldsidx_useToName_M
- - ftM index of the TO data nameidx_mAdbID_M
- - ftM index of the FROM data name
private boolean reorderNAMEsubfieldsInCDT(FileTable ftCDT)
Reorder: "WID:... || xxxxxx_at || MAP:... || gene -- geneDescr. || RID:..." to "gene -- geneDescr. || xxxxxx_at || WID:... || MAP:... || RID:..."
ftCDT
- - CDT table containing rows of data to reorder NAME field.
private boolean copyJTVjarFilesToJTVOutputDir()
private boolean reZipConvertedFiles(java.lang.String baseDirToZip)
[DEBUG] problem with directory level in FileTable.writeZipFile(). It contains the parent directory in the Zip file.
baseDirToZip
- is the base directory to zip in current directory
but save it in the cvt.jtvInputDir directory.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |