2.17.2: 2011-06-17

net.sf.basedb.core
Class RawBioAssay

java.lang.Object
  extended by net.sf.basedb.core.BasicItem<D>
      extended by net.sf.basedb.core.OwnedItem<D>
          extended by net.sf.basedb.core.SharedItem<D>
              extended by net.sf.basedb.core.CommonItem<D>
                  extended by net.sf.basedb.core.AnnotatedItem<RawBioAssayData>
                      extended by net.sf.basedb.core.RawBioAssay
All Implemented Interfaces:
AccessControlled, Annotatable, Controlled, DiskConsumable, FileStoreEnabled, Identifiable, Nameable, Ownable, Registered, Removable, Shareable, ToTransferable<RawBioAssayInfo>

public class RawBioAssay
extends AnnotatedItem<RawBioAssayData>
implements DiskConsumable, FileStoreEnabled, ToTransferable<RawBioAssayInfo>, Registered

A rawbioassay represents the raw data generated from a single Scan. A raw bioassay must have a RawDataType which specifies the data columns generated by the Software.

Raw data is added by a RawDataBatcher object. You can get a batcher for this raw bioassay by calling the getRawDataBatcher(FeatureIdentificationMethod, Job) method.

Version:
2.0
Author:
Nicklas
Last modified
$Date: 2010-04-20 10:02:16 +0200 (Tue, 20 Apr 2010) $

Field Summary
private  boolean arrayDesignHasBeenSet
           
static int MAX_HEADER_NAME_LENGTH
          The maximum length of the name of a header that can be stored in the database.
static int MAX_HEADER_VALUE_LENGTH
          The maximum length of the value of a header that can be stored in the database.
private  boolean protocolHasBeenSet
           
private  RawDataBatcher rawDataBatcher
           
private  boolean softwareHasBeenSet
           
static Item TYPE
          The type of item represented by this class.
 
Fields inherited from interface net.sf.basedb.core.Nameable
MAX_DESCRIPTION_LENGTH, MAX_NAME_LENGTH
 
Constructor Summary
RawBioAssay(RawBioAssayData data)
           
 
Method Summary
 void deleteRawData()
          Delete the raw data that has been added to the database for this raw bioassay.
 Set<Annotatable> getAnnotatableParents()
          Get the scan, if any.
 ArrayDesign getArrayDesign()
          Get the ArrayDesign this raw data uses.
 int getArrayNum()
          Get the hybridization array number this raw bioassay is linked to.
static RawBioAssay getById(DbControl dc, int id)
          Get a RawBioAssay object when you know the id.
 long getBytes()
          Get the absolute number of bytes this item uses.
 long getDifference()
          Always 0.
 DynamicRawDataQuery getDynamicRawData()
          Get a dynamic query that returns the raw data of this raw bioassay.
 Date getEntryDate()
          Get the date that the item was registered in the database.
 ItemQuery<Experiment> getExperiments()
          Get a query that returns all experiments where this raw bioassay is used.
 FileSet getFileSet()
          Get the file set that collects all files that holds data for this item.
 String getHeader(String name)
          Get the value for the raw data header with the specified name.
 Set<String> getHeaderNames()
          Get the names of all raw data headers.
 Job getJob()
          Get the job that imported data to this raw bioassay.
 Location getLocation()
          Always Location.PRIMARY.
static RawBioAssay getNew(DbControl dc, Platform platform, RawDataType rawDataType)
          Create a new raw bioassay for a specific platform and/or raw data type.
static RawBioAssay getNew(DbControl dc, PlatformVariant variant, RawDataType rawDataType)
          Create a new raw bioassay for a specific platform variant.
static RawBioAssay getNew(DbControl dc, RawDataType rawDataType)
          Deprecated. Use getNew(DbControl, Platform, RawDataType) or getNew(DbControl, PlatformVariant, RawDataType) instead. This method will set the platform to Platform.GENERIC.
 int getNumDbSpots()
          Get the number of spots on this raw bioassay that are stored in the database.
 int getNumFileSpots()
          Get the number of spots on this raw bioassay that are stored inside files.
 Collection<FileSet> getParentFileSets()
          Get the file set from the array design, if it exists.
 Platform getPlatform()
          Get the platform the item is related to.
 Protocol getProtocol()
          Get the Protocol used while analysing the scanned images.
