2.17.2: 2011-06-17

net.sf.basedb.core
Class RawDataType

java.lang.Object
  extended by net.sf.basedb.core.RawDataType
All Implemented Interfaces:
Comparable<RawDataType>

public class RawDataType
extends Object
implements Comparable<RawDataType>

This class holds information about a raw data type. Unlike many other classes this information is not stored in the database, but in the raw-data-types.xml XML file. This file is parsed upon startup by the RawDataTypes class.

Raw data types are important for RawBioAssay:s.

Version:
2.0
Author:
Nicklas
See Also:
RawDataTypes, RawBioAssay
Last modified
$Date: 2011-02-18 13:19:38 +0100 (Fri, 18 Feb 2011) $

Field Summary
private  int channels
           
private  String description
           
private  boolean fileOnly
           
private  List<IntensityFormula> formulas
           
private  String id
           
private  boolean isAffymetrix
           
private  String name
           
private  Map<String,IntensityFormula> namedFormulas
           
private  Map<String,RawDataProperty> namedProperties
           
private  PlatformData platform
           
private  List<RawDataProperty> properties
           
private  RealTable realTable
           
private  String table
           
private  PlatformVariantData variant
           
 
Constructor Summary
(package private) RawDataType(PlatformData platform)
          Create a new raw data type representing a file-only platform.
(package private) RawDataType(PlatformVariantData variant)
          Create a new raw data type representing a file-only platform variant.
private RawDataType(String id, String name, String description, int channels, boolean fileOnly, PlatformData platform, PlatformVariantData variant, boolean isAffymetrix, String table, List<RawDataProperty> properties, List<IntensityFormula> formulas)
           
(package private) RawDataType(String id, String name, String description, int channels, String table, List<RawDataProperty> properties, List<IntensityFormula> formulas)
          Create a new RawDataType.
 
Method Summary
 int compareTo(RawDataType o)
          Compare the id:s of the raw data types.
 boolean equals(Object obj)
           
 int getChannels()
          The number of channels in this raw data type.
 String getDescription()
          Get a description of this raw data type.
 String getEntityName()
           
 String getId()
          Get the id of this raw data type.
 IntensityFormula getIntensityFormula(String name)
           
 List<IntensityFormula> getIntensityFormulas()
           
 String getName()
          Get the name of this raw data type.
 Platform getPlatform(DbControl dc)
          Get the platform that this raw data type is associated with.
(package private)  PlatformData getPlatformProxy()
          Needed to make RawBioAssay.setRawDataType(RawDataType) backwards compatible.
 List<RawDataProperty> getProperties()
          Get a list of RawDataProperty:s with definitions for the extra properties that has been defined for this raw data type.
 RawDataProperty getProperty(String name)
           
 RawData getRawDataById(DbControl dc, int id)
           
 RealTable getRealTable()
           
 String getTableName()
          Get the name of the database table that is used to store the extra properties of this raw data type.
 PlatformVariant getVariant(DbControl dc)
          Get the platform variant that this raw data type is associated with.
(package private)  PlatformVariantData getVariantProxy()
          Needed to make RawBioAssay.setRawDataType(RawDataType) backwards compatible.
 int hashCode()
           
 boolean isAffymetrix()
          Deprecated. Use getPlatform(DbControl) and compare the external ID with Platform.AFFYMETRIX
 boolean isStoredInDb()
          If the raw data of this raw data type can be stored in the database or not.
(package private)  void setName(String name)
          Update the name.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

id

private final String id

name

private String name

description

private final String description

fileOnly

private final boolean fileOnly

isAffymetrix

private final boolean isAffymetrix

channels

private final int channels

platform

private final PlatformData platform

variant

private final PlatformVariantData variant

table

private String table

realTable

private RealTable realTable

properties

private List<RawDataProperty> properties

namedProperties

private Map<String,RawDataProperty> namedProperties

formulas

private List<IntensityFormula> formulas

namedFormulas

private Map<String,IntensityFormula> namedFormulas
Constructor Detail

RawDataType

RawDataType(String id,
            String name,
            String description,
            int channels,
            String table,
            List<RawDataProperty> properties,
            List<IntensityFormula> formulas)
Create a new RawDataType. See the getter methods for a description of the parameters


RawDataType

RawDataType(PlatformData platform)
Create a new raw data type representing a file-only platform.

Parameters:
platform - The platform

