CmpSpots
Class CmpSpots

java.lang.Object
  extended by CmpSpots.Cmpglb
      extended by CmpSpots.CmpSpots

public class CmpSpots
extends Cmpglb

Class CmpSpots.java is a 2D PAGE SAMPLE spot pairing program for Open2Dprot

This code was derived and refactored from GELLAB-II cmpgl2 C language files "Version November 9, 1999", and the Open2Dprot CmpSpots program Java files.

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/.

Version:
$Date: 2005/12/22 11:41:31 $ $Revision: 1.38 $
Author:
P. Lemkin, NCI-Frederick, Frederick, MD, 21702

Field Summary
 
Fields inherited from class CmpSpots.Cmpglb
acc, accDatabaseFile, accFile, accFormatMode, AP, applicationName, argsV, asgn, banner, bannerTitle, baseImageFileNameRsample, baseImageFileNameSample, batchDir, cacheDir, cmpspotsURL, commutativeLMSswitch, CONSOLE_FLAG, CP, cs, data, DATE, dbLM, dbRsample, dbSample, DBUG_ALL_SSF_SPOTS, DBUG_APPEND, DBUG_ASSIGN_CODES, DBUG_ASSIGN_SSF_TO_LMS, DBUG_COMPUTE_RADII, DBUG_CONSOLE, DBUG_DUMP_LM_SET_SPOTS, DBUG_DUMP_PREFACE_EPILOGUE, DBUG_DUMP_SPF, DBUG_FIND_LMS_IN_SSFS, DBUG_FREE_0200000, DBUG_FREE_04000, DBUG_INITIAL_SPOT_PAIRING, DBUG_PRINT_AT, DBUG_PRINT_FULL_NODE_INFO, DBUG_PRINT_LMS_SET_SPOTS, DBUG_PRINT_LMS_SPOT_MAPPING, DBUG_READ_LANDMARKS, DBUG_READ_SSF_DATA, DBUG_SECONDARY_PAIRING, DBUG_SPECIFIC_SPOTS, DBUG_SWITCH_ANALYSIS, DBUG_SWITCHES, dBugBits, dbugBitsHelpStr, dBugLMsetList, debugSwitch, defaultSwitch, demoFileList, demoSwitch, docFileList, dtdSwitch, EP, fileSeparator, fio, fourSqrtPi, GS, ini, inPixFileRsample, inPixFileSample, inputFormatSwitch, isCsamplePrimeSwitch, jarFileList, jarLibrFileList, landmarkDatabaseFile, latchLandmarkSpotSwitch, legalImageFileExtens, LM, LMSETCOLOR, lmsFile, lmsFormatMode, MAX_LM_LATCH_THR, maxLatchDist, nbrAltLMSSwitch, nDbugLMsetList, NEVER, nlmDB, nSwitches, OPTBKGROUND, osName, pair, pair2ndary, paramH, pix, pix1, pix2, pixFileExtn, PP, ppxDir, pra, projDir, projDirSwitch, propertiesFile, propertiesFileSwitch, ps, PUBLISH, rdbmsDir, REVISION, rRoiDbug, rRoiDbugSwitch, RSAMPLE, rsampleName, rsampleSwitch, SAMPLE, sampleName, sampleSwitch, secondaryPairingSwitch, simplePixFileRsample, simplePixFileSample, sort, SP, spfFormatMode, spfFormatSwitch, spfOutputFile, spfOutputPrefaceFile, SPOTBOXCOLOR, sRoiDbug, sRoiDbugSwitch, ssfFileRsample, ssfFileSample, ssfFormatMode, ssfInputEpilogueFileRsample, ssfInputEpilogueFileSample, ssfInputFileRsample, ssfInputFileSample, ssfInputPrefaceFileRsample, ssfInputPrefaceFileSample, startTime, sw, switchOptCBvalue, switchOptData, switchOptValue, thrPPswitch, thrSPswitch, timerSwitch, tmpDir, updateSwitch, US, usageSwitch, USE_DEMO_DATA, useAccFileSwitch, useHistGUISwitch, useLmsFileSwitch, usePercentDensitySwitch, usePopupGUISwitch, userDir, util, VERSION, xmlDir
 
Constructor Summary
CmpSpots()
           
 
Method Summary
private  boolean lookupSampleEntryInAccDB(java.lang.String accNameData, java.lang.String accFieldName, java.lang.String accFile, DbSample dbSsf)
          lookupSampleEntryInAccDB() - lookup the sample image name in the accession DB.
static void main(java.lang.String[] args)
          main() - for CmpSpots 2D spot-pairing program for Open2Dprot.
private  int pairSpotsBetweenSamples(java.lang.String[] args)
          pairSpotsBetweenSamples() - pair the two samples spot lists.
 void popupImageViewer()
          popupImageViewer() - popup the image viewer after the images were computed by the spot pairing.
private  char[] readSsfImage(java.lang.String imageFile, DbSample dbSsf)
          readSsfImage() - read the SSF image and set image status in the dbSsf instance
private static void resetResources(boolean fullResetFlag)
          resetResources() - reset any resources that must be reset for the next run of the spot pairing.
private  java.lang.String[] setupDebugSwitches(java.lang.String[] argv)
          setupDebugSwitches() - setup the debug switches
private static java.lang.String[] setupDemoSwitches(java.lang.String[] argv)
          setupDemoSwitches() - setup the demo switches for the "gel-HM-019" (HUMAN-AML) and "gel-HM-071" (Human-ALL) samples