static ItemQuery<RawBioAssay> getQuery()
          Get a query configured to retrieve raw bioassays.
 String getQuotaTypeSystemId()
          Always QuotaType.RAW_DATA.
 DataQuery<RawData> getRawData()
          Get a query that returns the raw data of this raw bioassay.
 RawDataBatcher getRawDataBatcher()
          Deprecated. Use getRawDataBatcher(FeatureIdentificationMethod, Job) instead
 RawDataBatcher getRawDataBatcher(FeatureIdentificationMethod fiMethod)
          Deprecated. Use getRawDataBatcher(FeatureIdentificationMethod, Job) instead.
 RawDataBatcher getRawDataBatcher(FeatureIdentificationMethod fiMethod, Job job)
          Get a raw data batcher object which can be used to add raw data to the raw bioassay.
 RawData getRawDataById(int id)
          Get a raw data spot when you know the id.
 RawData getRawDataById(int id, boolean forceInitialization)
          Get a raw data spot when you know the id.
 RawDataType getRawDataType()
          Get the raw data type this raw bioassay uses for the raw data.
 DataQuery<ReporterData> getReporters()
          Get a query that returns the reporters on this raw bioassay.
 Scan getScan()
          Get the Scan this raw bioassay is created from.
 Software getSoftware()
          Get the Software used while analysing the scanned images.
 SpotImages getSpotImages()
          Get the SpotImages item used to generate spot images for this raw bioassay.
 int getSpots()
          Deprecated. Use getNumDbSpots() or getNumFileSpots() instead. This method first checks the database and if not 0, it returns that value, otherwise it returns the number of file spots
 Item getType()
          Get the type of item represented by the object.
 Set<ItemProxy> getUsingItems()
          Get all: Experiment:s using this raw bioassay Transformation:s using this raw bioassay
 PlatformVariant getVariant()
          Get the platform variant the item is related to.
 boolean hasArrayDesign()
          Check if this raw bioassay is connected to an array design or not.
 boolean hasData()
          If raw data has been added to this raw bioassay or not.
 boolean hasFileSet()
          Check if this item has a file set.
 boolean hasSpotImages()
          Check if spot images exists for this raw bioassay or not.
 boolean isFileOnlyPlatform()
          Check if this raw bioassay uses a file-only platform or variant.
 boolean isPlatform(String externalId)
          Check if the platform/variant of this raw bioassay has the given external ID.
 boolean isUsed()
          Check if: An Experiment is using this raw bioassay A Transformation is using this raw bio raw data type will also be updated.
(package private)  void onBeforeCommit(Transactional.Action action)
          Delete raw data if it exists.
 void removeHeader(String name)
          Remove a specific header from the raw bioassay.
 void removeHeaders()
          Remove all headers from the raw bioassay.
 void setArrayDesign(ArrayDesign arrayDesign)
          Set the ArrayDesign this raw data uses.
 void setArrayNum(int arrayNum)
          Set the hybridization array number this raw bioassay is linked to.
 void setHeader(String name, String value)
          Set the value for a raw data header.
 void setNumFileSpots(int numSpots)
          Set the number of spots that are stored in files.
 void setPlatform(Platform platform, RawDataType rawDataType)
          Set the platform and raw data type of the raw bioassay.
(package private)  void setProjectDefaults(Project activeProject)
          Set software, protocol and array design from project default settings.
 void setProtocol(Protocol protocol)
          Set the Protocol used while analysing the scanned images.
 void setRawDataType(RawDataType rawDataType)
          Deprecated. Use setPlatform(Platform, RawDataType) or setVariant(PlatformVariant, RawDataType) instead
 void setScan(Scan scan)
          Set the Scan this raw bioassay is created from.
 void setSoftware(Software software)
          Set the Software used while analysing the scanned images.
 void setVariant(PlatformVariant variant, RawDataType rawDataType)
          Set the platform and variant of the raw bioassay.
 RawBioAssayInfo toTransferable(RawBioAssayInfo info)
          Transfer the internal state to a transferable object.
 void updateArrayDesign(ArrayDesign arrayDesign, FeatureIdentificationMethod fiMethod, ProgressReporter progress)
          Set the ArrayDesign this raw data uses.
 void updateArrayDesign(ArrayDesign arrayDesign, ProgressReporter progress)
          Deprecated. Use updateArrayDesign(ArrayDesign, FeatureIdentificationMethod, ProgressReporter) instead
 boolean useDifference()
          Always FALSE.
