|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object O2Plib.db.DbPairSamples
public class DbPairSamples
Class DbPairSamples is the Sample Paired-spots File (SPF) state for spot pairing modules in Open2Dprot.
The data in the SPF instance, e.g., xxxx, could be a file xxxx-SPF.txt (tab-delimited) or xxxx-SPF.xml. It could later reside in the RDBMS. This class has readers and writers for both the tab-delimited and XML versions.
When creating the SPF data initially or in writing it out, the actual spot features are stored in DbSpot instances in the DbSample spotList entries for each sample in its corresponding DbSample objects. The DbSpot instances contain links to paired spots as well as the dP, dL, pairingCode and other pairing metrics. This pairing database instance contains global pairing data and statistics. It contains links to landmark set spot lists but does not contain individual paired links to paired spots between samples (these are in the spots themselves).
NOTE: When the SPF file is read back, it is stored in DbPspot objects that encode both the Rsample and the Sample values. This makes it possible to have more than one Rsample in a set of SPF data files.
This file is derived from Open2Dprot earilier CmpSpots's DbSPF.java and old GELLAB-II cmpgl2.c code.
This work was produced by Peter Lemkin of the National Cancer Institute, an agency of the United States Government. As a work of the United States Government there is no associated copyright. It is offered as open source software under the Mozilla Public License (version 1.1) subject to the limitations noted in the accompanying LEGAL file. This notice must be included with the code. The Open2Dprot Mozilla and Legal files are available on http://open2dprot.sourceforge.net/.
Nested Class Summary | |
---|---|
(package private) class |
DbPairSamples.SpfContentHandler
This class implements the SAX ContentHandler interface and defines callback behavior for the SAX callbacks associated with an XML document's content, stuffing data structures with correct data from xml files. |
(package private) class |
DbPairSamples.SpfErrorHandler
SpfErrorHandlerclass implements the SAX ErrorHandler interface and defines callback behavior for the SAX callbacks associated with an XML document's warnings and errors. |
Field Summary | |
---|---|
static int |
AP
Ambiguous Pair - pairing program generated label |
static int |
CP
Composite Sample Database spot pair. |
java.lang.String |
dateSPF
date read from SPF file |
DbLM |
dbLM
Landmark database object |
DbSample |
dbRsample
Rsample object |
DbSample |
dbSample
Sample object |
boolean |
dbugEpilogueFlag
epilogue debug flag |
boolean |
dbugFlag
generic debug flag |
int |
dBugLMnbr
-DEBUG:bits,LMset# (not letter) |
boolean |
dbugPairsFlag
pairs of spots debug flag |
boolean |
dbugPrefaceFlag
preface debug flag |
int |
defNbrAltLMs
default # of alternate paired landmarks (N3). |
float |
dLmax
Maximum dL of any spot in DB |
static boolean |
DO_CLIP_DP_DL
set true if clip max of dP and dL |
static boolean |
DO_CLIP_DX_DY
If true, then clip dX and dY |
float |
dPmax
Maximum dP of any spot in DB |
float |
dPmTot
global spot statistics: sum dP for Rsample only |
float |
dt1Threshold
distance threshold T1 for determining SP pairs. |
float |
dt2Threshold
distance threshold T2 for determining PP pairs. |
static int |
EP
Extrapolated Pair - by CSD database program |
java.lang.String |
globalStats
global statistics generated by pairing analysis |
static int |
GS
Garbage Spot - generated by CSD database or editing programs |
int |
hAP1
Histogram label statistics |
int |
hAP2
Histogram label statistics |
int |
hCP1
Histogram label statistics |
int |
hCP2
Histogram label statistics |
int |
hEP1
Histogram label statistics |
int |
hEP2
Histogram label statistics |
int[] |
histCode
Histogram [0:11] of SPF label frequencies: |
int |
hPP1
Histogram label statistics |
int |
hPP2
Histogram label statistics |
int |
hSP1
Histogram label statistics |
int |
hSP2
Histogram label statistics |
int |
hUS1
Histogram label statistics |
int |
hUS2
Histogram label statistics |
int |
idxRsample
index of Rsample instance in CSD database. |
int |
idxSample
Index of Sample instance in CSD database. |
static int |
LM
LandMark spot [could be virtual landmark] - by CSD database program |
static int |
MAX_DL
max dL value allowed if clip |
static float |
MAX_DP
max dP value allowed if clip |
static int |
MAX_DX_DY
|dX| and |dY| if clip |
float |
meanDP_SP_PP
global spot statistics: mean dP for Rsample only |
float |
meanDPprime_SP_PP
global spot statistics: adjusted mean meanDP_SP_PP for Rsample only |
int |
minNbrLMSspots
Math.min(nbrRsampleSpotsInLMS,nbrSampleSpotsInLMS); |
int |
nbrRsampleSpotsInLMS
total # spots we hold in the LM sets for Rsample |
int |
nbrRsampleSpotsInLMSPairedSPorPP
# spots paired with the Rsample SP or PP label |
int |
nbrSampleSpotsInLMS
total # spots we hold in the LM sets for Sample |
java.lang.String |
pairingStats
Complete pairing statistics multiline string |
static int |
PP
Possible Pair - pairing program generated label |
float |
primary_SP_PP_pairRate
Percentage: (50.0F*(hSP1+hPP1))/minNbrLMSspots Where minNbrLMSspots= min(nbrRsampleSpotsInLMS,nbrSampleSpotsInLMS) |
java.lang.String |
projDir
Project directory set by main program |
java.lang.String |
projDirSPF
Project directory read from SPF file |
int |
rAreaMax
|
int |
rAreaMin
Minimum Rsample area of any spot in DB |
float |
rDprimeMax
Maximum Rsample dPrime (density) of any spot in DB |
float |
rDprimeMin
Minimum Rsample dPrime (density) of any spot in DB |
float |
rMaxDmax
Maximum Rsample maxD of any spot in DB |
float |
rMinDmax
minimum Rsample minD of any spot in DB |
static int |
RSAMPLE
The index for the Rsample (Reference Sample) |
float |
rVolumeMax
Maximum Rsample volume (density) of any spot in DB |
float |
rVolumeMin
Minimum Rsample volume (density) of any spot in DB |
static int |
SAMPLE
The index for the Sample to be paired with the Rsample |
int |
sAreaMax
Maximum Sample area of any spot in DB |
int |
sAreaMin
Minimum Sample area of any spot in DB |
float |
sDprimeMax
Maximum Sample dPrime (density) of any spot in DB |
float |
sDprimeMin
Minimum Sample dPrime (density) of any spot in DB |
float |
secondary_SP_PP_pairRate
Percentage: (50.0F*(hSP2+hPP2))/minNbrLMSspots Where minNbrLMSspots= min(nbrRsampleSpotsInLMS,nbrSampleSpotsInLMS) |
static int |
shortSPFlmNbr
Landmark number used for restricting SPF data read to Pspots belonging to Landmark shortSPFlmNbr. |
float |
sMaxDmax
Maximum Sample maxD of any spot in DB |
float |
sMinDmax
minimum Sample minD of any spot in DB |
static int |
SP
Sure Pair - pairing program generated label |
static java.lang.String |
SPF_VERSION
The Open2Dprot Sample Paired-spot File (SPF) version |
boolean |
spfCWSwitch
Debugging switch. |
int |
spfCWX1
|
int |
spfCWX2
|
int |
spfCWY1
|
int |
spfCWY2
|
java.io.FileWriter |
spfFD
output SPF file stream |
java.lang.String[] |
spfFieldNames
SPF database fields for these samples if not null |
java.lang.String |
spfFile
full path xml/ Sample Paired-Spotlist Files (SPF) full path input file. |
java.lang.String |
spfInputFile
name of SPF input file from file [FUTURE] |
int |
spfInputFormatMode
SPF input file mode: Allowed: FileIO.IO_FORMAT_TAB_DELIM, IO_FORMAT_XML |
static java.lang.String |
spfOutputEpilogueFile
full tab-delim EPILOGUE xml/ (Sample Pairs File) full path |
java.lang.String |
spfOutputFile
SPF either tab-delim xml/ Sample Paired Spot-list File full path |
int |
spfOutputFormatMode
SPF output ample Paired Spot-list File mode: Allowed: FileIO.IO_FORMAT_TAB_DELIM, IO_FORMAT_XML |
static java.lang.String |
spfOutputPrefaceFile
full tab-delim PREFACE xml/ (Sample Pairs File) full path |
java.lang.String[] |
spfRowData
SPF database data for these samples if not null |
float |
sVolumeMax
Maximum Sample volume (density) of any spot in DB |
float |
sVolumeMin
Minimum Sample volume (density) of any spot in DB |
Table |
tspf
|
static int |
US
Unresolved Spot - pairing program generated label |
static boolean |
USE_DOM_XML_SPF
Use DOM/JDOM/... |
boolean |
useCsampleFlag
use Csample extensions to SPF file. |
boolean |
useInternalDTDflag
Use internal "Open2Dprot-SPF.dtd" file in SPF XML output file. |
boolean |
usePercentDensitySwitch
When generating SPF files, use percent of density D' rather than density D'. |
static java.lang.String |
VERSION
Version for this module |
java.lang.String |
versionSPF
version read from SPF file |
Constructor Summary | |
---|---|
DbPairSamples()
DbPairSamples() - setup DbPairSamples database |
|
DbPairSamples(DbSample dbRsample,
DbSample dbSample,
DbLM dbLM)
DbPairSamples() - setup DbPairSamples instance of the database |
Method Summary | |
---|---|
java.lang.String |
calcStatistics()
calcStatistics() - compute the paired spot statistics |
java.lang.String |
getSampleSPFstr()
getSampleSPFstr() - get printable data including SPF name/value row for this sample |
java.lang.String |
getSpotPairStr(DbSpot sp)
getSpotPairStr() - get the paired spot string that identifies the samples, LM sets, LM coords,, dP, dL |
void |
init()
init() - init the DbSPF state. |
void |
initMaxima()
initMaxima() - initialize the feature maxima and minima |
boolean |
pushSpotPair(DbPspot sS)
pushSpotPair() - push DbPspot spots pair of into spotLists and adjust spot pairing data. |
boolean |
pushSpotPair(DbSpot rS,
DbSpot sS)
pushSpotPair() - push DbSpot spots pair into spotLists and adjust spot pairing data. |
java.lang.String |
readSPFdata(java.lang.String projDir,
java.lang.String spfInputFile,
int spfInputFormatMode)
readSPFdata() - Read sample Sample Paired-spotlist Files (SPF) into a linked list data base of DbPair objects. |
boolean |
readSPFpairedSpotsXML(java.lang.String XMLfileName,
DbPairSamples dbPS)
readSPFpairedSpotsXML() - read SPF sample paired spot-list data from XML file. |
boolean |
readSpfTabDelimTable(java.lang.String spfFile)
readSpfTabDelimTable() - read SSF tab-delimited file data. |
void |
reset()
reset() - reset the DbSPF state for current sample. |
boolean |
rmvSPFlistsAndTable()
rmvSPFlistsAndTable() - remove the SSF and SPF spot lists and Tables if they exist. |
void |
setCsamplesFlag(boolean useCsampleFlag)
setCsamplesFlag() - use Csample extensions to SPF file. |
void |
setDbugFlag(boolean dbugFlag)
setDbugFlag() - set the generic dbugFlag |
void |
setEpilogueDbugFlag(boolean aDbugEpilogueFlag)
setEpilogueDbugFlag() - set the epilogue dbugEpilogFlag |
void |
setPairingThresholds(float dt1Threshold,
float dt2Threshold,
int defNbrAltLMs)
setPairingThresholds() - Set the default pairing thresholds: (dt1Threshold, dt2Threshold, defNbrAltLMs) |
void |
setPairSamples(DbSample dbRsample,
DbSample dbSample,
DbLM dbLM)
setPairSamples() - setup DbSPF instance of the database and reset data |
void |
setPairsDbugFlag(boolean dbugPairsFlag,
int dBugLMnbr)
setPairsDbugFlag() - set the preface dbugPairsFlag |
void |
setPercentDensityFlag(boolean usePercentDensitySwitch)
setPercentDensityFlag() - set flag used when generating SPF files, use percent of density D' rather than density D'. |
void |
setPercentDensityFlag(int lmNbr)
setShortSPFbyLMnbr() - set flag used when reading SPF files. |
void |
setPrefaceDbugFlag(boolean dbugPrefaceFlag)
setPrefaceDbugFlag() - set the preface dbugPrefaceFlag |
void |
setSPFdebugCW(boolean spfCWflag,
int dbCWX1,
int dbCWY1,
int dbCWX2,
int dbCWY2)
setSPFdebugCW() - enable/disable debug computing window to restrict data read when test if dbRsample/dbSample p.(xMom,yMom) in SPF CW for debugging. |
void |
setSPFinputNames(java.lang.String projDir,
java.lang.String spfInputFile,
int spfInputFormatMode)
setSPFinputNames() - set the DbPairSamples SPF input file names. |
void |
setSPFoutputNames(java.lang.String spfOutputFile,
int spfOutputFormatMode,
java.lang.String projDir)
setSPFoutputNames() - set the DbPairSamples SPF output file names. |
void |
setUseInternalDTDflag(boolean useInternalDTDflag)
setUseInternalDTDflag() - set the use internal DTD flag. |
boolean |
writeEntireDOM_XML(java.lang.String outputFile)
writeEntireDOM_XML() - write the entire SPF file into an XML file using DOM/JDOM/... |
boolean |
writeEntireSPF(java.lang.String projDir,
java.lang.String spfOutputFile,
int spfOutputFormatMode)
writeEntireSPF() - write the entirepaired-spots SPF file. |
boolean |
writeEntireSPF(java.lang.String bannerTitle,
java.lang.String swStr,
java.lang.String filesUsed,
java.lang.String projDir,
java.lang.String spfOutputFile,
int spfOutputFormatMode)
writeEntireSPF() - write the entirepaired-spots SPF file. |
boolean |
writeSPFfinish(java.lang.String filesUsed)
writeSPFfinish() - finish and close the SPF output stream in spfFD. |
boolean |
writeSPFpairedSpots()
writeSPFpairedSpots() - dump paired spot list data base into SPF output stream in spfFD. |
boolean |
writeSPFpreface(java.lang.String bannerTitle,
java.lang.String swStr)
writeSPFpreface() - Dump the SPF preface to the SPF output stream in spfFD. |
boolean |
writeStatisticsToSPFfile()
writeStatisticsToSPFfile() - Dump the epilogue consisting of the paired spot statistics to the SPF output stream in spfFD. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String VERSION
public static final java.lang.String SPF_VERSION
public static boolean USE_DOM_XML_SPF
public static final int RSAMPLE
public static final int SAMPLE
public static final int US
public static final int SP
public static final int PP
public static final int AP
public static final int EP
public static final int CP
public static final int GS
public static final int LM
public static boolean DO_CLIP_DP_DL
public static float MAX_DP
public static int MAX_DL
public static boolean DO_CLIP_DX_DY
public static int MAX_DX_DY
public DbSample dbRsample
public DbSample dbSample
public int idxSample
public int idxRsample
public java.lang.String spfFile
public java.lang.String spfInputFile
public int spfInputFormatMode
public boolean useInternalDTDflag
public boolean useCsampleFlag
public static int shortSPFlmNbr
public java.lang.String spfOutputFile
public static java.lang.String spfOutputPrefaceFile
public static java.lang.String spfOutputEpilogueFile
public int spfOutputFormatMode
public java.io.FileWriter spfFD
public java.lang.String projDir
public java.lang.String projDirSPF
public java.lang.String dateSPF
public java.lang.String versionSPF
public DbLM dbLM
public java.lang.String globalStats
public int nbrRsampleSpotsInLMS
public int nbrSampleSpotsInLMS
public int minNbrLMSspots
public int nbrRsampleSpotsInLMSPairedSPorPP
public float primary_SP_PP_pairRate
public float secondary_SP_PP_pairRate
public int hUS1
public int hSP1
public int hPP1
public int hAP1
public int hCP1
public int hEP1
public int hUS2
public int hSP2
public int hPP2
public int hAP2
public int hCP2
public int hEP2
public java.lang.String pairingStats
public float meanDP_SP_PP
public float dPmTot
public float meanDPprime_SP_PP
public int[] histCode
where: 0:5 are primary US,SP,PP,AP,EP,CP 6:11 are secondary US,SP,PP,AP,EP,CP.NOTE: the two CC# spots in a legitimate pair such as SP, PP etc are counted TWICE - once for each sample. This should be reset to 0 values at the start of each run.
public int rAreaMax
public int sAreaMax
public int rAreaMin
public int sAreaMin
public float dLmax
public float dPmax
public float rDprimeMax
public float sDprimeMax
public float rDprimeMin
public float sDprimeMin
public float rVolumeMax
public float sVolumeMax
public float rVolumeMin
public float sVolumeMin
public float rMaxDmax
public float sMaxDmax
public float rMinDmax
public float sMinDmax
public boolean usePercentDensitySwitch
public float dt1Threshold
public float dt2Threshold
public int defNbrAltLMs
public boolean dbugFlag
public boolean dbugPrefaceFlag
public boolean dbugPairsFlag
public boolean dbugEpilogueFlag
public int dBugLMnbr
public boolean spfCWSwitch
public int spfCWX1
public int spfCWY1
public int spfCWX2
public int spfCWY2
public Table tspf
public java.lang.String[] spfFieldNames
public java.lang.String[] spfRowData
Constructor Detail |
---|
public DbPairSamples()
public DbPairSamples(DbSample dbRsample, DbSample dbSample, DbLM dbLM)
dbRsample
- is RsampledbSample
- is SampledbLM
- is landmark set being usedMethod Detail |
---|
public void setPairSamples(DbSample dbRsample, DbSample dbSample, DbLM dbLM)
dbRsample
- is RsampledbSample
- is SampledbLM
- is landmark set being usedpublic void setSPFinputNames(java.lang.String projDir, java.lang.String spfInputFile, int spfInputFormatMode)
projDir
- is the project directoryspfInputFile
- is the SPF input file namespfInputFormatMode
- is the FileIO.IO_FORMAT_xxx mode.public void setSPFoutputNames(java.lang.String spfOutputFile, int spfOutputFormatMode, java.lang.String projDir)
spfOutputFile
- is the SPF output file namespfOutputFormatMode
- is the FileIO.IO_FORMAT_xxx mode.projDir
- is the project directorypublic void setPercentDensityFlag(int lmNbr)
lmNbr
- to use in filtering Pspotspublic void setPercentDensityFlag(boolean usePercentDensitySwitch)
usePercentDensitySwitch
- status to setpublic void setPairingThresholds(float dt1Threshold, float dt2Threshold, int defNbrAltLMs)
dt1Threshold
- limit is upper DP limit for SP labelsdt2Threshold
- limit is upper DP limit for PP labelsdefNbrAltLMs
- is # of alternate landmark sets to checkpublic void setDbugFlag(boolean dbugFlag)
dbugFlag
- status to setpublic void setUseInternalDTDflag(boolean useInternalDTDflag)
useInternalDTDflag
- status to setpublic void setPrefaceDbugFlag(boolean dbugPrefaceFlag)
dbugPrefaceFlag
- status to setpublic void setPairsDbugFlag(boolean dbugPairsFlag, int dBugLMnbr)
dbugPairsFlag
- status to setdBugLMnbr
- is the landmark set to debugpublic void setEpilogueDbugFlag(boolean aDbugEpilogueFlag)
dbugEpilogFlag
- status to setpublic void setCsamplesFlag(boolean useCsampleFlag)
useCsampleFlag
- status to setpublic void setSPFdebugCW(boolean spfCWflag, int dbCWX1, int dbCWY1, int dbCWX2, int dbCWY2)
spfCWSflag
- is debugging switch.dbWX1
- is debug window X1dbCWY1
- is debug window Y1dbCWX2
- is debug window X2dbCWY2
- is debug window Y2public void reset()
public void init()
public boolean rmvSPFlistsAndTable()
public boolean pushSpotPair(DbSpot rS, DbSpot sS)
rs
- is Rsample DbSpot spot to pushss
- is Sample DbSpot spot to push
public void initMaxima()
public boolean pushSpotPair(DbPspot sS)
ss
- is Sample DbPspot to push
public java.lang.String calcStatistics()
public java.lang.String getSampleSPFstr()
public java.lang.String getSpotPairStr(DbSpot sp)
DbSpot
- sp
public java.lang.String readSPFdata(java.lang.String projDir, java.lang.String spfInputFile, int spfInputFormatMode)
projDir
- is the project directoryspfInputFile
- to readspfInputFormatMode
- is data file mode FileIO.IO_FORMAT_xxxx.
#readAllSsfSpotlistTables
,
#readSsfSpotlistXML
public boolean readSpfTabDelimTable(java.lang.String spfFile)
xml/sample-SPF.txt the spotlist data which is equivalent to the data xml/sample-SPF.xml[TODO] return false until implemented.
spfFile
- to read
public boolean readSPFpairedSpotsXML(java.lang.String XMLfileName, DbPairSamples dbPS)
xml/sample-SPF.xml[TODO]
XMLfileName
- to read
public boolean writeEntireSPF(java.lang.String projDir, java.lang.String spfOutputFile, int spfOutputFormatMode)
projDir
- is the project directoryspfOutputFile
- is the SPF output file namespfOutputFormatMode
- is the FileIO.IO_FORMAT_xxx mode.
public boolean writeEntireSPF(java.lang.String bannerTitle, java.lang.String swStr, java.lang.String filesUsed, java.lang.String projDir, java.lang.String spfOutputFile, int spfOutputFormatMode)
bannerTitle
- - optional banner title for SPF file IO_FORMAT_FULL
onlyswStr
- - optional switch list string SPF file IO_FORMAT_FULL onlyfilesUsed
- is optional list of files used in generating the SPF.projDir
- is the project directoryspfOutputFile
- is the SPF output file namespfOutputFormatMode
- is the FileIO.IO_FORMAT_xxx mode.
public boolean writeEntireDOM_XML(java.lang.String outputFile)
public boolean writeSPFpreface(java.lang.String bannerTitle, java.lang.String swStr)
bannerTitle
- - optional banner title for SPF file IO_FORMAT_FULL onlyswStr-
- optional switch list string SPF file IO_FORMAT_FULL only
public boolean writeSPFpairedSpots()
public boolean writeStatisticsToSPFfile()
public boolean writeSPFfinish(java.lang.String filesUsed)
filesUsed
- is optional list of files used in generating the SPF.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |