Class Extract

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

public class Extract
extends MeasuredBioMaterial
This class is used to represent extract items. An extract is created from a Sample or by combining other extracts (pooling). It is also possible to create standalone extracts, with no reference to a sample or to other extracts.
Version:
2.0
Author:
Nicklas
Last modified
$Date: 2019-02-06 10:41:56 +0100 (ons, 06 feb. 2019) $
  • Field Details

    • TYPE

      public static final Item TYPE
      The type of item represented by this class.
      See Also:
      Item.EXTRACT, getType()
    • LABELED

      public static final String LABELED
      The id for the ExtractType item representing a labeled extract.
      Since:
      3.0
      See Also:
      Constant Field Values
    • LIBRARY

      public static final String LIBRARY
      The id for the ExtractType item representing a library.
      Since:
      3.0
      See Also:
      Constant Field Values
  • Constructor Details

  • Method Details

    • getNew

      public static Extract getNew​(DbControl dc) throws BaseException
      Create a new Extract item.
      Parameters:
      dc - The DbControl which will be used for permission checking and database access
      Returns:
      The new Extract item
      Throws:
      BaseException - If there is an error
    • getNew

      public static Extract getNew​(DbControl dc, BioPlateEventParticipant master) throws BaseException
      Create a new Extract item as part of a master bioplate event.
      Parameters:
      dc - The DbControl which will be used for permission checking and database access
      master - The master bioplate event participant or null
      Returns:
      The new Extract item
      Throws:
      BaseException - If there is an error
      Since:
      2.17
    • getById

      public static Extract getById​(DbControl dc, int id) throws ItemNotFoundException, PermissionDeniedException, BaseException
      Get an Extract item 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 Extract 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<Extract> getQuery()
      Get a query that returns extracts.
      Returns:
      An ItemQuery object.
    • getData

      ExtractData getData()
      Description copied from class: BasicItem
      Get the BasicData object that holds all data for this item.
      Overrides:
      getData in class MeasuredBioMaterial
    • 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.
      Returns:
      A value indicating the type of item
    • getItemSubtype

      Description copied from interface: Subtypable
      Get the subtype of the item.
      Specified by:
      getItemSubtype in interface Subtypable
      Overrides:
      getItemSubtype in class MeasuredBioMaterial
      Returns:
      A subtype of null if not set
      See Also:
      SubtypableRelatedItems
    • isUsed

      public boolean isUsed() throws BaseException
      Check that:
      Overrides:
      isUsed in class MeasuredBioMaterial
      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:
      Overrides:
      getUsingItems in class MeasuredBioMaterial
      Returns:
      A set containing proxies for the items, or an empty set if no items are using this item
      Since:
      2.2
      See Also:
      BasicItem.addUsingItems(Set, Item, org.hibernate.query.Query)
    • getTag

      public Tag getTag()
      Get the tag that has been applied to this extract in order to be able to distinguish it from other extracts on a physical bioassay.
      Returns:
      A tag or null if the extract is not tagged
      Since:
      3.0
    • setTag

      public void setTag​(Tag tag)
      Set the tag that was applied to this extract in order to be able to distinguish it from other extracts on a physical bioassay.
      Parameters:
      tag - The tag, or null if the extract is not tagged
      Since:
      3.0
    • getChildExtracts

      public ItemQuery<Extract> getChildExtracts()
      Creates a query that returns all child (pooled) extracts that has this extracts as one of it's sources.
      Returns:
      A query
      Since:
      2.10
    • countExtracts

      public long countExtracts() throws BaseException
      Counts all extracts that have been created from this extract. The count includes extracts that the logged in user doesn't have access to.
      Returns:
      The number of extracts
      Throws:
      BaseException - If there is some kind of error.
      Since:
      2.16
    • countChildren

      public long countChildren​(boolean extractsOnly)
      Count the number of child extracts. Since an extract can only have other extracts as children, this method always return 0 if extractsOnly = false.
      Specified by:
      countChildren in class BioMaterial
      Parameters:
      extractsOnly - If TRUE, the count is for biomaterials of the same type, if FALSE the count is for biomaterials of the child type
      Since:
      2.16
    • getPhysicalBioAssays

      public ItemQuery<PhysicalBioAssay> getPhysicalBioAssays()
      Get a query that returns all bioassays created from this extract.
      Returns:
      An ItemQuery object
    • getDerivedBioAssays

      public ItemQuery<DerivedBioAssay> getDerivedBioAssays()
      Get a query that returns all derived bioassays created from this extract.
      Returns:
      An ItemQuery object
      Since:
      3.14.1
    • getRawBioAssays

      public ItemQuery<RawBioAssay> getRawBioAssays()
      Get a query that returns all raw bioassays created from this extract.
      Returns:
      An ItemQuery object
      Since:
      3.14.1
    • getAnnotatableParents

      public Set<Annotatable> getAnnotatableParents() throws BaseException
      Get the tag and parent extracts.
      Specified by:
      getAnnotatableParents in interface Annotatable
      Overrides:
      getAnnotatableParents in class MeasuredBioMaterial
      Returns:
      A set containing annotatable items, or null
      Throws:
      BaseException - If there is an error