net.sf.basedb.util.importer.spotdata
Class MatrixSpotIntensityEventHandler
java.lang.Object
net.sf.basedb.util.importer.spotdata.MatrixSpotIntensityEventHandler
- All Implemented Interfaces:
- EventHandler
public class MatrixSpotIntensityEventHandler
- extends Object
- implements EventHandler
Event handler that extracts spot intensity information from matrix BFS
data files and inserts the values to a spot batcher. In the matrix format
there is one data file per channel. In each file there should be one data
column for each assay. All data files should have the same
column layout and the same number of lines. For example, file1.txt
contains data for channel 1 and file2.txt contains data for channel 2.
In both files the first column (index=0) has intensity for assay #1
and the second column (index=1) has intensity for assay #2.
This event handler is designed to work together with a SynchronizedSpotDataParser
and will only react to SynchronizedSpotDataParser.DATA_EVENT
events.
- Version:
- 2.15
- Author:
- Nicklas
- Last modified
- $Date: 2010-02-01 14:30:59 +0100 (Mon, 01 Feb 2010) $
Method Summary |
void |
handleEvent(EventType eventType,
Object eventData,
BfsParser parser)
Extract the spot intensity values from the data files and batch insert
them using the spot batcher. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
spotBatcher
private final SpotBatcher spotBatcher
positionHandler
private final PositionEventHandler positionHandler
assays
private final BioAssay[] assays
chIndex
private final int[] chIndex
ch
private float[] ch
MatrixSpotIntensityEventHandler
public MatrixSpotIntensityEventHandler(SpotBatcher spotBatcher,
PositionEventHandler positionHandler,
BioAssay[] assays,
int[] chIndex)
- Create a new spot instensity event handler.
- Parameters:
spotBatcher
- The spot batcher that should receive the intensity datapositionHandler
- The event handler that is responsible for extracting
position information from the reporter annotations fileassays
- An array with all assays in the same order that they
appeared in the pdata filechIndex
- An array with file indexes for channel intensities,
first value is the file index for channel 1. The first file has
index = 0. The size of this array should match the number of channels
in the experiment.
handleEvent
public void handleEvent(EventType eventType,
Object eventData,
BfsParser parser)
- Extract the spot intensity values from the data files and batch insert
them using the spot batcher. If all channels are empty, no data will be
inserted for that spot, otherwise a null value will be inserted for
the missing channels. The parser will treat invalid values as
empty columns.
- Specified by:
handleEvent
in interface EventHandler
- Parameters:
eventType
- The type of event. See the parser documentation
for more information about the event types it generateseventData
- The data that is associated with the eventparser
- The parser that is resposible for parsing the file