2.17.2: 2011-06-17

net.sf.basedb.util.importer.spotdata
Class SerialSpotIntensityEventHandler

java.lang.Object
  extended by net.sf.basedb.util.importer.spotdata.SerialSpotIntensityEventHandler
All Implemented Interfaces:
EventHandler

public class SerialSpotIntensityEventHandler
extends Object
implements EventHandler

Event handler that extracts spot intensity information from serial BFS data files and inserts the values to a spot batcher. In the serial format there is one data file per assay. In each file there should be one data column for each channel. All data files should have the same column layout and the same number of lines. For example, file1.txt contains data for assay #1 and file2.txt contains data for assay #2. In both files the first column (index=0) has intensity for channel 1 and the second column (index=1) has intensity for channel 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) $

Field Summary
private  BioAssay[] assays
           
private  float[] ch
           
private  int[] chIndex
           
private  PositionEventHandler positionHandler
           
private  SpotBatcher spotBatcher
           
 
Constructor Summary
SerialSpotIntensityEventHandler(SpotBatcher spotBatcher, PositionEventHandler positionHandler, BioAssay[] assays, int[] chIndex)
          Create a new spot instensity event handler.
 
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
 

Field Detail

spotBatcher

private final SpotBatcher spotBatcher

positionHandler

private final PositionEventHandler positionHandler

assays

private final BioAssay[] assays

chIndex

private final int[] chIndex

ch

private float[] ch
Constructor Detail

SerialSpotIntensityEventHandler

public SerialSpotIntensityEventHandler(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 data
positionHandler - The event handler that is responsible for extracting position information from the reporter annotations file
assays - An array with all assays in the same order that they appeared in the pdata file
chIndex - An array with column indexes for channel intensities, first value is the column index for channel 1. The first column has index = 0. The size of this array should match the number of channels in the experiment.
Method Detail

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 generates
eventData - The data that is associated with the event
parser - The parser that is resposible for parsing the file

2.17.2: 2011-06-17