Accession
Class Accession

java.lang.Object
  extended by Accession.Accglb
      extended by Accession.Accession

public class Accession
extends Accglb

The Accession program is used for adding or accessioning sampless for an Open2Dprot database. It lets you add and edit data for accession database including optional calibration database (part of the accession DB), landmark database (for Rsample and Samples). It also lets you define the computing window and ND wedge computing window that are part of the accession database.

2
 [TODO] 
 1. For accession information, this code will either invoke
    a) initial single accession information Q&A window, or 
    b) a merged PEDRo/MIAPE Q&A.
 2. Add O2Plib.image zoom class for ROI
 3. Check SaveAs gif
 4. Check Accession.properties startup
 5. Debug Calibration. The histogram does not work. Also check
    permutations of 
     (no calibration, data, calib. data in Acc DB, has Wedge ROI CW,
      Wedge CW + calibr. data, explict calib w/o wedge, point list
      similar to Flicker). Resolve popup of missing data. 
 6. Add list of measured spot coordinates and size as a new field to
   Accession DB and file.   
 7. Add (File | New Accession File) - prevent overwriting old accession 
   file names.

This code was derived and refactored from GELLAB-II C language files "Version November 9, 1999", and the Open2Dprot Accession 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:42:08 $ $Revision: 1.21 $
Author:
P. Lemkin, NCI-Frederick, Frederick, MD, 21702

Field Summary
 
Fields inherited from class Accession.Accglb
acc, accDatabaseFile, accessionURL, accFile, accFormatMode, ADD_WINDUMP, ALLOW_CALIBRATION, ALLOW_SAVE_DB, applicationName, argsV, banner, bannerTitle, batchDir, bkgrdSpot, cacheDir, changedAccDBnameFlag, CONSOLE_FLAG, cs, data, DATE, dbRsample, dbSample, DBUG_APPEND, DBUG_CONSOLE, DBUG_FREE_0100, DBUG_FREE_01000, DBUG_FREE_010000, DBUG_FREE_0100000, DBUG_FREE_01000000, DBUG_FREE_020, DBUG_FREE_0200, DBUG_FREE_02000, DBUG_FREE_020000, DBUG_FREE_02000000, DBUG_FREE_04, DBUG_FREE_040, DBUG_FREE_0400, DBUG_FREE_04000, DBUG_FREE_040000, DBUG_FREE_0400000, DBUG_MAIN, DBUG_PRINT_AT, DBUG_SWITCH_ANALYSIS, DBUG_SWITCHES, dbugBitName, dBugBits, dbugBitsHelpStr, dbugBitValues, debugSwitch, defaultSwitch, demoFileList, demoSwitch, distLatchThr, docFileList, dtdSwitch, fileSeparator, fio, fourSqrtPi, ini, inPixFileRsample, inPixFileSample, inputFormatSwitch, jarFileList, jarLibrFileList, legalImageFileExtens, makeBkupCopyFlag, MAX_WEDGE_STEPS, needToSaveAccessionDataFlag, NEVER, nSwitches, OPTBKGROUND, osName, pix, pixFileExtn, ppxDir, pra, projDir, projDirSwitch, propertiesFile, propertiesFileSwitch, PUBLISH, rdbmsDir, REVISION, RSAMPLE, rsampleName, rsampleSwitch, SAMPLE, sampleName, sampleSwitch, simplePixFileRsample, simplePixFileSample, sortSpotListFlag, spfFormatMode, spotBoxSize, ssfCWX1, ssfCWX2, ssfCWY1, ssfCWY2, ssfFileRsample, ssfFileSample, ssfFormatMode, ssfInputEpilogueFileRsample, ssfInputEpilogueFileSample, ssfInputFileRsample, ssfInputFileSample, ssfInputPrefaceFileRsample, ssfInputPrefaceFileSample, startTime, sw, switchOptCBvalue, switchOptData, switchOptValue, timerSwitch, tmpDir, updateSwitch, usageSwitch, USE_DEMO_DATA, useAccFileSwitch, useCommonSpotSizeFlag, userDir, useSpotBkbrdCorrectionFlag, util, VERSION, xmlDate, xmlDBname, xmlDir
 
