public class Protocol extends AnnotatedItem<ProtocolData> implements FileAttachable, Registered, Subtypable
Modifier and Type | Field and Description |
---|---|
static String |
ALIGNMENT
The ID for the alignment protocol type, for example a protocol
used when creating a
DerivedBioAssay representing data that has been
aligned against a reference genome. |
static String |
CLUSTER_GENERATION
The ID for the cluster generation (in a flow cell) protocol type, for example
a protocol used when creating a
PhysicalBioAssay . |
static String |
EXTRACTION
|
static String |
FEATURE_EXTRACTION
The ID for the feature extraction protocol type, for example a
protocol used for analysing one or more images to create a raw
data file.
|
static String |
HYBRIDIZATION
The ID for the hybridization protocol type, for example a protocol
used when creating a
PhysicalBioAssay from a set of
(labeled) Extract :s. |
static String |
LABELING
The ID for the labeling protocol type, for example a protocol
used when creating a labeled extract from an
Extract . |
static String |
LIBRARY_PREPARATION
The ID for the library preparation protocol type, for example a protocol
used when creating a library extract from an
Extract . |
static int |
MAX_EXTERNAL_ID_LENGTH
The maximum length of the external id that can be stored in the database.
|
static String |
POOLING
|
static String |
PRINTING
The ID for the printing protocol type, for example a protocol
used when printing a batch of array slides using a print robot.
|
static String |
SAMPLING
|
static String |
SCANNING
The ID for the scanning protocol type, for example a protocol
used for scanning the microarray slide after an experiment.
|
static String |
SEQUENCING
The ID for the sequencing protocol type, for example a protocol
used when creating a
DerivedBioAssay from a PhysicalBioAssay |
static Item |
TYPE
The type of item represented by this class.
|
MAX_DESCRIPTION_LENGTH, MAX_NAME_LENGTH
Constructor and Description |
---|
Protocol(ProtocolData data)
Creates a new protocol item.
|
Modifier and Type | Method and Description |
---|---|
void |
addParameter(AnnotationType annotationType)
Add an annotation type as a parameter to this protocol.
|
Set<Annotatable> |
getAnnotatableParents()
Get all parents objects which are annotatable and the logged in
user has read permission to.
|
static Protocol |
getById(DbControl dc,
int id)
Get a
Protocol item when you know the ID. |
static String |
getDefaultSystemId(Item itemType)
Get the system id for the protocol subtype that should be used on an item
that doesn't have a subtype.
|
Date |
getEntryDate()
Get the date that the item was registered in the database.
|
String |
getExternalId()
Get the external id of the protocol.
|
File |
getFile()
Get the file that is attached to the item.
|
ItemSubtype |
getItemSubtype()
Get the subtype of the item.
|
static Protocol |
getNew(DbControl dc)
Create a new
Protocol item. |
ItemQuery<AnnotationType> |
getParameters()
Get a query that returns all annotation types used as parameters
for this protocol.
|
static ItemQuery<Protocol> |
getQuery()
Get a query configured to retrieve protocols.
|
Item |
getType()
Get the type of item represented by the object.
|
Set<ItemProxy> |
getUsingItems()
Get all:
a
BioMaterial :s and PhysicalBioAssay :s using this protocol
a Plate :s using this protocol
an ArrayBatch :s using this protocol
a DerivedBioAssay :s using this protocol
a RawBioAssay :s using this protocol
|
boolean |
isParameter(Annotation annotation)
Check if the annotation is parameter to this protocol.
|
boolean |
isParameter(AnnotationType annotationType)
Check if the annotation type is a parameter to this protocol.
|
boolean |
isUsed()
Check if this protocol is used by:
a
BioMaterialEvent
a PlateEvent
an ArrayBatch
a DerivedBioAssay
a RawBioAssay
|
void |
removeParameter(AnnotationType annotationType)
Remove an annotation type from the parameters for this protocol.
|
void |
setExternalId(String externalId)
Set the external id of the protocol.
|
void |
setFile(File file)
Attach a file to the item.
|
void |
setItemSubtype(ItemSubtype subtype)
Set the subtype on the item.
|
getAnnotationSet, getProtocol, isAnnotated, removeAnnotations, toTransferable
getDescription, getName, isRemoved, setDescription, setName, setRemoved, toTransferable
getItemKey, getProjectKey, initPermissions, isShared, onBeforeCommit, setItemKey, setProjectKey, toTransferable
getOwner, isOwner, setOwner, takeOwnership, toTransferable
addUsingItems, addUsingItems, checkPermission, equals, getData, getDbControl, getId, getPermissions, getPluginPermissions, getSessionControl, getVersion, hashCode, hasPermission, isDetached, isInDatabase, onAfterCommit, onAfterInsert, onRollback, setDbControl, setProjectDefaults, toString, toTransferable, validate
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getId, getVersion
checkPermission, getPermissions, hasPermission
getOwner, isOwner, setOwner, takeOwnership
public static final Item TYPE
Item.PROTOCOL
,
getType()
public static final String SAMPLING
Sample
from a BioSource
.public static final String EXTRACTION
Extract
from a Sample
.public static final String LABELING
Extract
.public static final String LIBRARY_PREPARATION
Extract
.public static final String POOLING
Sample
or
Extract
) from a set of other biomaterial items.public static final String HYBRIDIZATION
PhysicalBioAssay
from a set of
(labeled) Extract
:s.public static final String CLUSTER_GENERATION
PhysicalBioAssay
.public static final String SEQUENCING
DerivedBioAssay
from a PhysicalBioAssay
public static final String ALIGNMENT
DerivedBioAssay
representing data that has been
aligned against a reference genome.public static final String PRINTING
public static final String SCANNING
public static final String FEATURE_EXTRACTION
public static final int MAX_EXTERNAL_ID_LENGTH
setExternalId(String)
,
Constant Field ValuesProtocol(ProtocolData data)
data
- the datapublic static String getDefaultSystemId(Item itemType)
Subtypable
items with a
null ItemSubtype
and all other non-subtypable items which can be
linked to a protocol.itemType
- The item typepublic static Protocol getNew(DbControl dc) throws BaseException
Protocol
item.dc
- The DbControl
which will be used for
permission checking and database accessProtocol
itemBaseException
- If there is an errorpublic static Protocol getById(DbControl dc, int id) throws ItemNotFoundException, PermissionDeniedException, BaseException
Protocol
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 loadProtocol
itemItemNotFoundException
- This exception is thrown if an
item with the specified ID is not foundPermissionDeniedException
- This exception is thrown if
the logged in user doesn't have READ
permission to the itemBaseException
- This exception is thrown if there is another
errorpublic static ItemQuery<Protocol> getQuery()
ItemQuery
objectpublic Item getType()
Identifiable
Item
enumeration.getType
in interface Identifiable
public File getFile() throws PermissionDeniedException, BaseException
FileAttachable
getFile
in interface FileAttachable
File
item, or null if no file is attachedPermissionDeniedException
- If the logged in user doesn't have
read permission for the fileBaseException
- If there is another errorpublic void setFile(File file) throws PermissionDeniedException
FileAttachable
setFile
in interface FileAttachable
file
- The file to attach to the itemPermissionDeniedException
- If the logged in user doesn't
have use permission for the file or write permission for the
itempublic Date getEntryDate()
Registered
getEntryDate
in interface Registered
public Set<Annotatable> getAnnotatableParents()
Annotatable
Subtypable
item that has a subtype
with the ItemSubtype.getPushAnnotations()
flag set.getAnnotatableParents
in interface Annotatable
@SubtypableRelatedItems(value=FILE) public ItemSubtype getItemSubtype()
Subtypable
getItemSubtype
in interface Subtypable
SubtypableRelatedItems
public void setItemSubtype(ItemSubtype subtype)
Subtypable
setItemSubtype
in interface Subtypable
subtype
- A subtype or nullItemSubtype.setOnItem(Subtypable)
public boolean isUsed() throws BaseException
isUsed
in class BasicItem<ProtocolData>
BaseException
- If not able to tell if item is used or not.BasicItem.getUsingItems()
public Set<ItemProxy> getUsingItems()
BioMaterial
:s and PhysicalBioAssay
:s using this protocol
Plate
:s using this protocol
ArrayBatch
:s using this protocol
DerivedBioAssay
:s using this protocol
RawBioAssay
:s using this protocol
getUsingItems
in class BasicItem<ProtocolData>
BasicItem.addUsingItems(Set, Item, org.hibernate.Query)
public String getExternalId()
public void setExternalId(String externalId) throws PermissionDeniedException, InvalidDataException
MAX_EXTERNAL_ID_LENGTH
constant.externalId
- The new value for the external idPermissionDeniedException
- If the logged in user doesn't have
write permissionInvalidDataException
- If the string is too longpublic void addParameter(AnnotationType annotationType) throws PermissionDeniedException, InvalidDataException
annotationType
- The annotation type to add to this protocolPermissionDeniedException
- If the
logged in user doesn't have Permission.WRITE
permission for the protocol and Permission.USE
for the annotation typeInvalidDataException
- If the annotationType is null, or the
AnnotationType.isProtocolParameter()
doesn't return truepublic void removeParameter(AnnotationType annotationType) throws PermissionDeniedException, InvalidDataException
annotationType
- The annotation type to remove from this protocolPermissionDeniedException
- If the
logged in user doesn't have Permission.WRITE
permission for the protocolInvalidDataException
- If the annotationType is nullpublic boolean isParameter(AnnotationType annotationType)
annotationType
- The annotation type to check, null always return falseAnnotationType.isProtocolParameter(Protocol)
public boolean isParameter(Annotation annotation)
isParameter(AnnotationType)
but is not
affected by possible permission problems with the annotation type.annotation
- The annotation to check, null always return falsepublic ItemQuery<AnnotationType> getParameters()
ItemQuery
object