Class SamplesTable

java.lang.Object
  |
  +--SimpleTable
        |
        +--Table
              |
              +--SamplesTable

class SamplesTable
extends Table

The SamplesTable class is database for the Samples DB Table. It reads the tab-delimited SamplesDB.txt file from the Config/. It also contains methods to help handle queries on samples in the database. The Samples DB contains descriptive data for all samples - whether they are loaded or not. This lets us then lookup file names for samples that were not initially loaded and then load them. This data also includes (Login, Project) security information as well as Sample_ID and Database_File, and other optional fields.

It reads a subset of the actual table data from FILE/URL. This Samples DB file may consist of the following fields:

   Sample_ID Source Strain Stage Probe Login Project Contributor
   Contrib_Institute Submission_Date Exposure Membrane_Nbr 
   Database_File GeneCard_URL Histology_URL Model_URL Comments 
   Menu_Stage_Name Membrane_Layout 
 

NOTE: substitute - ("Membrane" is depricated for "Sample" - for now parse it both ways 4-18-00.) Sample_ID for Membrane_ID Sample_Nbr for Membrane_Nbr Sample_Layout for Membrane_Layout

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 MAExplorer Mozilla and Legal files are available on http://maexplorer.sourceforge.net/.

Version:
$Date: 2003/02/18 18:02:35 $ $Revision: $
Author:
P. Lemkin (NCI), G. Thornwall (SAIC), NCI-Frederick, Frederick, MD
See Also:
MAExplorer Home, Table

Field Summary
(package private)  boolean hasValidDataFlag
          set if data was read ok
(package private)  int idxBGAvg
           
(package private)  int idxBGLow
           
(package private)  int idxBGRms
           
(package private)  int idxComments
          The following fields were from the original Membranes.txt file.
(package private)  int idxContrib_Institute
          The following fields were from the original Membranes.txt file.
(package private)  int idxContributor
          The following fields were from the original Membranes.txt file.
(package private)  int idxDatabase_File
          The following fields were from the original Membranes.txt file.
(package private)  int idxDatabaseFileID
          The following fields were from the original Membranes.txt file.
(package private)  int idxExposure
          The following fields were from the original Membranes.txt file.
(package private)  int idxFilterType
           
(package private)  int idxFilterType_Descr
           
(package private)  int idxGeneCard_URL
          The following fields were from the original Membranes.txt file.
(package private)  int idxHistology_URL
          The following fields were from the original Membranes.txt file.
(package private)  int idxLogin
          The following fields were from the original Membranes.txt file.
(package private)  int idxMenu_Stage_Name
          The following fields were from the original Membranes.txt file.
(package private)  int idxModel_URL
          The following fields were from the original Membranes.txt file.
(package private)  int idxProbe
          The following fields were from the original Membranes.txt file.
(package private)  int idxProject
          The following fields were from the original Membranes.txt file.
(package private)  int idxSample_ID
          The following fields were from the original Membranes.txt file.
(package private)  int idxSample_Nbr
          The following fields were from the original Membranes.txt file.
(package private)  int idxSource
          The following fields were from the original Membranes.txt file.
(package private)  int idxStage
          The following fields were from the original Membranes.txt file.
(package private)  int idxStrain
          The following fields were from the original Membranes.txt file.
(package private)  int idxSubmission_Date
          The following fields were from the original Membranes.txt file.
private  MAExplorer mae
          link to global instance of MAExplorer
private  java.lang.String maeTbl
          remap table name
 
Fields inherited from class Table
bufSize, fileOKflag, fio
 
Fields inherited from class SimpleTable
fileName, msg, tCols, tData, tFields, title, tRows
 
Constructor Summary
(package private) SamplesTable(MAExplorer mae, java.lang.String fileName)
          SamplesTable() - constructor to read Samples DB and set up table.
 
Method Summary
(package private)  boolean chkIfHPvisible(java.lang.String hpNameToChk)
          chkIfHPvisible() - check if allowed to view HP sample.
