2.17.2: 2011-06-17

net.sf.basedb.core
Class Scan

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<ScanData>
                      extended by net.sf.basedb.core.Scan
All Implemented Interfaces:
AccessControlled, Annotatable, Identifiable, Nameable, Ownable, Registered, Removable, Shareable

public class Scan
extends AnnotatedItem<ScanData>
implements Registered

A scan represents the scanning of a Hybridization by some scanner. A single hybridization may be scanned multiple times by the same or different scanner.

A single scan normally produces one or more Image:s which are analysed by some software to produce a RawBioAssay.

Version:
2.0
Author:
Nicklas
Last modified
$Date: 2009-04-06 14:52:39 +0200 (Mon, 06 Apr 2009) $

Field Summary
private  boolean protocolHasBeenSet
           
private  boolean scannerHasBeenSet
           
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
Scan(ScanData data)
           
 
Method Summary
 long countImages()
          Counts all images that have been added to this scan.
 long countRawBioAssays()
          Counts all raw bioassays that have been created from this scan.
 Set<Annotatable> getAnnotatableParents()
          Get the hybridization.
 ArrayDesign getArrayDesign()
          Get the array design by connected to this scan following the hybridization to the array slide to the array batch to the array design.
static Scan getById(DbControl dc, int id)
          Get a Scan object when you know the id.
 Date getEntryDate()
          Get the date that the item was registered in the database.
 Hybridization getHybridization()
          Get the Hybridization this scan is created from.
 ItemQuery<Image> getImages()
          Get a query that returns all images for this scan.
static Scan getNew(DbControl dc, Hybridization hybridization)
          Create a new Scan item.
 Protocol getProtocol()
          Get the Protocol used to create this scan.
static ItemQuery<Scan> getQuery()
          Get a query that returns scans.
 ItemQuery<RawBioAssay> getRawBioAssays()
          Get a query that returns all raw bioassays created from this scan.
 Hardware getScanner()
          Get the Hardware (scanner) used to create this scan.
 Item getType()
          Get the type of item represented by the object.
 Set<ItemProxy> getUsingItems()
          Get all: RawBioAssay:s created from this scan
 boolean isUsed()
          Check if: A RawBioAssay has been created from this scan
 Image newImage()
          Create a new Image for this scan.
 RawBioAssay newRawBioAssay(RawDataType rawDataType)
          Deprecated. Use RawBioAssay.getNew(DbControl, Platform, RawDataType) or RawBioAssay.getNew(DbControl, PlatformVariant, RawDataType) instead
 void setHybridization(Hybridization hybridization)
          Set the ArraySlide this hybridization is using.
(package private)  void setProjectDefaults(Project activeProject)
          Set scanner and protocol from project default settings.
 void setProtocol(Protocol protocol)
          Set the Protocol used to create this scan.
 void setScanner(Hardware scanner)
          Set the Hardware (scanner) used to create this scan.
 
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, onBeforeCommit, 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.Identifiable
getId, getVersion
 
Methods inherited from interface net.sf.basedb.core.AccessControlled
checkPermission, getPermissions, hasPermission
 
Methods inherited from interface net.sf.basedb.core.Ownable
getOwner, isOwner, setOwner, takeOwnership
 

Field Detail

TYPE

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

See Also:
Item.SCAN, getType()

scannerHasBeenSet

private boolean scannerHasBeenSet

protocolHasBeenSet

private boolean protocolHasBeenSet
Constructor Detail

Scan

Scan(ScanData data)
Method Detail

getNew

public static Scan getNew(DbControl dc,
                          Hybridization hybridization)
                   throws PermissionDeniedException,
                          BaseException
Create a new Scan item.

Parameters:
dc - The DbControl which will be used for permission checking and database access
hybridization - The hybridization the scan originates from
Returns:
The new Scan item
Throws:
PermissionDeniedException - If the logged in user doesn't have use permission for the hybridization
BaseException - If there is an error

getById

public static Scan getById(DbControl dc,
                           int id)
                    throws ItemNotFoundException,
                           PermissionDeniedException,
                           BaseException
Get a Scan 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 Scan 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<Scan> getQuery()
Get a query that returns scans.

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

getAnnotatableParents

public Set<Annotatable> getAnnotatableParents()
                                       throws BaseException
Get the hybridization.

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

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<ScanData>
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:

setProjectDefaults

void setProjectDefaults(Project activeProject)
                  throws BaseException
Set scanner and protocol from project default settings.

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

getHybridization

public Hybridization getHybridization()
                               throws PermissionDeniedException,
                                      BaseException
Get the Hybridization this scan is created from. A scan must always have a hybridization.

Returns:
The Hybridization item
Throws:
PermissionDeniedException - If the logged in user doesn't have read permission for the hybridization
BaseException - If there is another error.

setHybridization

public void setHybridization(Hybridization hybridization)
                      throws InvalidDataException,
                             PermissionDeniedException
Set the ArraySlide this hybridization is using.

Parameters:
hybridization - The hybridization, null is not allowed
Throws:
InvalidDataException - If the hybridization is null
PermissionDeniedException - If the logged in user doesn't have write permission for the scan use permission for the hybridization
BaseException - If there is another error

getScanner

public Hardware getScanner()
                    throws PermissionDeniedException,
                           BaseException
Get the Hardware (scanner) used to create this scan.

Returns:
The Hardware 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.

setScanner

public void setScanner(Hardware scanner)
                throws PermissionDeniedException
Set the Hardware (scanner) used to create this scan.

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

getProtocol

public Protocol getProtocol()
                     throws PermissionDeniedException,
                            BaseException
Get the Protocol used to create this scan.

Specified by:
getProtocol in interface Annotatable
Overrides:
getProtocol in class AnnotatedItem<ScanData>
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 to create this scan.

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

getArrayDesign

public ArrayDesign getArrayDesign()
                           throws PermissionDeniedException,
                                  BaseException
Get the array design by connected to this scan following the hybridization to the array slide to the array batch to the array design.

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

newRawBioAssay

public RawBioAssay newRawBioAssay(RawDataType rawDataType)
                           throws PermissionDeniedException,
                                  BaseException
Deprecated. Use RawBioAssay.getNew(DbControl, Platform, RawDataType) or RawBioAssay.getNew(DbControl, PlatformVariant, RawDataType) instead

Create a new RawBioAssay from this scan.

Parameters:
rawDataType - The raw data type of the new bioassay
Returns:
The new RawBioAssay item
Throws:
PermissionDeniedException - If the logged in user doesn't have use permission for the scan
BaseException - If there is another error

getRawBioAssays

public ItemQuery<RawBioAssay> getRawBioAssays()
Get a query that returns all raw bioassays created from this scan.

Returns:
An ItemQuery object

countRawBioAssays

public long countRawBioAssays()
                       throws BaseException
Counts all raw bioassays that have been created from this scan. The count includes raw bioassays that the logged in user doesn't have access to.

Returns:
The number of raw bioassays
Throws:
BaseException - If the raw bioassays couldn't be counted.

newImage

public Image newImage()
               throws PermissionDeniedException,
                      BaseException
Create a new Image for this scan.

Returns:
The new Image item
Throws:
PermissionDeniedException - If the logged in user doesn't have write permission
BaseException - If there is another error

getImages

public ItemQuery<Image> getImages()
Get a query that returns all images for this scan.

Returns:
An ItemQuery object

countImages

public long countImages()
                 throws BaseException
Counts all images that have been added to this scan. The count includes images that the logged in user doesn't have access to.

Returns:
The number of images
Throws:
BaseException - If the images couldn't be created.

2.17.2: 2011-06-17