Class ReadTissues

java.lang.Object
  |
  +--ReadTissues

public class ReadTissues
extends java.lang.Object

Class ReadTissues.java - read tissues file mapping tissues to bit #s. The bits go from right to left. So that if a bit # is say 3, the corresponding bit is (1<<3).

 The tab-delimited data looks like the following (the values may change):
   uncharacterized tissue	1
   heart	2
   lung	3
   vascular	4
   liver	5
   eye	6
   testis	7
   brain	8
   . . .
   adrenal medulla	50
   nervous	51
This work was produced by Peter Lemkin of the National Cancer Institute, an agency of the United States Government and Djamel Medjahed (SAIC-Frederick). 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.

Version:
$Date: 2002/10/14 20:17:17 $ $Revision: $
Author:
P. Lemkin (NCI), Djamel Medjahed (SAIC), NCI-Frederick, Frederick, MD
See Also:
ProtPlot Home

This work was derived from MAExplorer under the Mozilla 1.1 Open Source Public License by Peter Lemkin of the National Cancer Institute, an agency of the United States Government subject to the limitations noted in the accompanying LEGAL file. See licence info on http://maexplorer.sourceforge.org/


Field Summary
private  java.lang.String[] defTissues
          Default list of tissues
 int maxTissues
          max # of families
 int nTissues
          # of families
private  ProtPlot prp
          instance of ProtPlot
 long[] tissueBits
          list of tissue tissue BITS [0:nFamilies-1] return all tokens/row the tissueBit[i] = 2**tissueNbr[i].
 java.lang.String[] tissueNames
          List of tissue names [0:nTissues-1] return all tokens/row
 java.lang.String tissueNamesFile
          Name of the tissue data tab-delimited file.
 int[] tissueNbrs
          list of tissue tissue Numbers [0:nFamilies-1] return all tokens/row
private  char[] tokBuf
          token buffer
private  UtilPRP util
          instance of UtilPRP
 
Constructor Summary
(package private) ReadTissues(ProtPlot prp, java.lang.String tissueNamesFile, int maxTissues, java.lang.String msg)
          ReadTissues() - constructor
 
Method Summary
 long cvtTissueNamesToBits(java.lang.String useTissueNames)
          cvtTissueNamesToBits() - convert tissue names to tissueBits Eg.
 java.lang.String cvtTissuesStr(long tBits)
          cvtTissuesStr() - lookup tissues from the tissueBits
private  boolean parseRows(java.lang.String sData)
          parseRows() - parse and save a rows of data in rd.protList[] data structures.
 boolean readTissuesFile(java.lang.String msg)
          readTissuesFile() - read list of tissues into data structure
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

prp

private ProtPlot prp
instance of ProtPlot

util

private UtilPRP util
instance of UtilPRP

defTissues

private java.lang.String[] defTissues
Default list of tissues

tissueNamesFile

public java.lang.String tissueNamesFile
Name of the tissue data tab-delimited file. This consists of 2 columns "TissueName" "TissueNbr" which is followed by the data.

maxTissues

public int maxTissues
max # of families

nTissues

public int nTissues
# of families

tissueNames

public java.lang.String[] tissueNames
List of tissue names [0:nTissues-1] return all tokens/row

tissueNbrs

public int[] tissueNbrs
list of tissue tissue Numbers [0:nFamilies-1] return all tokens/row

tissueBits

public long[] tissueBits
list of tissue tissue BITS [0:nFamilies-1] return all tokens/row the tissueBit[i] = 2**tissueNbr[i].

tokBuf

private char[] tokBuf
token buffer
Constructor Detail

ReadTissues

ReadTissues(ProtPlot prp,
            java.lang.String tissueNamesFile,
            int maxTissues,
            java.lang.String msg)
ReadTissues() - constructor
Parameters:
prp - is instance of ProtPlot
tissueNamesFile - name
maxTissues - in file
msg - to use while reading
Method Detail

readTissuesFile

public boolean readTissuesFile(java.lang.String msg)
readTissuesFile() - read list of tissues into data structure
Parameters:
msg - to display while reading file.

parseRows

private boolean parseRows(java.lang.String sData)
parseRows() - parse and save a rows of data in rd.protList[] data structures.
Parameters:
sData - to parse
Returns:
true if ok.

cvtTissuesStr

public java.lang.String cvtTissuesStr(long tBits)
cvtTissuesStr() - lookup tissues from the tissueBits
Parameters:
tBits - is the tissue bits to lookup as string equivalent
Returns:
"Tissues: c1, c2, ..., cn" list

cvtTissueNamesToBits

public long cvtTissueNamesToBits(java.lang.String useTissueNames)
cvtTissueNamesToBits() - convert tissue names to tissueBits Eg. "Tissues: c1,c2,...,cn" list Allow alternate form which is a list of tissueNbrs e.g. "3,25,13,10" in which case would just build the bit pattern from these
Parameters:
tissueNames - to convert to bits, separated by "," (CHK)
Returns:
tissueBits. If no names, set to "ALL" equals 1.