Class GridCoords

java.lang.Object
  |
  +--GridCoords

public class GridCoords
extends java.lang.Object

The class contains data structures to map a spot on the array to a GRC coodinate. The GRC stands for (grid,row, grid_row, grid_column) coordinate. This lets us generate maps to convert gene microarray spot grid coordinates to and from GID/MID index values.

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: 2002/10/14 20:18:28 $ $Revision: $
Author:
P. Lemkin (NCI), G. Thornwall (SAIC), NCI-Frederick, Frederick, MD
See Also:
MAExplorer Home

Field Summary
 int c
          col #
 int f
          field #
 int g
          grid #
 int gid
          index cooresponding to ...[f][g][r][c]
private static MAExplorer mae
          link to global MAExplorer instance
 int r
          row #
 
Constructor Summary
  GridCoords()
          GridCoords() - constructor to build empty instance.
(package private) GridCoords(int f, int g, int r, int c, int gid)
          GridCoords() - constructor of individual grid coordinates for a gid spot.
(package private) GridCoords(MAExplorer mae)
          GridCoords() - constructor which builds (f,g,r,c) - (gid or cid) mapping tables.
 
Method Summary
(package private)  void createIndexToGridCoordMap()
          createIndexToGridCoordMap() - once only FGRC <--> gid map creation.
 java.lang.String cvtFGRC2str(int f, int g, int r, int c, boolean useFieldNameFlag)
          cvtFGRC2str() - convert grid coordinate f,g,r,c to string name
 java.lang.String cvtGID2str(int gid, boolean useFieldNameFlag)
          cvtGID2str() - convert grid coord GridCoords(gid) to string name
 GridCoords cvtNAME_GCR2FGRC(int field, java.lang.String sGRC)
          cvtNAME_GCR2FGRC() - parse Molecular Dynamics "GRID- 8-R12C11" coding to FGRC coords.
 java.lang.String toString(boolean useFieldNameFlag)
          toString() - convert grid coordinate instance to string name
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

mae

private static MAExplorer mae
link to global MAExplorer instance

f

public int f
field #

g

public int g
grid #

r

public int r
row #

c

public int c
col #

gid

public int gid
index cooresponding to ...[f][g][r][c]
Constructor Detail

GridCoords

public GridCoords()
GridCoords() - constructor to build empty instance.

GridCoords

GridCoords(MAExplorer mae)
GridCoords() - constructor which builds (f,g,r,c) - (gid or cid) mapping tables. Only called from MAExplorer init.
Parameters:
mae - is instance of MAExplorer
See Also:
createIndexToGridCoordMap()

GridCoords

GridCoords(int f,
           int g,
           int r,
           int c,
           int gid)
GridCoords() - constructor of individual grid coordinates for a gid spot.
Parameters:
f - is field #
g - is grid #
r - is grid-row #
c - is grid-column #
gid - is Grid Index ID GID value
Method Detail

createIndexToGridCoordMap

void createIndexToGridCoordMap()
createIndexToGridCoordMap() - once only FGRC <--> gid map creation. Note: if we are using Ratio data (Cy3/Cy5, etc) then we store Cy3 in f1 and Cy5 in f2. This sets up: map.fgrc2gid[f][g][r][c] map.gid2fgrc[gid] map.gidToGangGid[gid]

toString

public final java.lang.String toString(boolean useFieldNameFlag)
toString() - convert grid coordinate instance to string name
Parameters:
useFieldNameFlag - returns field name else field #
Returns:
FGRC string "[f-g,r,c]"
See Also:
cvtFGRC2str(int, int, int, int, boolean)

cvtFGRC2str

public final java.lang.String cvtFGRC2str(int f,
                                          int g,
                                          int r,
                                          int c,
                                          boolean useFieldNameFlag)
cvtFGRC2str() - convert grid coordinate f,g,r,c to string name
Parameters:
f - is field #
g - is grid #
r - is grid-row #
c - is grid-column #
useFieldNameFlag - returns field name else field #
Returns:
FGRC string "[f-g,r,c]"

cvtGID2str

public final java.lang.String cvtGID2str(int gid,
                                         boolean useFieldNameFlag)
cvtGID2str() - convert grid coord GridCoords(gid) to string name
Parameters:
gid - is Grid Index ID GID value
useFieldNameFlag - returns field name else field #
Returns:
FGRC string "[f-g,r,c]"

cvtNAME_GCR2FGRC

public GridCoords cvtNAME_GCR2FGRC(int field,
                                   java.lang.String sGRC)
cvtNAME_GCR2FGRC() - parse Molecular Dynamics "GRID- 8-R12C11" coding to FGRC coords. Contains finite state machine to parse it and save it in the (f,g,r,c) for this object.
Parameters:
field - is explicit field #
sGRC - is the NAME_GRC data
Returns:
grid coordinates object if ok, else null if an error.
See Also:
Util.cvs2i(java.lang.String)