RawDataType

RawDataType(PlatformVariantData variant)
Create a new raw data type representing a file-only platform variant.

Parameters:
variant - The platform variant

RawDataType

private RawDataType(String id,
                    String name,
                    String description,
                    int channels,
                    boolean fileOnly,
                    PlatformData platform,
                    PlatformVariantData variant,
                    boolean isAffymetrix,
                    String table,
                    List<RawDataProperty> properties,
                    List<IntensityFormula> formulas)
Method Detail

getId

public String getId()
Get the id of this raw data type. This value is the same as the id attribute of the <raw-data-type> tag in the XML file.

Returns:
The id for this raw data type

isAffymetrix

public boolean isAffymetrix()
Deprecated. Use getPlatform(DbControl) and compare the external ID with Platform.AFFYMETRIX

If this raw data type is the Affymetrix raw data type.


getPlatform

public Platform getPlatform(DbControl dc)
Get the platform that this raw data type is associated with. Only raw data types representing file-only platforms are associated with that platform. If isStoredInDb() returns true this method will always return null.

Parameters:
dc - The DbControl to use for database access
Returns:
A Platform item or null if this raw data type isn't associated with a platform
Since:
2.5

getVariant

public PlatformVariant getVariant(DbControl dc)
Get the platform variant that this raw data type is associated with. Only raw data types representing file-only variants are associated with that variant.

Parameters:
dc - The DbControl to use for database access
Returns:
A Platform item or null if this raw data type isn't associated with a variant
Since:
2.5

getPlatformProxy

PlatformData getPlatformProxy()
Needed to make RawBioAssay.setRawDataType(RawDataType) backwards compatible. Platforms that are not file-only will get the Platform.GENERIC platform.

Since:
2.5

getVariantProxy

PlatformVariantData getVariantProxy()
Needed to make RawBioAssay.setRawDataType(RawDataType) backwards compatible.

Since:
2.5

getName

public String getName()
Get the name of this raw data type. This value is the same as the name attribute of the <raw-data-type> tag in the XML file. The name is not used by the core, but should be used by client applications in the user interface.

Returns:
The name for this raw data type

setName

void setName(String name)
Update the name. Used mainly for file-only representations of raw data types when the underlying platform is changed.

Since:
2.16.2

getDescription

public String getDescription()
Get a description of this raw data type. This value is the same as the description attribute of the <raw-data-type> tag in the XML file. The description is not used by the core, but can be used by client applications in help texts, etc.

Returns:
A description for this raw data type

getChannels

public int getChannels()
The number of channels in this raw data type. Channels are important in the core when it comes to the analysis phase. Some analysis methods only works for a specific number of channels (mostly two). This value is the same as the channels attribute of the <raw-data-type> tag in the XML file.

Returns:
The number of channels

isStoredInDb

public boolean isStoredInDb()
If the raw data of this raw data type can be stored in the database or not.

See Also:
getTableName()

getTableName

public String getTableName()
Get the name of the database table that is used to store the extra properties of this raw data type. This value is the same as the table attribute of the <raw-data-type> tag in the XML file. The table name is normally not useful for any client application.

Returns:
The name of the database table for this raw data type, or null if not stored in database
See Also:
isStoredInDb()

getEntityName

public String getEntityName()

getRealTable

public RealTable getRealTable()

getProperties

public List<RawDataProperty> getProperties()
Get a list of RawDataProperty:s with definitions for the extra properties that has been defined for this raw data type.

Returns:
A List object containing RawDataProperty objects

getProperty

public RawDataProperty getProperty(String name)

getIntensityFormulas

public List<IntensityFormula> getIntensityFormulas()

getIntensityFormula

public IntensityFormula getIntensityFormula(String name)

toString

public String toString()
Overrides:
toString in class Object

getRawDataById

public RawData getRawDataById(DbControl dc,
                              int id)
                       throws ItemNotFoundException,
                              PermissionDeniedException,
                              BaseException
Throws:
ItemNotFoundException
PermissionDeniedException
BaseException

compareTo

public int compareTo(RawDataType o)
Compare the id:s of the raw data types. Note! Before 2.16.2 the name was used for comparing but this led to issues when changing the name of file-only plaforms. See ticket #1567.

Specified by:
compareTo in interface Comparable<RawDataType>
Since:
2.5

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

2.17.2: 2011-06-17