2.17.2: 2011-06-17

net.sf.basedb.core
Class Affymetrix

java.lang.Object
  extended by net.sf.basedb.core.Affymetrix

public class Affymetrix
extends Object

Utility class for Affymetrix-specific functionality. Use this class to link CDF files with array designs and CEL and CHP files with raw bioassays.

Version:
2.0
Author:
nicklas
Last modified
$Date: 2008-09-11 22:11:02 +0200 (Thu, 11 Sep 2008) $

Field Summary
static String CDF_LINK_NAME
          Deprecated. See DataFileType.AFFYMETRIX_CDF
static String CEL_LINK_NAME
          Deprecated. See DataFileType.AFFYMETRIX_CEL
static String CHP_LINK_NAME
          Deprecated. See DataFileType
 
Constructor Summary
Affymetrix()
           
 
Method Summary
static int checkIfReportersExists(affymetrix.fusion.cdf.FusionCDFData cdf, ReporterBatcher batcher, boolean create, ReporterType type, ProgressReporter progress)
          Verify that probesets in a CDF file exists as reporters and optionally create those that doesn't exists.
static File getCdfFile(ArrayDesign design)
          Deprecated. Use FileStoreUtil.getDataFile(DbControl, FileStoreEnabled, String) with a data file type of DataFileType.AFFYMETRIX_CDF instead
static File getCelFile(RawBioAssay rawBioAssay)
          Deprecated.  
static affymetrix.fusion.cdf.FusionCDFData loadCdfFile(File cdfFile)
          Deprecated. Use AffymetrixFileHandler.loadCdfFile(File) instead
static affymetrix.fusion.cel.FusionCELData loadCelFile(File celFile)
          Deprecated. Use AffymetrixFileHandler.loadCdfFile(File) instead
static void setCdfFile(ArrayDesign design, File file)
          Deprecated. Use FileStoreUtil.setDataFile(DbControl, FileStoreEnabled, String, File) instead with DataFileType.AFFYMETRIX_CDF as the file type
static void setCelFile(RawBioAssay rawBioAssay, File file)
          Deprecated. Use FileStoreUtil.setDataFile(DbControl, FileStoreEnabled, String, File) instead with DataFileType.AFFYMETRIX_CEL as the file type
private static void validateCelAndCdf(affymetrix.fusion.cel.FusionCELData cel, affymetrix.fusion.cdf.FusionCDFData cdf, String cdfChipType)
           
static void validateCelAndCdf(RawBioAssay rawBioAssay, ArrayDesign design, boolean required)
          Check if the CEL file on the raw bioassay matches the CDF file on the array design.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CDF_LINK_NAME

public static final String CDF_LINK_NAME
Deprecated. See DataFileType.AFFYMETRIX_CDF
The name of the AnyToAny link between an array design and a file that contains the CDF information.

See Also:
Constant Field Values

CEL_LINK_NAME

public static final String CEL_LINK_NAME
Deprecated. See DataFileType.AFFYMETRIX_CEL
The name of the AnyToAny link between a raw bioassay and a file that contains the CEL information.

See Also:
Constant Field Values

CHP_LINK_NAME

public static final String CHP_LINK_NAME
Deprecated. See DataFileType
The name of the AnyToAny link between a raw bioassay and a file that contains the CHP information.

See Also:
Constant Field Values
Constructor Detail

Affymetrix

public Affymetrix()
Method Detail

setCdfFile

public static void setCdfFile(ArrayDesign design,
                              File file)
                       throws PermissionDeniedException,
                              InvalidDataException,
                              BaseException
Deprecated. Use FileStoreUtil.setDataFile(DbControl, FileStoreEnabled, String, File) instead with DataFileType.AFFYMETRIX_CDF as the file type

Attach a CDF file to an array design. When an array design has got a CDF file it counts as if it has features and it can be used for linking with RawBioAssay:s.

Starting with BASE 2.4 this method validates that the specified file is actaully a CDF file. See loadCdfFile(File).

Parameters:
design - The array design
file - The CDF file, or null to remove the file
Throws:
PermissionDeniedException - If the logged in user doesn't have write permission for the design and use permission for the file
InvalidDataException - If the design is null or isn't an Affymetrix chip or if the file is not a CDF file
BaseException - If there is another error

getCdfFile

public static File getCdfFile(ArrayDesign design)
                       throws PermissionDeniedException,
                              InvalidDataException,
                              BaseException
Deprecated. Use FileStoreUtil.getDataFile(DbControl, FileStoreEnabled, String) with a data file type of DataFileType.AFFYMETRIX_CDF instead