Constructor Summary
Accession()
           
 
Method Summary
 boolean createNewAccDBfile(java.lang.String accDatabaseName, java.lang.String accDBfile)
          createNewAccDBfile() - create a new the accession database file with the header but not the data.
private  boolean lookupSampleEntryInAccDB(java.lang.String accNameData, java.lang.String accFieldName, java.lang.String accFile, DbSample dbS)
          lookupSampleEntryInAccDB() - lookup the sample image name in the accession DB.
static void main(java.lang.String[] args)
          main() - for Accession 2D spot-pairing program for Open2Dprot.
 boolean openAccDBfile(java.lang.String accDatabaseName, boolean tryToSaveCurAccFile)
          openAccDBfile() - open the accession database.
private  int processSamples(java.lang.String[] args)
          processSamples() - process the two samples.
 char[] readSsfImage(java.lang.String imageFile, DbSample dbS)
          readSsfImage() - read the SSF image and set image status in the dbSample instance
private static void resetResources(boolean fullResetFlag)
          resetResources() - reset any resources that must be reset for the next run of the program.
 boolean setRsampleByName(java.lang.String rName)
          setRsampleByName() - set and load the Rsample data into dbRsample
 boolean setSampleByName(java.lang.String sName)
          setSampleByName() - set and load the Sample data into dbSample
static java.lang.String[] setupDebugSwitches(java.lang.String[] argv)
          setupDebugSwitches() - setup the debug switches
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
static java.lang.String[] setupMinDefaultsSwitches(java.lang.String[] argv)
          setupMinDefaultsSwitches() - add the minimum default switches.
 
Methods inherited from class Accession.Accglb
initGlb, resetGlb, showReportStatus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Accession

public Accession()
Method Detail

main

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

Parameters:
args - is the argument list of command line

processSamples

private int processSamples(java.lang.String[] args)
processSamples() - process the two samples.

Returns:
exit code. It is 0 if succeed, else non-zero for errors this gets passed to System.exit(exit code).

lookupSampleEntryInAccDB

private boolean lookupSampleEntryInAccDB(java.lang.String accNameData,
                                         java.lang.String accFieldName,
                                         java.lang.String accFile,
                                         DbSample dbS)
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
dbS - is the SSF instance to use
Returns:
true if succeed

readSsfImage

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

Parameters:
imageFile - to read
dbS - to update
Returns:
image array

setRsampleByName

public boolean setRsampleByName(java.lang.String rName)
setRsampleByName() - set and load the Rsample data into dbRsample

Parameters:
rName - - Rsample name to load
Returns:
true if succeed

setSampleByName

public boolean setSampleByName(java.lang.String sName)
setSampleByName() - set and load the Sample data into dbSample

Parameters:
sampleName - - to load
Returns:
true if succeed

resetResources

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

Parameters:
fullResetFlag - force new resource allocation

openAccDBfile

public boolean openAccDBfile(java.lang.String accDatabaseName,
                             boolean tryToSaveCurAccFile)
openAccDBfile() - open the accession database. First check to see if the current accession DB needs to be close

Parameters:
accDatabaseName - name of new accession database file
tryToSaveCurAccFile - if needed (i.e., if the needToSaveAccessionDataFlag flag is set).
Returns:
true if succeed

createNewAccDBfile

public boolean createNewAccDBfile(java.lang.String accDatabaseName,
                                  java.lang.String accDBfile)
createNewAccDBfile() - create a new the accession database file with the header but not the data. This does NOT open the file - just creates it. NOTE: can not create a new accession database file with the same name as an existing database file to protect old databases.

Parameters:
accDatabaseName - name of new accession database file
accDBfile - is full path of new accession database file
Returns:
true if succeed

setupMinDefaultsSwitches

public static java.lang.String[] setupMinDefaultsSwitches(java.lang.String[] argv)
setupMinDefaultsSwitches() - add the minimum default switches. There are no default Rsample or Sample arguments.

Parameters:
argv - is list of original switches.
Returns:
new argV merged switch list

setupDemoSwitches

public 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

setupDebugSwitches

public static 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