private  void validateFeatures(DbControl dc, ArrayDesign design, FeatureIdentificationMethod fiMethod, boolean update, ProgressReporter progress)
          Validate that the features/reporters of the raw data matches the features/reporter on the array design.
 
Methods inherited from class net.sf.basedb.core.AnnotatedItem
getAnnotationSet, isAnnotated, removeAnnotations, toTransferable
 
Methods inherited from class net.sf.basedb.core.CommonItem
getDescription, getName, isRemoved, setDescription, setName, setRemoved, toTransferable
 
Methods inherited from class net.sf.basedb.core.SharedItem
getItemKey, getProjectKey, initPermissions, isShared, setItemKey, setProjectKey, toTransferable
 
Methods inherited from class net.sf.basedb.core.OwnedItem
getOwner, isOwner, setOwner, takeOwnership, toTransferable
 
Methods inherited from class net.sf.basedb.core.BasicItem
addUsingItems, addUsingItems, checkPermission, equals, getData, getDbControl, getId, getPermissions, getPluginPermissions, getSessionControl, getVersion, hashCode, hasPermission, isDetached, isInDatabase, onAfterCommit, onAfterInsert, onRollback, setDbControl, toString, toTransferable, validate
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface net.sf.basedb.core.Ownable
getOwner, isOwner, setOwner, takeOwnership
 
Methods inherited from interface net.sf.basedb.core.Identifiable
getId, getVersion
 
Methods inherited from interface net.sf.basedb.core.AccessControlled
checkPermission, getPermissions, hasPermission
 

Field Detail

TYPE

public static final Item TYPE
The type of item represented by this class.

See Also:
Item.RAWBIOASSAY, getType()

MAX_HEADER_NAME_LENGTH

public static final int MAX_HEADER_NAME_LENGTH
The maximum length of the name of a header that can be stored in the database. Check the name length against this value before calling setHeader(String, String) to avoid exceptions.

See Also:
Constant Field Values

MAX_HEADER_VALUE_LENGTH

public static final int MAX_HEADER_VALUE_LENGTH
The maximum length of the value of a header that can be stored in the database. Check the value length against this value before calling setHeader(String, String) to avoid exceptions.

See Also:
Constant Field Values

rawDataBatcher

private RawDataBatcher rawDataBatcher

softwareHasBeenSet

private boolean softwareHasBeenSet

protocolHasBeenSet

private boolean protocolHasBeenSet

arrayDesignHasBeenSet

private boolean arrayDesignHasBeenSet
Constructor Detail

RawBioAssay

RawBioAssay(RawBioAssayData data)
Method Detail

getNew

public static RawBioAssay getNew(DbControl dc,
                                 RawDataType rawDataType)
                          throws BaseException
Deprecated. Use getNew(DbControl, Platform, RawDataType) or getNew(DbControl, PlatformVariant, RawDataType) instead. This method will set the platform to Platform.GENERIC.

Create a new RawBioAssay item. The platform/variant will automatically be set to the values returned by RawDataType.getPlatform(DbControl) and RawDataType.getVariant(DbControl). If both return null the Platform.GENERIC is used.

Parameters:
dc - The DbControl which will be used for permission checking and database access
rawDataType - The data type of the raw data
Returns:
The new RawBioAssay item
Throws:
BaseException - If there is an error

getNew

public static RawBioAssay getNew(DbControl dc,
                                 Platform platform,
                                 RawDataType rawDataType)
Create a new raw bioassay for a specific platform and/or raw data type. If the platform is locked to a specific raw data type, the rawDataType parameter is ignored. If the platform isn't locked the raw data type is required and must be a database-based raw data type. Ie. RawDataType.isStoredInDb() must return true.

