public class Experiment extends AnnotatedItem implements DiskConsumable, Transactional, Registered
RawBioAssay
:s of the same RawDataType
as itself. It is not possible to mix raw data types. A root
Transformation
is used to calculate the first set of intensities from
the raw data. The intensities are stored in a root BioAssaySet
.
Then, it is possible to apply more transformations using the root bioassayset as a source. Each transformation may create new bioassaysets, from which it is possible to apply new transformations and so on.
Transactional.Action
Modifier and Type | Field and Description |
---|---|
private long |
addedBytes |
static int |
MAX_ABSTRACT_LENGTH
The maximum length of the abstract property that can be stored in the
database.
|
static int |
MAX_AFFILIATIONS_LENGTH
The maximum length of the affiliations property that can be stored in the
database.
|
static int |
MAX_AUTHORS_LENGTH
The maximum length of the authors property that can be stored in the
database.
|
static int |
MAX_EXPERIMENT_DESIGN_LENGTH
The maximum length of the experimentDesign property that can be stored in the
database.
|
static int |
MAX_EXPERIMENT_TYPE_LENGTH
The maximum length of the experimentType property that can be stored in the
database.
|
static int |
MAX_PUBLICATION_LENGTH
The maximum length of the publication property that can be stored in the
database.
|
static int |
MAX_PUBMEDID_LENGTH
The maximum length of the pubMedId property that can be stored in the
database.
|
static int |
MAX_TITLE_LENGTH
The maximum length of the title property that can be stored in the
database.
|
private java.lang.String |
newReporterCloneTable |
private java.lang.String |
oldReporterCloneTable |
private ReporterCloneBatcher |
reporterCloneBatcher |
static Item |
TYPE
The type of item represented by this class.
|
private long |
updatedBytes |
MAX_DESCRIPTION_LENGTH, MAX_NAME_LENGTH
Constructor and Description |
---|
Experiment(ExperimentData data)
Creates a new experiment item from the given data.
|
Modifier and Type | Method and Description |
---|---|
(package private) void |
addBytes(long bytes) |
void |
addExperimentalFactor(AnnotationType annotationType)
Add an annotation type as an experimental factor to this experiment.
|
void |
addRawBioAssay(RawBioAssay rawBioAssay)
Add a raw bioassay to this experiment.
|
java.lang.String |
getAbstract()
Get the abstract text for the publication for this experiment.
|
java.lang.String |
getAffiliations()
Get the affiliations for this experiment.
|
java.util.Set<Annotatable> |
getAnnotatableParents()
Always null.
|
java.lang.String |
getAuthors()
Get the authors of the publication for this experiment.
|
ItemQuery<BioAssaySet> |
getBioAssaySets()
Get a query that return all bioassaysets in this
experiment.
|
static Experiment |
getById(DbControl dc,
int id)
Get an
Experiment item when you know the id. |
long |
getBytes()
Get the absolute number of bytes this item uses.
|
(package private) ExperimentData |
getData()
Get the
BasicData object that holds all data for this item. |
long |
getDifference()
Get the number of bytes this items now is using compared to when it was
loaded from the database.
|
Directory |
getDirectory()
Get the associated directory where it is recommended that plugins
store files that are related to this experiment.
|
java.util.Date |
getEntryDate()
Get the date that the item was registered in the database.
|
ItemQuery<AnnotationType> |
getExperimentalFactors()
Get a query that returns all annotation types used as experimental factors
for this experiment.
|
java.lang.String |
getExperimentDesign()
Get the a text describing the experimental design.
|
java.lang.String |
getExperimentType()
Get the a text describing the experiment type.
|
Location |
getLocation()
Always
Location.PRIMARY . |
static Experiment |
getNew(DbControl dc,
RawDataType rawDataType)
Create a new
Experiment item. |
java.lang.String |
getPublication()
Get the publication text.
|
java.util.Date |
getPublicationDate()
Get the date this experiment was published.
|
java.lang.String |
getPubMedId()
Get the PubMed ID of the publication.
|
static ItemQuery<Experiment> |
getQuery()
Get a query configured to retrieve experiments
|
java.lang.String |
getQuotaTypeSystemId()
Always
QuotaType.EXPERIMENT . |
ItemQuery<RawBioAssay> |
getRawBioAssays()
Get a query that returns the raw bioassays used in this
experiment.
|
RawDataType |
getRawDataType()
Get the raw data type this experiment uses for the raw data.
|
ReporterCloneBatcher |
getReporterCloneBatcher(DbControl dc)
Get a batcher for managing cloned reporter information for this experiment.
|
RootRawBioAssay |
getRootRawBioAssay(RawBioAssay raw)
Get the root raw bioassay that represents the given raw bioassay
in this experiment.
|
ItemQuery<RootRawBioAssay> |
getRootRawBioAssays()
Get a query that returns the root raw bioassays used in this
experiment.
|
ItemQuery<Transformation> |
getRootTransformations()
Get a query that return all root transformations in this
experiment.
|
java.lang.String |
getTitle()
Get the title for the publication for this experiment.
|
ItemQuery<Transformation> |
getTransformations()
Get a query that return all transformations including root
transformations in this experiment.
|
Item |
getType()
Get the type of item represented by the object.
|
VirtualDb |
getVirtualDb()
Get the virtual database ite that is used to manage experiment-specific
tables in the dynamic database for this experiment.
|
boolean |
isUsing(RawBioAssay rawBioAssay)
Check if a raw bioassay is used in this experiment.
|
Transformation |
newTransformation(Job job,
java.util.Collection<RawBioAssay> rawSources)
Create a new root transformation for this experiment.
|
(package private) void |
onAfterCommit(Transactional.Action action)
Remove old reporter clone table after a successful commit.
|
(package private) void |
onBeforeCommit(Transactional.Action action)
If a project is active, automatically share the new item according to
the settings of that project, unless a project or item key has been
explicitely set (including null).
|
(package private) void |
onRollback(Transactional.Action action)
Remove new reporter clone table after a rollback.
|
void |
removeExperimentalFactor(AnnotationType annotationType)
Remove an annotation type from the experimental factors for this experiment.
|
void |
removeRawBioAssay(RawBioAssay rawBioAssay)
Remove a raw bioassay from this experiment.
|
void |
setAbstract(java.lang.String theAbstract)
Set the abstract text for the publication of this experiment.
|
void |
setAffiliations(java.lang.String affiliations)
Set the affiliations for this experiment.
|
void |
setAuthors(java.lang.String authors)
Set the authors of the publication for this experiment.
|
void |
setDirectory(Directory directory)
Set the directory where it is recommended that plugins
store files that are related to this experiment.
|
void |
setEntryDate(java.util.Date entryDate)
Set the date the entry was registered in the database.
|
void |
setExperimentDesign(java.lang.String experimentDesign)
Set a text describing the experimental design.
|
void |
setExperimentType(java.lang.String experimentType)
Set a text describing the experiment type.
|
void |
setPublication(java.lang.String publication)
Set publication text.
|
void |
setPublicationDate(java.util.Date publicationDate)
Set the date this experiment was published.
|
void |
setPubMedId(java.lang.String pubMedId)
Set the PubMed ID of the publication.
|
private void |
setRawDataType(RawDataType rawDataType)
Set the raw data type.
|
void |
setTitle(java.lang.String title)
Set the title for the publication of this experiment.
|
private void |
unlinkJobs()
Unlink jobs from this experiment that are references from other items
NOT PART of the experiment.
|
boolean |
useDifference()
TRUE if the experiment has been saved to the database, FALSE otherwise.
|
getAnnotationSet, getProtocol, isAnnotated, removeAnnotations
getDescription, getName, getRemovedBy, isRemoved, setDescription, setName, setRemoved
getItemKey, getProjectKey, initPermissions, isShared, setItemKey, setProjectKey
getOwner, isOwner, setOwner, takeOwnership
addAnnotatableParents, addUsingItems, addUsingItems, breakCircularReferences, checkBatchAnnotatableUsage, checkPermission, equals, getBasicData, getDbControl, getId, getPermissions, getPluginPermissions, getSessionControl, getUsingItems, getVersion, hashCode, hasPermission, isDetached, isInDatabase, isUsed, onAfterInsert, setDbControl, setProjectDefaults, toString, validate
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getOwner, isOwner, setOwner, takeOwnership
getId, getVersion
checkPermission, getPermissions, hasPermission
public static final Item TYPE
Item.EXPERIMENT
,
getType()
public static final int MAX_AUTHORS_LENGTH
setAuthors(String)
method to avoid exceptions.public static final int MAX_AFFILIATIONS_LENGTH
setAffiliations(String)
method to avoid exceptions.public static final int MAX_TITLE_LENGTH
setTitle(String)
method to avoid exceptions.public static final int MAX_ABSTRACT_LENGTH
setAbstract(String)
method to avoid exceptions.public static final int MAX_PUBLICATION_LENGTH
setPublication(String)
method to avoid exceptions.public static final int MAX_EXPERIMENT_TYPE_LENGTH
setExperimentType(String)
method to avoid exceptions.public static final int MAX_EXPERIMENT_DESIGN_LENGTH
setExperimentDesign(String)
method to avoid exceptions.public static final int MAX_PUBMEDID_LENGTH
setPubMedId(String)
method to avoid exceptions.private long addedBytes
private long updatedBytes
private java.lang.String oldReporterCloneTable
private java.lang.String newReporterCloneTable
private ReporterCloneBatcher reporterCloneBatcher
Experiment(ExperimentData data)
data
- the datapublic static Experiment getNew(DbControl dc, RawDataType rawDataType) throws BaseException
Experiment
item.dc
- The DbControl
which will be used for
permission checking and database access.rawDataType
- The data type of the raw data used in this experimentExperiment
itemBaseException
- If there is an errorpublic static Experiment getById(DbControl dc, int id) throws ItemNotFoundException, PermissionDeniedException, BaseException
Experiment
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 loadExperiment
itemItemNotFoundException
- If an item with the specified id
is not foundPermissionDeniedException
- If the logged in user doesn't have
Permission.READ
permission to the itemBaseException
- If there is another errorpublic static ItemQuery<Experiment> getQuery()
ItemQuery
objectExperimentData getData()
BasicItem
BasicData
object that holds all data for this item.getData
in class AnnotatedItem
public Item getType()
Identifiable
Item
enumeration.getType
in interface Identifiable
public boolean useDifference()
useDifference
in interface DiskConsumable
DiskConsumable.getBytes()
,
DiskConsumable.getDifference()
public long getBytes()
DiskConsumable
getBytes
in interface DiskConsumable
DiskConsumable.useDifference()
,
DiskConsumable.getDifference()
public long getDifference()
DiskConsumable
DiskConsumable.useDifference()
returns FALSE.getDifference
in interface DiskConsumable
void addBytes(long bytes)
public java.lang.String getQuotaTypeSystemId()
QuotaType.EXPERIMENT
.getQuotaTypeSystemId
in interface DiskConsumable
public Location getLocation()
Location.PRIMARY
.getLocation
in interface DiskConsumable
public java.util.Date getEntryDate()
Registered
getEntryDate
in interface Registered
public void setEntryDate(java.util.Date entryDate)
Registered
setEntryDate
in interface Registered
entryDate
- A date or null to use today's datepublic java.util.Set<Annotatable> getAnnotatableParents() throws BaseException
getAnnotatableParents
in interface Annotatable
BaseException
- If there is an errorvoid onBeforeCommit(Transactional.Action action) throws BaseException
SharedItem
onBeforeCommit
in class SharedItem
BaseException
- If there is another errorTransactional
,
Developer documentation: Transactions,
Developer documentation: Coding rules and guidelines for item classesvoid onAfterCommit(Transactional.Action action)
onAfterCommit
in class BasicItem
Transactional
,
Developer documentation: Transactions,
Developer documentation: Coding rules and guidelines for item classesvoid onRollback(Transactional.Action action)
onRollback
in class BasicItem
Transactional
,
Developer documentation: Transactions,
Developer documentation: Coding rules and guidelines for item classespublic RawDataType getRawDataType()
RawDataType
objectprivate void setRawDataType(RawDataType rawDataType) throws InvalidDataException
rawDataType
- The raw data type, null is not allowedInvalidDataException
public VirtualDb getVirtualDb()
public java.lang.String getTitle()
public void setTitle(java.lang.String title) throws PermissionDeniedException, InvalidDataException
MAX_TITLE_LENGTH
constant.title
- The new titlePermissionDeniedException
- If the logged in user doesn't
have write permissionInvalidDataException
- If the text is too longpublic Directory getDirectory() throws PermissionDeniedException, BaseException
Directory
itemPermissionDeniedException
- This exception is thrown if
the logged in user doesn't have read
permission to the itemBaseException
- If there is another errorpublic void setDirectory(Directory directory) throws PermissionDeniedException, InvalidUseOfNullException
directory
- The new Directory
, or nullPermissionDeniedException
- If the logged in user doesn't
have write permission to the experiment or
use permission to the directoryInvalidUseOfNullException
public java.lang.String getAbstract()
public void setAbstract(java.lang.String theAbstract) throws PermissionDeniedException, InvalidDataException
MAX_ABSTRACT_LENGTH
constant.theAbstract
- The new abstract textPermissionDeniedException
- If the logged in user doesn't
have write permissionInvalidDataException
- If the text is too longpublic java.lang.String getAuthors()
public void setAuthors(java.lang.String authors) throws PermissionDeniedException, InvalidDataException
MAX_AUTHORS_LENGTH
constant.authors
- The new authors textPermissionDeniedException
- If the logged in user doesn't
have write permissionInvalidDataException
- If the text is too longpublic java.lang.String getAffiliations()
public void setAffiliations(java.lang.String affiliations) throws PermissionDeniedException, InvalidDataException
MAX_AFFILIATIONS_LENGTH
constant.affiliations
- The new affiliations textPermissionDeniedException
- If the logged in user doesn't
have write permissionInvalidDataException
- If the text is too longpublic java.lang.String getExperimentDesign()
public void setExperimentDesign(java.lang.String experimentDesign) throws PermissionDeniedException, InvalidDataException
MAX_EXPERIMENT_DESIGN_LENGTH
constant.experimentDesign
- The new experimental designPermissionDeniedException
- If the logged in user doesn't
have write permissionInvalidDataException
- If the text is too longpublic java.lang.String getExperimentType()
public void setExperimentType(java.lang.String experimentType) throws PermissionDeniedException, InvalidDataException
MAX_EXPERIMENT_TYPE_LENGTH
constant.experimentType
- The new experiment typePermissionDeniedException
- If the logged in user doesn't
have write permissionInvalidDataException
- If the text is too longpublic java.lang.String getPublication()
public void setPublication(java.lang.String publication) throws PermissionDeniedException, InvalidDataException
MAX_PUBLICATION_LENGTH
constant.publication
- The publication textPermissionDeniedException
- If the logged in user doesn't
have write permissionInvalidDataException
- If the text is too longpublic java.lang.String getPubMedId()
public void setPubMedId(java.lang.String pubMedId) throws PermissionDeniedException, InvalidDataException
MAX_PUBMEDID_LENGTH
constant.pubMedId
- The PubMed IDPermissionDeniedException
- If the logged in user doesn't
have write permissionInvalidDataException
- If the text is too longpublic java.util.Date getPublicationDate()
Date
object, or null if not knownpublic void setPublicationDate(java.util.Date publicationDate) throws PermissionDeniedException
publicationDate
- The date, or null if not knownPermissionDeniedException
- If the logged in user doesn't have
write permissionpublic void addRawBioAssay(RawBioAssay rawBioAssay) throws PermissionDeniedException, InvalidDataException
RawDataType
as this experiment.rawBioAssay
- The rawBioAssay to add to this experimentPermissionDeniedException
- If the
logged in user doesn't have Permission.WRITE
permission for the experiment and Permission.USE
for the raw bioassayInvalidDataException
- If the rawBioAssay is null,
or has a different raw data typepublic void removeRawBioAssay(RawBioAssay rawBioAssay) throws PermissionDeniedException, InvalidDataException
rawBioAssay
- The rawBioAssay to remove from this experimentPermissionDeniedException
- If the
logged in user doesn't have Permission.WRITE
permission for the experimentInvalidDataException
- If the rawBioAssay is nullpublic boolean isUsing(RawBioAssay rawBioAssay)
rawBioAssay
- The raw bioassay to look forpublic ItemQuery<RawBioAssay> getRawBioAssays()
ItemQuery
objectpublic ItemQuery<RootRawBioAssay> getRootRawBioAssays()
ItemQuery
objectpublic RootRawBioAssay getRootRawBioAssay(RawBioAssay raw)
public Transformation newTransformation(Job job, java.util.Collection<RawBioAssay> rawSources) throws PermissionDeniedException, InvalidDataException, BaseException
job
- The job that executed the transformationrawSources
- The raw bioassays used as source bioassaysPermissionDeniedException
- If the logged in user doesn't have
use permission for the experimentInvalidDataException
- If any of the raw bioassays are not
part of the experimentBaseException
- If there is another errorpublic ItemQuery<Transformation> getTransformations()
ItemQuery
objectTransformation.getQuery(Experiment)
,
getRootTransformations()
public ItemQuery<Transformation> getRootTransformations()
ItemQuery
objectgetTransformations()
,
Transformation.getSource()
public ItemQuery<BioAssaySet> getBioAssaySets()
ItemQuery
objectBioAssaySet.getQuery(Experiment)
public void addExperimentalFactor(AnnotationType annotationType) throws PermissionDeniedException, InvalidDataException
annotationType
- The annotation type to add to this experimentPermissionDeniedException
- If the
logged in user doesn't have Permission.WRITE
permission for the experiment and Permission.USE
for the annotation typeInvalidDataException
- If the annotationType is nullpublic void removeExperimentalFactor(AnnotationType annotationType) throws PermissionDeniedException, InvalidDataException
annotationType
- The annotation type to remove from this experimentPermissionDeniedException
- If the
logged in user doesn't have Permission.WRITE
permission for the experimentInvalidDataException
- If the annotationType is nullpublic ItemQuery<AnnotationType> getExperimentalFactors()
ItemQuery
objectpublic ReporterCloneBatcher getReporterCloneBatcher(DbControl dc)
dc
- The DbControl to use for database accessprivate void unlinkJobs()
ExperimentData.getJobs()