public class Sample extends MeasuredBioMaterial
BioSource
. A sample
can also be created by combining other samples into a new sample.
A process is known as pooling. It is also possible to create
standalone samples, with no reference to a biosource or to other
samples.MeasuredBioMaterial.RemainingQuantityAction
Modifier and Type | Field and Description |
---|---|
static Item |
TYPE
The type of item represented by this class.
|
MAX_EXTERNAL_ID_LENGTH
MAX_DESCRIPTION_LENGTH, MAX_NAME_LENGTH
Constructor and Description |
---|
Sample(SampleData sampleData) |
Modifier and Type | Method and Description |
---|---|
long |
countChildren(boolean samples)
Count the number of child samples or extracts.
|
long |
countExtracts()
Counts all extracts that have been created from this sample.
|
long |
countSamples()
Counts all samples that have been created from this sample.
|
static Sample |
getById(DbControl dc,
int id)
Get an
Sample item when you know the id. |
ItemQuery<Sample> |
getChildSamples()
Creates a query that returns all child (pooled) samples that
has this sample as one of it's sources.
|
(package private) SampleData |
getData()
Get the
BasicData object that holds all data for this item. |
ItemQuery<Extract> |
getExtracts()
Get a query that returns all extracts created from this sample.
|
ItemSubtype |
getItemSubtype()
Get the subtype of the item.
|
static Sample |
getNew(DbControl dc)
Create a new
Sample item. |
static Sample |
getNew(DbControl dc,
BioPlateEventParticipant master)
Create a new
Sample item as part of a
master bioplate event. |
static ItemQuery<Sample> |
getQuery()
Get a query that returns samples.
|
Item |
getType()
Get the type of item represented by the object.
|
Set<ItemProxy> |
getUsingItems()
Get all:
Extract :s created from this sample
Pooled samples
|
boolean |
isUsed()
|
Extract |
newExtract(Float usedQuantity)
Create a new
Extract from this sample. |
Extract |
newExtract(Float usedQuantity,
BioPlateEventParticipant master)
Create a new
Extract from this sample as part of a
master bioplate event. |
getAnnotatableParents, getAnnotatableParents, getBioWell, getCreationEvent, getEntryDate, getEvents, getOriginalQuantity, getParent, getParentType, getProtocol, getRemainingQuantity, hasSingleParent, isInWell, isLockedInWell, newEvent, newEvent, onBeforeCommit, setBioPlateEventParticipant, setBioWell, setOriginalQuantity, updateRemainingQuantity
getChildCreationEvents, getExternalId, setExternalId, setItemSubtype
getAnnotationSet, isAnnotated, removeAnnotations
getDescription, getName, getRemovedBy, isRemoved, setDescription, setName, setRemoved
getItemKey, getProjectKey, initPermissions, isShared, setItemKey, setProjectKey
getOwner, isOwner, setOwner, takeOwnership
addAnnotatableParents, addUsingItems, addUsingItems, checkPermission, equals, getBasicData, getDbControl, getId, getPermissions, getPluginPermissions, getSessionControl, getVersion, hashCode, hasPermission, isDetached, isInDatabase, onAfterCommit, onAfterInsert, onRollback, setDbControl, setProjectDefaults, toString, validate
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getId, getVersion
checkPermission, getPermissions, hasPermission
getDescription, getName, setDescription, setName
getOwner, isOwner, setOwner, takeOwnership
public static final Item TYPE
Item.SAMPLE
,
getType()
Sample(SampleData sampleData)
public static Sample getNew(DbControl dc) throws BaseException
Sample
item.dc
- The DbControl
which will be used for
permission checking and database accessSample
itemBaseException
- If there is an errorpublic static Sample getNew(DbControl dc, BioPlateEventParticipant master) throws BaseException
Sample
item as part of a
master bioplate event.dc
- The DbControl
which will be used for
permission checking and database accessmaster
- The master bioplate event participant or nullSample
itemBaseException
- If there is an errorpublic static Sample getById(DbControl dc, int id) throws ItemNotFoundException, PermissionDeniedException, BaseException
Sample
item when you know the id.dc
- The DbControl
which will be used for
permission checking and database access.id
- The id of the item to loadSample
itemItemNotFoundException
- 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 errorpublic static ItemQuery<Sample> getQuery()
ItemQuery
objectSampleData getData()
BasicItem
BasicData
object that holds all data for this item.getData
in class MeasuredBioMaterial
public Item getType()
Identifiable
Item
enumeration.@SupportsPushAnnotations @SubtypableRelatedItems(value={PROTOCOL,KIT,HARDWARE,BIOSOURCE,SAMPLE}) public ItemSubtype getItemSubtype()
Subtypable
getItemSubtype
in interface Subtypable
getItemSubtype
in class MeasuredBioMaterial
SubtypableRelatedItems
public boolean isUsed() throws BaseException
isUsed
in class MeasuredBioMaterial
BaseException
- If not able to tell if item is used or not.BasicItem.getUsingItems()
public Set<ItemProxy> getUsingItems()
Extract
:s created from this sample
getUsingItems
in class MeasuredBioMaterial
BasicItem.addUsingItems(Set, Item, org.hibernate.Query)
public Extract newExtract(Float usedQuantity) throws PermissionDeniedException, BaseException
Extract
from this sample.usedQuantity
- The quantity used from this sample or null
if not knownExtract
itemPermissionDeniedException
- If the logged in user doesn't have
use permission for this sampleBaseException
- If there is another errorpublic Extract newExtract(Float usedQuantity, BioPlateEventParticipant master) throws PermissionDeniedException, BaseException
Extract
from this sample as part of a
master bioplate event.usedQuantity
- The quantity used from this sample or null
if not knownmaster
- The master bioplate event participant or nullExtract
itemPermissionDeniedException
- If the logged in user doesn't have
use permission for this sampleBaseException
- If there is another errorpublic ItemQuery<Extract> getExtracts() throws BaseException
ItemQuery
objectBaseException
- If the query couldn't be created.public ItemQuery<Sample> getChildSamples()
public long countExtracts() throws BaseException
BaseException
- If there is some kind of error.public long countSamples() throws BaseException
BaseException
- If there is some kind of error.public long countChildren(boolean samples)
countChildren
in class BioMaterial
samples
- TRUE = count child samples, FALSE = count child extracts