Class SerialSpotIntensityEventHandler
java.lang.Object
net.sf.basedb.util.importer.spotdata.SerialSpotIntensityEventHandler
- All Implemented Interfaces:
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: 2015-04-20 11:08:18 +0200 (må, 20 apr 2015) $
-
Field Summary
Modifier and TypeFieldDescriptionprivate final BioAssay[]
private float[]
private final int[]
private final PositionEventHandler
private final SpotBatcher
-
Constructor Summary
ConstructorDescriptionSerialSpotIntensityEventHandler
(SpotBatcher spotBatcher, PositionEventHandler positionHandler, BioAssay[] assays, int[] chIndex) Create a new spot instensity event handler. -
Method Summary
Modifier and TypeMethodDescriptionvoid
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 Details
-
spotBatcher
-
positionHandler
-
assays
-
chIndex
private final int[] chIndex -
ch
private float[] ch
-
-
Constructor Details
-
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 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 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 Details
-
handleEvent
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
-