Parameters:
dc - The DbControl which will be used for permission checking and database access
platform - The platform of the new raw bioassay, null is not allowed
rawDataType - The raw data type of the raw bioassay (required if the platform isn't locked to a specific raw data type)
Returns:
The new RawBioAssay item
Since:
2.5

getNew

public static RawBioAssay getNew(DbControl dc,
                                 PlatformVariant variant,
                                 RawDataType rawDataType)
Create a new raw bioassay for a specific platform variant. If the variant is locked to a specific raw data type, the rawDataType parameter is ignored. If the variant isn't locked the raw data type is required and must be a database-based raw data type. Ie. RawDataType.isStoredInDb() must return true.

Parameters:
dc - The DbControl which will be used for permission checking and database access
variant - The platform variant of the new raw bioassay, null is not allowed
rawDataType - The raw data type of the raw bioassay (required if the platform isn't locked to a specific raw data type)
Returns:
The new RawBioAssay item
Since:
2.5

getById

public static RawBioAssay getById(DbControl dc,
                                  int id)
                           throws ItemNotFoundException,
                                  PermissionDeniedException,
                                  BaseException
Get a RawBioAssay object when you know the id.

Parameters:
dc - The DbControl which will be used for permission checking and database access.
id - The id of the item to load
Returns:
The RawBioAssay item
Throws:
ItemNotFoundException - If an item with the specified id is not found
PermissionDeniedException - If the logged in user doesn't have read permission to the item
BaseException - If there is another error

getQuery

public static ItemQuery<RawBioAssay> getQuery()
Get a query configured to retrieve raw bioassays.

Returns:
An ItemQuery object

getType

public Item getType()
Description copied from interface: Identifiable
Get the type of item represented by the object. The returned value is one of the values defined in the Item enumeration.

Specified by:
getType in interface Identifiable
Returns:
A value indicating the type of item

useDifference

public boolean useDifference()
Always FALSE.

Specified by:
useDifference in interface DiskConsumable
Returns:
TRUE if the item reports the difference, FALSE if it reports the absolute
See Also:
DiskConsumable.getBytes(), DiskConsumable.getDifference()

getBytes

public long getBytes()
Description copied from interface: DiskConsumable
Get the absolute number of bytes this item uses. All items must report this number.

Specified by:
getBytes in interface DiskConsumable
Returns:
The absolute number of bytes the item uses
See Also:
DiskConsumable.useDifference(), DiskConsumable.getDifference()

getDifference

public long getDifference()
Always 0.

Specified by:
getDifference in interface DiskConsumable
Returns:
The difference in bytes between now and when the item was loaded, or 0 if this item doesn't report differences

getQuotaTypeSystemId

public String getQuotaTypeSystemId()
Always QuotaType.RAW_DATA.

Specified by:
getQuotaTypeSystemId in interface DiskConsumable
Returns:
The systemid of the QuotaType

getLocation

public Location getLocation()
Always Location.PRIMARY.

Specified by:
getLocation in interface DiskConsumable
Returns:
The location

getAnnotatableParents

public Set<Annotatable> getAnnotatableParents()
                                       throws BaseException
Get the scan, if any.

Specified by:
getAnnotatableParents in interface Annotatable
Returns:
A set containing annotatable items, or null
Throws:
BaseException - If there is an error

getFileSet

public FileSet getFileSet()
Description copied from interface: FileStoreEnabled
Get the file set that collects all files that holds data for this item. If no file set exists a new one is created and automatically saved to the database when DbControl.commit() is called. To check if an item has files without creating a new file set use the FileStoreEnabled.hasFileSet() method.

Specified by:
getFileSet in interface FileStoreEnabled
Returns:
A file set
Since:
2.5

hasFileSet

public boolean hasFileSet()
Description copied from interface: FileStoreEnabled
Check if this item has a file set. Always call this method before FileStoreEnabled.getFileSet() to avoid creating a new file set when there is no need for it.

Specified by:
hasFileSet in interface FileStoreEnabled
Returns:
TRUE if a file set exists, FALSE if not
Since:
2.5

getPlatform

public Platform getPlatform()
Description copied from interface: FileStoreEnabled
Get the platform the item is related to. The platform is used to limit the DataFileType:s that can be added to the file set.

Specified by:
getPlatform in interface FileStoreEnabled
Returns:
A platform or null if the items is not related to any platform.
Since:
2.5

getVariant

public PlatformVariant getVariant()
Description copied from interface: FileStoreEnabled
Get the platform variant the item is related to. The platform is used to limit the DataFileType:s that can be added to the file set.

Specified by:
getVariant in interface FileStoreEnabled
Returns:
A platform or null if the items is not related to any variant.
Since:
2.5

getParentFileSets

public Collection<FileSet> getParentFileSets()
Get the file set from the array design, if it exists.

Specified by:
getParentFileSets in interface FileStoreEnabled
Returns:
A collection of FileSet or null
Since:
2.5

getEntryDate

public Date getEntryDate()
Description copied from interface: Registered
Get the date that the item was registered in the database.

Specified by:
getEntryDate in interface Registered
Returns:
A date or null if this is not known

isUsed

public boolean isUsed()
               throws BaseException
Check if:

Overrides:
isUsed in class BasicItem<RawBioAssayData>
Returns:
TRUE if this item is used, FALSE otherwise
Throws:
BaseException - If not able to tell if item is used or not.
See Also:
BasicItem.getUsingItems()

getUsingItems

public Set<ItemProxy> getUsingItems()
Get all:

onBeforeCommit

void onBeforeCommit(Transactional.Action action)
              throws BaseException
Delete raw data if it exists.

Overrides:
onBeforeCommit in class SharedItem<RawBioAssayData>
Throws:
BaseException - If there is another error
See Also:
Transactional, Core API overview - Transaction handling, Coding rules and guidelines for item classes

setProjectDefaults

void setProjectDefaults(Project activeProject)
                  throws BaseException
Set software, protocol and array design from project default settings.

Overrides:
setProjectDefaults in class BasicItem<RawBioAssayData>
Parameters:
activeProject - The currently active project
Throws:
BaseException
Since:
2.9

toTransferable

public RawBioAssayInfo toTransferable(RawBioAssayInfo info)
Description copied from interface: ToTransferable
Transfer the internal state to a transferable object. The method should return the same object that is passed in as an argument.

Specified by:
toTransferable in interface ToTransferable<RawBioAssayInfo>
Parameters:
info - The transferable object to use
Returns:
The transferable object with values set.
Since:
2.5

setPlatform

public void setPlatform(Platform platform,
                        RawDataType rawDataType)
Set the platform and raw data type of the raw bioassay. This method will set the variant to null. Use setVariant(PlatformVariant, RawDataType) if you want to set a specific variant. If the platform is locked to a raw data type, the rawDataType parameter is ignored. If the platform isn't locked the raw data type must be a database-based raw data type. Ie. RawDataType.isStoredInDb() must return true.

Parameters:
platform - The new platform, null is not allowes
rawDataType - The raw data type, required if the platform doesn't specify a raw data type
Throws:
PermissionDeniedException - If the logged in user doesn't have write permission
InvalidDataException - If platform is null or if the raw data type is not properly specified
Since:
2.5

setVariant

public void setVariant(PlatformVariant variant,
                       RawDataType rawDataType)
Set the platform and variant of the raw bioassay. This method will automatically set the platform to PlatformVariant.getPlatform(). If the platform variant is locked to a raw data type, the raw data type is also updated. The platform variant can't be changed if raw data has been imported to the database.

Parameters:
variant - The new platform variant
rawDataType - The rawdata type for this platform variant. Null is allowed if rawDataType already has been set.
Throws:
PermissionDeniedException - If the logged in user doesn't have write permission
InvalidDataException - If variant is null
Since:
2.5

isPlatform

public boolean isPlatform(String externalId)
Check if the platform/variant of this raw bioassay has the given external ID.

Parameters:
externalId - The external ID to match
Returns:
TRUE if either the variant of platform matches the external ID
Since:
2.5

isFileOnlyPlatform

public boolean isFileOnlyPlatform()
Check if this raw bioassay uses a file-only platform or variant. If the raw bioassay has a platform variant, the setting from the variant is returned, otherwise the setting from the platform.

Returns:
TRUE if this raw bioassay use a file-only variant / platform
Since:
2.5

getRawDataType

public RawDataType getRawDataType()
Get the raw data type this raw bioassay uses for the raw data. The raw data type cannot be changed once the raw bioassay has been created.

Returns:
A RawDataType object

setRawDataType

public void setRawDataType(RawDataType rawDataType)
                    throws PermissionDeniedException,
                           InvalidDataException
Deprecated. Use setPlatform(Platform, RawDataType) or setVariant(PlatformVariant, RawDataType) instead

Set the raw data type. The raw data type cannot be changed if raw data has been added to the database.

Parameters:
rawDataType - The raw data type, null is not allowed
Throws:
PermissionDeniedException - If the logged in user doesn't have write permission for the raw bioassay or spots has already been added
InvalidDataException

getJob

public Job getJob()
           throws PermissionDeniedException,
                  BaseException
Get the job that imported data to this raw bioassay.

Returns:
A Job object, ot null if this information is not available
Throws:
PermissionDeniedException - If the logged in user doesn't have read permission to the job
BaseException - If there is another error
Since:
2.7

getArrayNum

public int getArrayNum()
Get the hybridization array number this raw bioassay is linked to. The default value is 1.

Since:
2.6

setArrayNum

public void setArrayNum(int arrayNum)
Set the hybridization array number this raw bioassay is linked to. The value should be between 1 and the number of arrays specified by the hybridization, Hybridization.getNumArrays().

Parameters:
arrayNum - A value > 0
Throws:
NumberOutOfRangeException - If the value is <=0
Since:
2.6

getScan

public Scan getScan()
             throws PermissionDeniedException,
                    BaseException
Get the Scan this raw bioassay is created from.

Returns:
The Scan item or null if not known
Throws:
PermissionDeniedException - If the logged in user doesn't have read permission for the scanner
BaseException - If there is another error.

setScan

public void setScan(Scan scan)
             throws PermissionDeniedException
Set the Scan this raw bioassay is created from.

Parameters:
scan - The scan or null if not known
Throws:
PermissionDeniedException - If the logged in user doesn't have write permission for the raw bioassay use permission for the scan
BaseException - If there is another error

getSoftware

public Software getSoftware()
                     throws PermissionDeniedException,
                            BaseException
Get the Software used while analysing the scanned images.

Returns:
The Software item or null if not known
Throws:
PermissionDeniedException - If the logged in user doesn't have read permission for the software
BaseException - If there is another error.

setSoftware

public void setSoftware(Software software)
                 throws PermissionDeniedException
Set the Software used while analysing the scanned images.

Parameters:
software - The software or null if not known
Throws:
PermissionDeniedException - If the logged in user doesn't have write permission for the raw bioassay use permission for the scanner
BaseException - If there is another error

getProtocol

public Protocol getProtocol()
                     throws PermissionDeniedException,
                            BaseException
Get the Protocol used while analysing the scanned images.

Specified by:
getProtocol in interface Annotatable
Overrides:
getProtocol in class AnnotatedItem<RawBioAssayData>
Returns:
The Protocol item or null if not known
Throws:
PermissionDeniedException - If the logged in user doesn't have read permission for the protocol
BaseException - If there is another error.

setProtocol

public void setProtocol(Protocol protocol)
                 throws PermissionDeniedException
Set the Protocol used while analysing the scanned images.

Parameters:
protocol - The protocol or null if not known
Throws:
PermissionDeniedException - If the logged in user doesn't have write permission for the raw bioassay use permission for the protocol
BaseException - If there is another error

getArrayDesign

public ArrayDesign getArrayDesign()
                           throws PermissionDeniedException,
                                  BaseException
Get the ArrayDesign this raw data uses. This should normally be the same as the array design reached via the hybridization, but doesn't have to be.

Returns:
The ArrayDesign item or null if not known
Throws:
PermissionDeniedException - If the logged in user doesn't have read permission for the array design
BaseException - If there is another error.

setArrayDesign

public void setArrayDesign(ArrayDesign arrayDesign)
                    throws PermissionDeniedException
Set the ArrayDesign this raw data uses. The array design can't be changed with this method once raw data spots has been added. Use the updateArrayDesign(ArrayDesign, ProgressReporter) to do that.

Parameters:
arrayDesign - The ArrayDesign item or null if not known
Throws:
PermissionDeniedException - If the logged in user doesn't have write permission for the raw bioassay use permission for the array design or spots has already been added
BaseException - If there is another error

updateArrayDesign

public void updateArrayDesign(ArrayDesign arrayDesign,
                              ProgressReporter progress)
                       throws PermissionDeniedException,
                              InvalidDataException
Deprecated. Use updateArrayDesign(ArrayDesign, FeatureIdentificationMethod, ProgressReporter) instead

Throws:
PermissionDeniedException
InvalidDataException

updateArrayDesign

public void updateArrayDesign(ArrayDesign arrayDesign,
                              FeatureIdentificationMethod fiMethod,
                              ProgressReporter progress)
                       throws PermissionDeniedException,
                              InvalidDataException
Set the ArrayDesign this raw data uses. If data has already been imported to the raw bioassay, the reporters for each position on the new array design must match the positions of reporters already present in the raw bioassay.

Parameters:
arrayDesign - The ArrayDesign item or null if not known
fiMethod - The method to use for identifying features on the new array design. Use null to use the method choosen by the new array design. The FeatureIdentificationMethod.FEATURE_ID will not work unless the raw bioassay is already connected to an array design which has features with external ID:s
progress - An optional progress reporter
Throws:
PermissionDeniedException - If the logged in user doesn't have write permission for the raw bioassay use permission for the array design
InvalidDataException - If the features of the new array design doesn't match the raw data
BaseException - If there is another error
Since:
2.6

hasArrayDesign

public boolean hasArrayDesign()
Check if this raw bioassay is connected to an array design or not.

Returns:
TRUE if it has an array design, FALSE otherwise

getSpots

public int getSpots()
Deprecated. Use getNumDbSpots() or getNumFileSpots() instead. This method first checks the database and if not 0, it returns that value, otherwise it returns the number of file spots

Get the number of raw data spots that has been added to this raw bioassay.

Returns:
The number of spots

getNumDbSpots

public int getNumDbSpots()
Get the number of spots on this raw bioassay that are stored in the database.

Returns:
The number of spots in the database
Since:
2.5

getNumFileSpots

public int getNumFileSpots()
Get the number of spots on this raw bioassay that are stored inside files.

Returns:
The number of spots in files
Since:
2.5

setNumFileSpots

public void setNumFileSpots(int numSpots)
Set the number of spots that are stored in files.

Parameters:
numSpots - The number of spots
Since:
2.5

hasData

public boolean hasData()
If raw data has been added to this raw bioassay or not. Note that this method checks both data in the database and data in the form of files.


getSpotImages

public SpotImages getSpotImages()
                         throws PermissionDeniedException,
                                BaseException
Get the SpotImages item used to generate spot images for this raw bioassay. If no SpotImages exists a new one is created, and is automatically saved to the database (if commit is called).

Returns:
The SpotImages item
Throws:
PermissionDeniedException - If logged in user doesn't have read permission to the spot images.
BaseException - If there is some kind of error.
See Also:
hasSpotImages()

hasSpotImages

public boolean hasSpotImages()
Check if spot images exists for this raw bioassay or not.

See Also:
getSpotImages()

getHeader

public String getHeader(String name)
Get the value for the raw data header with the specified name.

Parameters:
name - The name of the header
Returns:
The value of the header or null if no header with that name exists

setHeader

public void setHeader(String name,
                      String value)
               throws PermissionDeniedException,
                      InvalidDataException
Set the value for a raw data header.

Parameters:
name - The name of the header
value - The value of the header
Throws:
PermissionDeniedException - If the logged in user doesn't have write permission or if spots already has been added to the raw bioassay
InvalidDataException - If the name or value is null or too long

removeHeaders

public void removeHeaders()
Remove all headers from the raw bioassay.

Since:
2.5

removeHeader

public void removeHeader(String name)
Remove a specific header from the raw bioassay.

Parameters:
name - The name of the header
Since:
2.5

getHeaderNames

public Set<String> getHeaderNames()
Get the names of all raw data headers. The set is sorted by name.

Returns:
A set containing the header names or an empty set if no headers have been defined

getExperiments

public ItemQuery<Experiment> getExperiments()
Get a query that returns all experiments where this raw bioassay is used.

Returns:
An ItemQuery object

getRawDataBatcher

public RawDataBatcher getRawDataBatcher()
                                 throws PermissionDeniedException,
                                        BaseException
Deprecated. Use getRawDataBatcher(FeatureIdentificationMethod, Job) instead

Throws:
PermissionDeniedException
BaseException

getRawDataBatcher

public RawDataBatcher getRawDataBatcher(FeatureIdentificationMethod fiMethod)
                                 throws PermissionDeniedException,
                                        BaseException
Deprecated. Use getRawDataBatcher(FeatureIdentificationMethod, Job) instead.

Throws:
PermissionDeniedException
BaseException
Since:
2.6

getRawDataBatcher

public RawDataBatcher getRawDataBatcher(FeatureIdentificationMethod fiMethod,
                                        Job job)
                                 throws PermissionDeniedException,
                                        BaseException
Get a raw data batcher object which can be used to add raw data to the raw bioassay.

Parameters:
fiMethod - The method to use for identifying features, or null to use the method choosen by the array design. This parameter has no meaning if the raw bioassay is not connected to an array design or if the array design has no features.
job - The job that is currently running, or null if the raw data import is not running as a job
Returns:
A RawDataBatcher object. If this method is called multiple times the fiMethod and job parameter is ignored and the same batcher as before is returned
Throws:
PermissionDeniedException - If raw data has already been added or the logged in user doesn't have write permission
BaseException - If there is another error
Since:
2.7

deleteRawData

public void deleteRawData()
                   throws PermissionDeniedException,
                          BaseException
Delete the raw data that has been added to the database for this raw bioassay. You should not call this method in the same transaction as adding raw data with the batcher from getRawDataBatcher().

Throws:
PermissionDeniedException - If the logged in user doesn't have write permission or a RawDataBatcher has been fetched using the getRawDataBatcher() method or the raw bioassay is used by some experiment
BaseException - If there is another error

getRawDataById

public RawData getRawDataById(int id)
                       throws ItemNotFoundException,
                              BaseException
Get a raw data spot when you know the id. NOTE! This method may return an uninitialized proxy. If an initialized object is required use getRawDataById(int, boolean) instead.

Parameters:
id - The id of the spot
Returns:
An RawData object
Throws:
ItemNotFoundException - If no raw data item was found for the given id.
BaseException - If there some other error.

getRawDataById

public RawData getRawDataById(int id,
                              boolean forceInitialization)
                       throws ItemNotFoundException,
                              BaseException
Get a raw data spot when you know the id.

Parameters:
id - The id of the spot
forceInitialization - If TRUE the raw data and associated feature and reporter are sure to be initialized
Returns:
An RawData object
Throws:
ItemNotFoundException - If no raw data item was found for the given id.
BaseException - If there some other error.
Since:
2.15

getRawData

public DataQuery<RawData> getRawData()
Get a query that returns the raw data of this raw bioassay.

Returns:
A DataQuery object

getReporters

public DataQuery<ReporterData> getReporters()
Get a query that returns the reporters on this raw bioassay. The query is rooted at the raw data, which means that:

Returns:
A DataQuery object
Since:
2.8

getDynamicRawData

public DynamicRawDataQuery getDynamicRawData()
Get a dynamic query that returns the raw data of this raw bioassay.

Returns:
A DynamicRawDataQuery object

validateFeatures

private void validateFeatures(DbControl dc,
                              ArrayDesign design,
                              FeatureIdentificationMethod fiMethod,
                              boolean update,
                              ProgressReporter progress)
Validate that the features/reporters of the raw data matches the features/reporter on the array design.

Parameters:
dc - The DbControl to use for database access
design - The array design to validate against
fiMethod - The method to use for identifying features, or null to use the method choosen by the array design
update - If the raw data should be linked to the new feature or not
progress - An optional progress reporter
Since:
2.6

2.17.2: 2011-06-17