(package private)  java.lang.String getTableFieldDataByHPname(java.lang.String fieldName, java.lang.String hpName)
          getTableFieldDataByHPname() - get data of fieldName of particular HP sample
(package private)  java.lang.String[] getUniqueTableFieldData(int fieldIdx)
          getUniqueTableFieldData() - get list from SamplesDB.txt database Sort the array in ASCENDING order.
(package private)  boolean isHPnameIsAccessible(java.lang.String hpName)
          isHPnameIsAccessible() - test if HP database name is accessible.
(package private)  SimpleTable makeHPrestrictedTable(Table srcTbl)
          makeHPrestrictedTable() - make a Table of HPs restricted by login required.
(package private)  void readListOfSampleNames()
          readListOfSampleNames() - get list of Sample (i.e.
(package private)  void setupFieldIndexes()
          setupFieldIndexes() - set up indexes for common fields for speedups
 
Methods inherited from class Table
copyTable, createFileTable, getArrayOfTabDelimitedTokens, getData, getTableRowsSubset, getTableRowsSubset, insertTblInULHCtable, lookupFieldIdxAndRemapFieldName, makeTabDelimReport, readTable, storeDataBufParser
 
Methods inherited from class SimpleTable
freeTable, getTableRowFieldByRowIdx, getTableRowFieldIdxByRowIdx, lookupFieldIdx, setFieldData, setRowData, trimWhitespace
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

maeTbl

private final java.lang.String maeTbl
remap table name

mae

private MAExplorer mae
link to global instance of MAExplorer

idxSample_ID

int idxSample_ID
The following fields were from the original Membranes.txt file. These lookup field indices are used to access the Samples DB.

idxStrain

int idxStrain
The following fields were from the original Membranes.txt file. These lookup field indices are used to access the Samples DB.

idxSource

int idxSource
The following fields were from the original Membranes.txt file. These lookup field indices are used to access the Samples DB.

idxProbe

int idxProbe
The following fields were from the original Membranes.txt file. These lookup field indices are used to access the Samples DB.

idxStage

int idxStage
The following fields were from the original Membranes.txt file. These lookup field indices are used to access the Samples DB.

idxLogin

int idxLogin
The following fields were from the original Membranes.txt file. These lookup field indices are used to access the Samples DB.

idxProject

int idxProject
The following fields were from the original Membranes.txt file. These lookup field indices are used to access the Samples DB.

idxContributor

int idxContributor
The following fields were from the original Membranes.txt file. These lookup field indices are used to access the Samples DB.

idxContrib_Institute

int idxContrib_Institute
The following fields were from the original Membranes.txt file. These lookup field indices are used to access the Samples DB.

idxSubmission_Date

int idxSubmission_Date
The following fields were from the original Membranes.txt file. These lookup field indices are used to access the Samples DB.

idxExposure

int idxExposure
The following fields were from the original Membranes.txt file. These lookup field indices are used to access the Samples DB.

idxSample_Nbr

int idxSample_Nbr
The following fields were from the original Membranes.txt file. These lookup field indices are used to access the Samples DB.

idxDatabase_File

int idxDatabase_File
The following fields were from the original Membranes.txt file. These lookup field indices are used to access the Samples DB.

idxDatabaseFileID

int idxDatabaseFileID
The following fields were from the original Membranes.txt file. These lookup field indices are used to access the Samples DB.

idxGeneCard_URL

int idxGeneCard_URL
The following fields were from the original Membranes.txt file. These lookup field indices are used to access the Samples DB.

idxHistology_URL

int idxHistology_URL
The following fields were from the original Membranes.txt file. These lookup field indices are used to access the Samples DB.

idxModel_URL

int idxModel_URL
The following fields were from the original Membranes.txt file. These lookup field indices are used to access the Samples DB.

idxComments

int idxComments
The following fields were from the original Membranes.txt file. These lookup field indices are used to access the Samples DB.

idxMenu_Stage_Name

int idxMenu_Stage_Name
The following fields were from the original Membranes.txt file. These lookup field indices are used to access the Samples DB.

idxFilterType

int idxFilterType

idxFilterType_Descr

int idxFilterType_Descr

idxBGLow

int idxBGLow

idxBGAvg

int idxBGAvg

idxBGRms

int idxBGRms

hasValidDataFlag

boolean hasValidDataFlag
set if data was read ok
Constructor Detail

SamplesTable

SamplesTable(MAExplorer mae,
             java.lang.String fileName)
SamplesTable() - constructor to read Samples DB and set up table.
Parameters:
mae - is instance of MAExplorer
fileName - is file name of the Samples DB
See Also:
MAExplorer.logDRYROTerr(java.lang.String), setupFieldIndexes()
Method Detail

setupFieldIndexes

void setupFieldIndexes()
setupFieldIndexes() - set up indexes for common fields for speedups
See Also:
Table.lookupFieldIdxAndRemapFieldName(java.lang.String, java.lang.String)

getTableFieldDataByHPname

java.lang.String getTableFieldDataByHPname(java.lang.String fieldName,
                                           java.lang.String hpName)
getTableFieldDataByHPname() - get data of fieldName of particular HP sample
Parameters:
fieldName - is the name of the field
hpName - is the name of the sample
Returns:
data, else null if failed.
See Also:
Table.lookupFieldIdxAndRemapFieldName(java.lang.String, java.lang.String)

getUniqueTableFieldData

java.lang.String[] getUniqueTableFieldData(int fieldIdx)
getUniqueTableFieldData() - get list from SamplesDB.txt database Sort the array in ASCENDING order. It is indexed from [0 : rtnStr.length()-1].
Parameters:
fieldIdx - is the index of the field (column) to retrieve
Returns:
data array, else null if a problem or there is no data.
See Also:
SortMAE.sortArray(java.lang.String[], boolean)

readListOfSampleNames

void readListOfSampleNames()
readListOfSampleNames() - get list of Sample (i.e. HP) names from Config database. These names are setup with the .mae startup file for the stand-alone application or PARAMs for an Applet.
 Samples are defined by the keyword "image" following by the relative
 sample number (e.g. "image4").
 1. First, get all images specified in the PARAM and these are
    candidates for loading the samples. They are named
    "image1", "image2", ..., "imageMAX_HYBRID_SAMPLES".
 This pushes names into:
       mae.iSampleName[++mae.iHPnbr]= baseFile;
       mae.iImageFile[mae.iHPnbr].
    Don't add a name if it is already in the list.

 2. Then, add names to the list (primarily for loading later
    from the menus). These names will come from the Image_File field
    in the Samples.txt database.
    These names will be pushed into
        snHPName[++mae.snHPNbr] and snImageFile[].
    Don't add a name if it is already in the list.
See Also:
GetParams.setDefParam(java.lang.String, boolean), MAExplorer.logDRYROTerr(java.lang.String), Util.showMsg(java.lang.String)

makeHPrestrictedTable

SimpleTable makeHPrestrictedTable(Table srcTbl)
makeHPrestrictedTable() - make a Table of HPs restricted by login required. This test is only performed if running as an Applet. Only include HP rows that are visible in the database i.e. loaded. If the table does not contain the keyword "Database_File", Then simply return the entire table. Otherwise, it creates a new subset table and copies rows of valid data (i.e. pointers).
Parameters:
srcTbl - super table to restrict by login access
Returns:
subtable else null if there is a problem.
See Also:
SimpleTable, SimpleTable.lookupFieldIdx(java.lang.String), chkIfHPvisible(java.lang.String)

chkIfHPvisible

boolean chkIfHPvisible(java.lang.String hpNameToChk)
chkIfHPvisible() - check if allowed to view HP sample. NOTE: called after all logins so can check verified projects.
Parameters:
hpNameToChk - is the sample to check
Returns:
true if ok.

isHPnameIsAccessible

boolean isHPnameIsAccessible(java.lang.String hpName)
isHPnameIsAccessible() - test if HP database name is accessible. If we are not in workingMAE mode, everything is accessible else look for exact match.
Parameters:
hpName - is the sample to check
Returns:
true if sample is accessible.