2.17.2: 2011-06-17

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

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

public class MAParser
extends Object
implements SpotIntensityParser

Spot intensity parser implementation for 2-channel data that looks for M/A values in the spot data and converts them to ch1/ch2 intensity values. The required assay fields are: l2ratio1_2 (M) and l10intgmean1_2 (A).

NOTE! The column names for the M/A values can be redefined by calling BaseFileParser.setRedefinedColumnName(String, String, String).

Version:
2.14
Author:
Nicklas
Last modified
$Date: 2009-09-14 08:29:17 +0200 (Mon, 14 Sep 2009) $

Field Summary
private static String aColumn
           
private  int aIndex
           
private static String mColumn
           
private  int mIndex
           
 
Constructor Summary
MAParser()
          Creates a new MA-parser.
 
Method Summary
 void beginSection(BaseFileParser parser, FlatFileParser ffp, List<String> assayFields)
          Prepare for parsing the data section.
 boolean hasRequiredAssayFields(BaseFileParser parser, FlatFileParser ffp, List<String> assayFields)
          Check the list of assay fields to see if all columns that are required are present or not.
 boolean setIntensities(FlatFileParser.Data data, float[] intensities, int firstIndex)
          Extract the intensity values from the current data line for a single bioassay.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mIndex

private int mIndex

aIndex

private int aIndex

mColumn

private static final String mColumn
See Also:
Constant Field Values

aColumn

private static final String aColumn
See Also:
Constant Field Values
Constructor Detail

MAParser

public MAParser()
Creates a new MA-parser.

Method Detail

hasRequiredAssayFields

public boolean hasRequiredAssayFields(BaseFileParser parser,
                                      FlatFileParser ffp,
                                      List<String> assayFields)
Description copied from interface: SpotIntensityParser
Check the list of assay fields to see if all columns that are required are present or not. This method is called in the first pass to decide which spot intensity parser that should be used in the second pass.

Specified by:
hasRequiredAssayFields in interface SpotIntensityParser
Parameters:
parser - The master BASEfile parser
ffp - The flat file parser that parses the current file
assayFields - The list of assay fields
Returns:
TRUE if all required fields are present, FALSE otherwise

beginSection

public void beginSection(BaseFileParser parser,
                         FlatFileParser ffp,
                         List<String> assayFields)
Description copied from interface: SpotIntensityParser
Prepare for parsing the data section. Preparations typically include extracting the column indexes of the data columns. This method is called in the second pass before starting to parse data for a 'spot' section. NOTE! The same object instance may be used to parse more than one section in a serial BASEfile.

Specified by:
beginSection in interface SpotIntensityParser
Parameters:
parser - The master BASEfile parser
ffp - The flat file parser that parses the current file
assayFields - The list of assay fields

setIntensities

public boolean setIntensities(FlatFileParser.Data data,
                              float[] intensities,
                              int firstIndex)
Description copied from interface: SpotIntensityParser
Extract the intensity values from the current data line for a single bioassay. If the section contains data for multiple bioassays (eg. a matrix BASEfile) this method is called multiple times (with different 'firstIndex' value) for each row.

Specified by:
setIntensities in interface SpotIntensityParser
Parameters:
data - The current data line
intensities - An array that should be populate with intensity values
firstIndex - The index of the first data column that contains data for the current bioassay
Returns:
TRUE if the values could be set correctly, FALSE otherwise (which means that the spot data will not be inserted)

2.17.2: 2011-06-17