3.0.1: 2011-11-10

net.sf.basedb.util.affymetrix
Class CdfValidator

java.lang.Object
  extended by net.sf.basedb.util.affymetrix.CdfValidator

public class CdfValidator
extends Object

Helper class for working with Affymetrix CDF files.

Since:
3.0
Author:
Nicklas
Last modified
$Date: 2011-05-06 14:09:13 +0200 (Fri, 06 May 2011) $

Constructor Summary
CdfValidator()
          Create a new instance.
 
Method Summary
 int checkIfReportersExists(affymetrix.fusion.cdf.FusionCDFData cdf, ReporterBatcher batcher, boolean create, ReporterType type, ProgressReporter progress)
          Verify if probesets in a CDF file exists as reporters and optionally create those that doesn't exists.
 void copyMetadata(affymetrix.fusion.cdf.FusionCDFData cdf, ArrayDesign design)
          Copy metadata from the CDF file to the array design.
 affymetrix.fusion.cdf.FusionCDFData loadCdfFile(File cdfFile)
          Load a CDF file using the Affymetric Fusion SDK.
 void resetMetadata(ArrayDesign design)
          Reset metadata on the given array design.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CdfValidator

public CdfValidator()
Create a new instance.

Method Detail

loadCdfFile

public affymetrix.fusion.cdf.FusionCDFData loadCdfFile(File cdfFile)
                                                throws ItemNotFoundException,
                                                       InvalidDataException
Load a CDF file using the Affymetric Fusion SDK. This method checks that the file exists, and read all headers.

Parameters:
cdfFile - The file to load
Returns:
A FusionCDFData object representing the CDF file
Throws:
ItemNotFoundException - If the actual file is not on the server
InvalidDataException - If the file is not a CDF file

copyMetadata

public void copyMetadata(affymetrix.fusion.cdf.FusionCDFData cdf,
                         ArrayDesign design)
Copy metadata from the CDF file to the array design. This sets the number of features to the number of probesets.

Parameters:
cdf - The CDF file
design - The array design

resetMetadata

public void resetMetadata(ArrayDesign design)
Reset metadata on the given array design. This set the number of features to 0.

Parameters:
design - The array design

checkIfReportersExists

public int checkIfReportersExists(affymetrix.fusion.cdf.FusionCDFData cdf,
                                  ReporterBatcher batcher,
                                  boolean create,
                                  ReporterType type,
                                  ProgressReporter progress)
                           throws ItemNotFoundException,
                                  BaseException
Verify if probesets in a CDF file exists as reporters and optionally create those that doesn't exists. This method will clear the CDF file, read it, and then clear it again. The calling code is responsible for committing the transaction.

Parameters:
cdf - The CDF file
batcher - A reporter batcher used to check and insert reporters
create - TRUE to create non-existing reporters, FALSE to throw an ItemNotFoundException
type - The reporter type to assign to new reporters (if create is true)
progress - An optional progress reporter
Returns:
The number of created reporter
Throws:
ItemNotFoundException - If create is FALSE and a reporter isn't found
BaseException - If there is another error
Since:
2.4

3.0.1: 2011-11-10