Get the file that has been specified as the CDF file for an array design. This method has been deprecated with the implementation of the Platform and DataFileType which solves the problem in a more generic way.

This method is equivalent to:

DataFileType cdfType = 
   DataFileType.getByExternalId(dc, DataFileType.AFFYMETRIX_CDF);
File cdfFile = design.getFileSet().getMember(cdfType.getFile());

Parameters:
design - The design to get the CDF file from, it must be an Affymetrix chip
Returns:
The CDF file or null if no CDF file has been specified
Throws:
PermissionDeniedException - If the logged in user doesn't have read permission for the file
InvalidDataException - If the design is null or isn't an Affymetrix chip
BaseException - If there is another error

setCelFile

public static void setCelFile(RawBioAssay rawBioAssay,
                              File file)
                       throws PermissionDeniedException,
                              InvalidDataException,
                              BaseException
Deprecated. Use FileStoreUtil.setDataFile(DbControl, FileStoreEnabled, String, File) instead with DataFileType.AFFYMETRIX_CEL as the file type

Attach a CEL file to a raw bioassay. When a raw bioassay has got a CEL file it counts as if data has been loaded and it can be used in experiments for analysis. To be able to add a CEL file the array design must also be connected to an array design with a CDF file. See setCdfFile(ArrayDesign, File).

Starting with BASE 2.4 this method validates that the specified file is a CEL file and that it matches the CDF file attached to the array design. The check includes:

This method also sets the number of spots to the number of cells found in the CEL file.

Parameters:
rawBioAssay - The raw bioassay
file - The CEL file, or null to remove the file
Throws:
PermissionDeniedException - If the logged in user doesn't have write permission for the raw bioassay and use permission for the file
InvalidDataException - If the raw bioassay is null or isn't an Affymetrix raw data type
BaseException - If there is another error

getCelFile

public static File getCelFile(RawBioAssay rawBioAssay)
                       throws PermissionDeniedException,
                              InvalidDataException,
                              BaseException
Deprecated. 

Get the file that has been specified as the CEL file for a raw bioassay.

Parameters:
rawBioAssay - The raw bioassay to get the CEL file from, it must be a raw bioassay of an Affymetrix raw data type
Returns:
The CEL file or null if no CEL file has been specified
Throws:
PermissionDeniedException - If the logged in user doesn't have read permission for the file
InvalidDataException - If the raw bioassay is null or isn't an Affymetrix raw data type
BaseException - If there is another error

validateCelAndCdf

public static void validateCelAndCdf(RawBioAssay rawBioAssay,
                                     ArrayDesign design,
                                     boolean required)
Check if the CEL file on the raw bioassay matches the CDF file on the array design.

Parameters:
rawBioAssay - The raw bioassay
design - The array design
required - TRUE if the absense of either a CEL or a CDF file is an error condition
Throws:
InvalidDataException - If the raw bioassay or array design are not Affymetrix type, or if the CEL doesn't match the CDF
Since:
2.4

validateCelAndCdf

private static void validateCelAndCdf(affymetrix.fusion.cel.FusionCELData cel,
                                      affymetrix.fusion.cdf.FusionCDFData cdf,
                                      String cdfChipType)
                               throws InvalidDataException
Throws:
InvalidDataException

loadCdfFile

public static affymetrix.fusion.cdf.FusionCDFData loadCdfFile(File cdfFile)
                                                       throws ItemNotFoundException,
                                                              InvalidDataException
Deprecated. Use AffymetrixFileHandler.loadCdfFile(File) instead

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 actaul file is not on the server
InvalidDataException - If the file is not a CDF file
Since:
2.4

loadCelFile

public static affymetrix.fusion.cel.FusionCELData loadCelFile(File celFile)
                                                       throws InvalidDataException
Deprecated. Use AffymetrixFileHandler.loadCdfFile(File) instead

Load a CEL file using the Affymetric Fusion SDK. This method checks that the file exists, and read all headers.

Parameters:
celFile - The file to load
Returns:
A FusionCELData object representing the CEL file
Throws:
ItemNotFoundException - If the actaul file is not on the server
InvalidDataException - If the file is not a CEL file
Since:
2.4

checkIfReportersExists

public static int checkIfReportersExists(affymetrix.fusion.cdf.FusionCDFData cdf,
                                         ReporterBatcher batcher,
                                         boolean create,
                                         ReporterType type,
                                         ProgressReporter progress)
                                  throws ItemNotFoundException,
                                         BaseException
Verify that 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

2.17.2: 2011-06-17