private static java.lang.String[] setupMinDefaultsSwitches(java.lang.String[] argv)
          setupMinDefaultsSwitches() - add the minimum default switches.
 
Methods inherited from class CmpSpots.Cmpglb
get2D, get2D, initGlb, resetGlb, set2D
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CmpSpots

public CmpSpots()
Method Detail

main

public static void main(java.lang.String[] args)
main() - for CmpSpots 2D spot-pairing program for Open2Dprot.

Parameters:
args - is the argument list of command line
See Also:
CmpIni.switchAnalysis(java.lang.String[]), CmpReportPopup.setOutFileToCloseOnKill(java.io.FileWriter), CmpReportPopup.setSaveAsFile(java.lang.String), CmpReportPopup.waitForUserClose(), CmpShowImage.showImageGUI(java.lang.String), FileIO#makeProjectDirs, Switches#cvtSwitchListToStr, Switches#getSwitchOptionsTableStr, Switches#mergeSwitches, Util#appendPRmsg, Util#getPrettyPrintCurrentDateStr, Util#showReportStatus, pairSpotsBetweenSamples(java.lang.String[]), resetResources(boolean), setupDebugSwitches(java.lang.String[]), setupMinDefaultsSwitches(java.lang.String[]), setupDemoSwitches(java.lang.String[])

pairSpotsBetweenSamples

private int pairSpotsBetweenSamples(java.lang.String[] args)
pairSpotsBetweenSamples() - pair the two samples spot lists.

Returns:
exit code. It is 0 if succeed, else non-zero for errors this gets passed to System.exit(exit code).
See Also:
CmpAssign.assignSSFtoLMS(), CmpIni.additionalInit(), CmpIni.initSwitchOptionsData(), CmpIni.postProcessSwitches(), CmpIni.switchAnalysis(java.lang.String[]), CmpPair.findLMSinSsfs(), CmpPair.initialSpotPairing(), CmpPairSecondary.secondarySpotPairing(), DbAccession#loadAccessionDatabase, DbAccession#lookupSampleInAccDB, DbLM#computeLMSradii, DbLM#cvLMSIdx2Name, DbLM#lookupSamplePairLMS, DbLM#readLandmarkDatabase, DbPairSamples#setPairSamples, DbPairSamples#setPairingThresholds, DbPairSamples#writeEntireSPF, DbSample#assignRsampleToAllSpotsInSpotList, DbSample#readSSFdata, DbSample#setSampleNames, FileIO#discoverFileExtension, FileIO#makeProjectDirs, PopupFileDialog#popupFileDialog, Util#appendPRmsg, Util#calcStatusTimesReport, Util#fatalExit, Util#showReportStatus, lookupSampleEntryInAccDB(java.lang.String, java.lang.String, java.lang.String, DbSample)

lookupSampleEntryInAccDB

private boolean lookupSampleEntryInAccDB(java.lang.String accNameData,
                                         java.lang.String accFieldName,
                                         java.lang.String accFile,
                                         DbSample dbSsf)
lookupSampleEntryInAccDB() - lookup the sample image name in the accession DB.

Parameters:
accNameData - is the sample image name to search for. Do not specify the file extension.
accFieldName - is the accession field name
accFile - is the name of the accession file
dbSsf - is the SSF instance to use
Returns:
true if succeed

readSsfImage

private char[] readSsfImage(java.lang.String imageFile,
                            DbSample dbSsf)
readSsfImage() - read the SSF image and set image status in the dbSsf instance

Parameters:
imageFile - to read
dbSsf - to update
Returns:
image array
See Also:
PixReader#clearImageReader, PixReader#getCharPix, PixReader#readImageFile

resetResources

private static void resetResources(boolean fullResetFlag)
resetResources() - reset any resources that must be reset for the next run of the spot pairing.

Parameters:
fullResetFlag - force new resource allocation
See Also:
DbLM#init, DbSample#init, CmpData.reset(), Cmpglb.resetGlb()

setupMinDefaultsSwitches

private static java.lang.String[] setupMinDefaultsSwitches(java.lang.String[] argv)
setupMinDefaultsSwitches() - add the minimum default switches.

Parameters:
argv - is list of original switches
Returns:
new argV merged switch list
See Also:
Switches#mergeSwitches, Util#cvs2Array

setupDemoSwitches

private static java.lang.String[] setupDemoSwitches(java.lang.String[] argv)
setupDemoSwitches() - setup the demo switches for the "gel-HM-019" (HUMAN-AML) and "gel-HM-071" (Human-ALL) samples

Parameters:
argv - is list of original switches
Returns:
new argV merged switch list
See Also:
Switches#mergeSwitches, Util#cvs2Array

setupDebugSwitches

private java.lang.String[] setupDebugSwitches(java.lang.String[] argv)
setupDebugSwitches() - setup the debug switches

Parameters:
argv - list of original switches
Returns:
new argV merged switch list
See Also:
Switches#mergeSwitches, Util#cvs2Array

popupImageViewer

public void popupImageViewer()
popupImageViewer() - popup the image viewer after the images were computed by the spot pairing.

See Also:
CmpShowImage.setPixDatabase(java.lang.String[], java.lang.String[], java.lang.String[], char[][], int, java.lang.String, int[], int[], boolean), CmpShowImage.showImageGUI(java.lang.String)