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 toSynchronizedSpotDataParser.DATA_EVENT
events.- Version:
- 2.15
- Author:
- Nicklas
- Last modified
- $Date: 2015-04-20 11:08:18 +0200 (må, 20 apr 2015) $
-
-
Field Summary
Fields Modifier and Type Field Description private BioAssay[]
assays
private float[]
ch
private int[]
chIndex
private PositionEventHandler
positionHandler
private SpotBatcher
spotBatcher
-
Constructor Summary
Constructors Constructor Description MatrixSpotIntensityEventHandler(SpotBatcher spotBatcher, PositionEventHandler positionHandler, BioAssay[] assays, int[] chIndex)
Create a new spot instensity event handler.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.
-
-
-
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
-
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.
-
-
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 interfaceEventHandler
- 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
-
-