Package net.sf.basedb.core
Class Extract
- All Implemented Interfaces:
AccessControlled
,Annotatable
,Identifiable
,Listable
,Nameable
,Ownable
,Registered
,Removable
,Shareable
,Subtypable
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) $
-
Nested Class Summary
Nested classes/interfaces inherited from class net.sf.basedb.core.MeasuredBioMaterial
MeasuredBioMaterial.RemainingQuantityAction
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The id for theExtractType
item representing a labeled extract.static final String
The id for theExtractType
item representing a library.static final Item
The type of item represented by this class.Fields inherited from class net.sf.basedb.core.BioMaterial
MAX_EXTERNAL_ID_LENGTH
Fields inherited from interface net.sf.basedb.core.Nameable
MAX_DESCRIPTION_LENGTH, MAX_NAME_LENGTH
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionlong
countChildren
(boolean extractsOnly) Count the number of child extracts.long
Counts all extracts that have been created from this extract.Get the tag and parent extracts.static Extract
Get anExtract
item when you know the id.Creates a query that returns all child (pooled) extracts that has this extracts as one of it's sources.(package private) ExtractData
getData()
Get theBasicData
object that holds all data for this item.Get a query that returns all derived bioassays created from this extract.Get the subtype of the item.static Extract
Create a newExtract
item.static Extract
getNew
(DbControl dc, BioPlateEventParticipant master) Create a newExtract
item as part of a master bioplate event.Get a query that returns all bioassays created from this extract.getQuery()
Get a query that returns extracts.Get a query that returns all raw bioassays created from this extract.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.getType()
Get the type of item represented by the object.Get all: Child extracts created from the extractPhysicalBioAssay
:s created from this extractDerivedBioAssay
:s referencing the extractRawBioAssay
:s referencing the extractboolean
isUsed()
Check that: noPhysicalBioAssay
:s has been created from this item noExtract
:s has been created from this item noDerivedBioAssay
is referencing this item noRawBioAssay
is referencing this itemvoid
Set the tag that was applied to this extract in order to be able to distinguish it from other extracts on a physical bioassay.Methods inherited from class net.sf.basedb.core.MeasuredBioMaterial
breakCircularReferences, getAnnotatableParents, getBioWell, getCreationEvent, getEntryDate, getEvents, getOriginalQuantity, getParent, getParentType, getProtocol, getRemainingQuantity, hasSingleParent, isInWell, isLockedInWell, newEvent, newEvent, onBeforeCommit, setBioPlateEventParticipant, setBioWell, setEntryDate, setOriginalQuantity, updateRemainingQuantity
Methods inherited from class net.sf.basedb.core.BioMaterial
getChildCreationEvents, getExternalId, setExternalId, setItemSubtype
Methods inherited from class net.sf.basedb.core.AnnotatedItem
getAnnotationSet, isAnnotated, removeAnnotations
Methods inherited from class net.sf.basedb.core.CommonItem
getDescription, getName, getRemovedBy, isRemoved, setDescription, setName, setRemoved
Methods inherited from class net.sf.basedb.core.SharedItem
getItemKey, getProjectKey, initPermissions, isShared, setItemKey, setProjectKey
Methods inherited from class net.sf.basedb.core.OwnedItem
getOwner, isOwner, setOwner, takeOwnership
Methods inherited from class net.sf.basedb.core.BasicItem
addAnnotatableParents, addUsingItems, addUsingItems, checkBatchAnnotatableUsage, checkPermission, equals, getBasicData, getDbControl, getId, getPermissions, getPluginPermissions, getSessionControl, getVersion, hashCode, hasPermission, isDetached, isInDatabase, onAfterCommit, onAfterInsert, onRollback, setDbControl, setProjectDefaults, toString, validate
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.sf.basedb.core.AccessControlled
checkPermission, getPermissions, hasPermission
Methods inherited from interface net.sf.basedb.core.Identifiable
getId, getVersion
Methods inherited from interface net.sf.basedb.core.Nameable
getDescription, getName, setDescription, setName
Methods inherited from interface net.sf.basedb.core.Ownable
getOwner, isOwner, setOwner, takeOwnership
-
Field Details
-
TYPE
The type of item represented by this class.- See Also:
-
LABELED
The id for theExtractType
item representing a labeled extract.- Since:
- 3.0
- See Also:
-
LIBRARY
The id for theExtractType
item representing a library.- Since:
- 3.0
- See Also:
-
-
Constructor Details
-
Extract
Extract(ExtractData extractData)
-
-
Method Details
-
getNew
Create a newExtract
item.- Parameters:
dc
- TheDbControl
which will be used for permission checking and database access- Returns:
- The new
Extract
item - Throws:
BaseException
- If there is an error
-
getNew
Create a newExtract
item as part of a master bioplate event.- Parameters:
dc
- TheDbControl
which will be used for permission checking and database accessmaster
- 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 anExtract
item when you know the id.- Parameters:
dc
- TheDbControl
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 foundPermissionDeniedException
- If the logged in user doesn't have read permission to the itemBaseException
- If there is another error
-
getQuery
Get a query that returns extracts.- Returns:
- An
ItemQuery
object.
-
getData
ExtractData getData()Description copied from class:BasicItem
Get theBasicData
object that holds all data for this item.- Overrides:
getData
in classMeasuredBioMaterial
-
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 theItem
enumeration.- Returns:
- A value indicating the type of item
-
getItemSubtype
@SupportsPushAnnotations @SubtypableRelatedItems({PROTOCOL,KIT,HARDWARE,TAG,SAMPLE,EXTRACT}) public ItemSubtype getItemSubtype()Description copied from interface:Subtypable
Get the subtype of the item.- Specified by:
getItemSubtype
in interfaceSubtypable
- Overrides:
getItemSubtype
in classMeasuredBioMaterial
- Returns:
- A subtype of null if not set
- See Also:
-
isUsed
Check that:- no
PhysicalBioAssay
:s has been created from this item - no
Extract
:s has been created from this item - no
DerivedBioAssay
is referencing this item - no
RawBioAssay
is referencing this item
- Overrides:
isUsed
in classMeasuredBioMaterial
- Returns:
- TRUE if this item is used, FALSE otherwise
- Throws:
BaseException
- If not able to tell if item is used or not.- See Also:
- no
-
getUsingItems
Get all:- Child extracts created from the extract
PhysicalBioAssay
:s created from this extractDerivedBioAssay
:s referencing the extractRawBioAssay
:s referencing the extract
- Overrides:
getUsingItems
in classMeasuredBioMaterial
- Returns:
- A set containing proxies for the items, or an empty set if no items are using this item
- Since:
- 2.2
- See Also:
-
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
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
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
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 classBioMaterial
- 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
Get a query that returns all bioassays created from this extract.- Returns:
- An
ItemQuery
object
-
getDerivedBioAssays
Get a query that returns all derived bioassays created from this extract.- Returns:
- An
ItemQuery
object - Since:
- 3.14.1
-
getRawBioAssays
Get a query that returns all raw bioassays created from this extract.- Returns:
- An
ItemQuery
object - Since:
- 3.14.1
-
getAnnotatableParents
Get the tag and parent extracts.- Specified by:
getAnnotatableParents
in interfaceAnnotatable
- Overrides:
getAnnotatableParents
in classMeasuredBioMaterial
- Returns:
- A set containing annotatable items, or null
- Throws:
BaseException
- If there is an error
-