Class ArraySlide

All Implemented Interfaces:
AccessControlled, Annotatable, Identifiable, Nameable, Ownable, Registered, Removable, Shareable

public class ArraySlide extends AnnotatedItem implements Registered
This class represents a physical microarray slide.
Version:
2.0
Author:
Nicklas, Enell
  • Field Details

    • TYPE

      public static final Item TYPE
      The type of item represented by this class.
      See Also:
    • MAX_BARCODE_LENGTH

      public static final int MAX_BARCODE_LENGTH
      The maximum length of the barcode that can be stored in the database. Check the length against this value before calling the setBarcode method to avoid exceptions.
      See Also:
  • Constructor Details

  • Method Details

    • getNew

      public static ArraySlide getNew(DbControl dc, ArrayBatch arrayBatch) throws PermissionDeniedException, BaseException
      Create a new ArraySlide item.
      Parameters:
      dc - The DbControl which will be used for permission checking and database access
      arrayBatch - The ArrayBatch this slide belongs to
      Returns:
      The new ArraySlide item
      Throws:
      PermissionDeniedException - If the logged in user doesn't have use permission for the array batch
      BaseException - If there is another error
    • getById

      Get a ArraySlide 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 ArraySlide 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
    • barcodeExists

      public static boolean barcodeExists(DbControl dc, String barcode)
      Checks if a slide with the given barcode already exists in the database. The check is done on ALL slides, even on those not normally accessible by the logged in user.
      Parameters:
      dc - The DbControl to use for database access
      barcode - The barcode to check
      Returns:
      TRUE if the barcode exists, FALSE if not or if the argument is NULL
      Since:
      2.7
    • getQuery

      public static ItemQuery<ArraySlide> getQuery()
      Get a ItemQuery object configured to retrieve array slides.
      Returns:
      An ItemQuery object
    • getData

      ArraySlideData getData()
      Description copied from class: BasicItem
      Get the BasicData object that holds all data for this item.
      Overrides:
      getData in class AnnotatedItem
    • 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 array batch.
      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
    • setEntryDate

      public void setEntryDate(Date entryDate)
      Description copied from interface: Registered
      Set the date the entry was registered in the database. Implementations should only allow this property to be set before the item is first stored in the database. The intention of this method is to facilitate export/import of data between server.
      Specified by:
      setEntryDate in interface Registered
      Parameters:
      entryDate - A date or null to use today's date
    • isUsed

      public boolean isUsed() throws BaseException
      Description copied from class: BasicItem
      Check if this item is used by some other item. With used we mean that another item is linking to this item in way that prevents this item from beeing deleted. Ie. if we tried to delete an item that is used, we would get a foreign key violation error from the database. If the subclass overrides this method it should propagate the call to the superclass, ie. super.isUsed(), unless it has decided that the item is used by some other means.
      Overrides:
      isUsed in class BasicItem
      Returns:
      TRUE if this item is used, FALSE otherwise
      Throws:
      BaseException - If not able to tell if item is used or not.
      See Also:
    • getUsingItems

      public Set<ItemProxy> getUsingItems() throws BaseException
      Get the bioassay that was used on this plate.
      Overrides:
      getUsingItems in class BasicItem
      Returns:
      A set containing proxies for the items, or an empty set if no items are using this item
      Throws:
      BaseException - If there is an error loading the items
      Since:
      2.2
      See Also:
    • getBatchIndex

      public int getBatchIndex()
      Get the index of this slide in the batch.
      Returns:
      The index of the slide
    • setBatchIndex

      public void setBatchIndex(int batchIndex) throws PermissionDeniedException
      Set the index of this slide in the batch.
      Parameters:
      batchIndex - The index of the slide in the batch
      Throws:
      PermissionDeniedException - This exception is thrown if the logged in user doesn't have write permission.
    • getBarcode

      public String getBarcode()
      Get the barcode of the slide.
      Returns:
      A string with the barcode sequence
    • setBarcode

      public void setBarcode(String barcode) throws PermissionDeniedException, InvalidDataException
      Set the barcode for the slide. The value can be null and must not be longer than the value specified by the MAX_BARCODE_LENGTH constant.
      Parameters:
      barcode - The new barcode for the slide
      Throws:
      PermissionDeniedException - If the logged in user doesn't have write permission
      InvalidDataException - This exception is thrown if the barcode is longer than MAX_BARCODE_LENGTH
    • isDestroyed

      public boolean isDestroyed()
      Check if the slide is flagged as destroyed or not. A destroyed slide may not be connected to a hybridization.
      Returns:
      TRUE if the slide is destroyed, FALSE otherwise
    • setDestroyed

      public void setDestroyed(boolean destroyed) throws PermissionDeniedException
      Set if the slide should be flagged as destroyed. A destroyed slide may not be connected to a hybridization.
      Parameters:
      destroyed - true if the slide should be flagged as destroyed, false otherwise
      Throws:
      PermissionDeniedException - If the logged in user doesn't have write permission
    • getArrayBatch

      public ArrayBatch getArrayBatch() throws PermissionDeniedException, BaseException
      Get the ArrayBatch item to which this slide belongs.
      Returns:
      The ArrayBatch item
      Throws:
      PermissionDeniedException - If the logged in user doesn't have read permission for the array batch
      BaseException - If there is another error
    • setArrayBatch

      private void setArrayBatch(ArrayBatch arrayBatch) throws InvalidDataException, PermissionDeniedException
      Set the ArrayBatch this arrayslide belongs to.
      Parameters:
      arrayBatch - the arrayBatch to be set. Cannot be null.
      Throws:
      InvalidDataException - If the arrayBatch is null
      PermissionDeniedException - If the logged in user doesn't have use permission for the batch
    • getPhysicalBioAssay

      public PhysicalBioAssay getPhysicalBioAssay() throws PermissionDeniedException, BaseException
      Get the PhysicalBioAssay item which was used on this slide. To set, use the PhysicalBioAssay.setArraySlide(ArraySlide) method.
      Returns:
      The PhysicalBioAssay item, or null
      Throws:
      PermissionDeniedException - This exception is thrown if the logged in user doesn't have read permission to the item
      BaseException - If there is another error
      Since:
      3.0
    • isUsedByOther

      public boolean isUsedByOther(PhysicalBioAssay pba)
      Checks if this array slide is used by a different bioassay than the given one.
      Parameters:
      pba - The bioassay to check, or null to check if the slide is used by any bioassay
      Returns:
      TRUE if the slide is used by a different bioassay, or FALSE if it is used by the given bioassay, or not used at all
      Since:
      2.8.3