|
3.0.2: 2012-01-25 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.basedb.core.BasicItem<D>
net.sf.basedb.core.OwnedItem<D>
net.sf.basedb.core.SharedItem<D>
net.sf.basedb.core.CommonItem<ExperimentData>
net.sf.basedb.core.Experiment
public class Experiment
An experiment is the starting point of the analysis in BASE. An experiment
is linked to zero or more 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.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface net.sf.basedb.core.Transactional |
|---|
Transactional.Action |
| Field Summary | |
|---|---|
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. |
static Item |
TYPE
The type of item represented by this class. |
private long |
updatedBytes
|
| Fields inherited from interface net.sf.basedb.core.Nameable |
|---|
MAX_DESCRIPTION_LENGTH, MAX_NAME_LENGTH |
| Constructor Summary | |
|---|---|
Experiment(ExperimentData data)
Creates a new experiment item from the given data. |
|
| Method Summary | |
|---|---|
(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. |
String |
getAbstract()
Get the abstract text for the publication for this experiment. |
String |
getAffiliations()
Get the affiliations for this experiment. |
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. |
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. |
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. |
String |
getExperimentDesign()
Get the a text describing the experimental design. |
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. |
String |
getPublication()
Get the publication text. |
Date |
getPublicationDate()
Get the date this experiment was published. |
String |
getPubMedId()
Get the PubMed ID of the publication. |
static ItemQuery<Experiment> |
getQuery()
Get a query configured to retrieve experiments |
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. |
ItemQuery<Transformation> |
getRootTransformations()
Get a query that return all root transformations in this experiment. |
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. |
(package private) VirtualDb |
getVirtualDb()
|
boolean |
isUsing(RawBioAssay rawBioAssay)
Check if a raw bioassay is used in this experiment. |
Transformation |
newTransformation(Job job,
Collection<RawBioAssay> rawSources)
Create a new root transformation for this experiment. |
(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). |
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(String theAbstract)
Set the abstract text for the publication of this experiment. |
void |
setAffiliations(String affiliations)
Set the affiliations for this experiment. |
void |
setAuthors(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 |
setExperimentDesign(String experimentDesign)
Set a text describing the experimental design. |
void |
setExperimentType(String experimentType)
Set a text describing the experiment type. |
void |
setPublication(String publication)
Set publication text. |
void |
setPublicationDate(Date publicationDate)
Set the date this experiment was published. |
void |
setPubMedId(String pubMedId)
Set the PubMed ID of the publication. |
private void |
setRawDataType(RawDataType rawDataType)
Set the raw data type. |
void |
setTitle(String title)
Set the title for the publication of this experiment. |
ExperimentInfo |
toTransferable(ExperimentInfo info)
Transfer the internal state to a transferable object. |
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. |
| Methods inherited from class net.sf.basedb.core.CommonItem |
|---|
getDescription, getName, isRemoved, setDescription, setName, setRemoved, toTransferable |
| Methods inherited from class net.sf.basedb.core.SharedItem |
|---|
getItemKey, getProjectKey, initPermissions, isShared, setItemKey, setProjectKey, toTransferable |
| Methods inherited from class net.sf.basedb.core.OwnedItem |
|---|
getOwner, isOwner, setOwner, takeOwnership, toTransferable |
| Methods inherited from class net.sf.basedb.core.BasicItem |
|---|
addUsingItems, addUsingItems, checkPermission, equals, getData, getDbControl, getId, getPermissions, getPluginPermissions, getSessionControl, getUsingItems, getVersion, hashCode, hasPermission, isDetached, isInDatabase, isUsed, onAfterCommit, onAfterInsert, onRollback, setDbControl, setProjectDefaults, toString, toTransferable, validate |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface net.sf.basedb.core.Ownable |
|---|
getOwner, isOwner, setOwner, takeOwnership |
| Methods inherited from interface net.sf.basedb.core.Identifiable |
|---|
getId, getVersion |
| Methods inherited from interface net.sf.basedb.core.AccessControlled |
|---|
checkPermission, getPermissions, hasPermission |
| Field Detail |
|---|
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
| Constructor Detail |
|---|
Experiment(ExperimentData data)
data - the data| Method Detail |
|---|
public 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 experiment
Experiment item
BaseException - If there is an error
public 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 load
Experiment item
ItemNotFoundException - If an item with the specified id
is not found
PermissionDeniedException - If the logged in user doesn't have
Permission.READ permission to the item
BaseException - If there is another errorpublic static ItemQuery<Experiment> getQuery()
ItemQuery objectpublic Item getType()
IdentifiableItem enumeration.
getType in interface Identifiablepublic boolean useDifference()
useDifference in interface DiskConsumableDiskConsumable.getBytes(),
DiskConsumable.getDifference()public long getBytes()
DiskConsumable
getBytes in interface DiskConsumableDiskConsumable.useDifference(),
DiskConsumable.getDifference()public long getDifference()
DiskConsumableDiskConsumable.useDifference() returns FALSE.
getDifference in interface DiskConsumablevoid addBytes(long bytes)
public String getQuotaTypeSystemId()
QuotaType.EXPERIMENT.
getQuotaTypeSystemId in interface DiskConsumablepublic Location getLocation()
Location.PRIMARY.
getLocation in interface DiskConsumablepublic Date getEntryDate()
Registered
getEntryDate in interface Registered
void onBeforeCommit(Transactional.Action action)
throws BaseException
SharedItem
onBeforeCommit in class SharedItem<ExperimentData>BaseException - If there is another errorTransactional,
Developer documentation: Transactions,
Developer documentation: Coding rules and guidelines for item classespublic ExperimentInfo toTransferable(ExperimentInfo info)
ToTransferable
toTransferable in interface ToTransferable<ExperimentInfo>info - The transferable object to use
public RawDataType getRawDataType()
RawDataType object
private void setRawDataType(RawDataType rawDataType)
throws InvalidDataException
rawDataType - The raw data type, null is not allowed
InvalidDataExceptionVirtualDb getVirtualDb()
public String getTitle()
public void setTitle(String title)
throws PermissionDeniedException,
InvalidDataException
MAX_TITLE_LENGTH constant.
title - The new title
PermissionDeniedException - If the logged in user doesn't
have write permission
InvalidDataException - If the text is too long
public Directory getDirectory()
throws PermissionDeniedException,
BaseException
Directory item
PermissionDeniedException - This exception is thrown if
the logged in user doesn't have read
permission to the item
BaseException - If there is another error
public void setDirectory(Directory directory)
throws PermissionDeniedException,
InvalidUseOfNullException
directory - The new Directory, or null
PermissionDeniedException - If the logged in user doesn't
have write permission to the experiment or
use permission to the directory
InvalidUseOfNullExceptionpublic String getAbstract()
public void setAbstract(String theAbstract)
throws PermissionDeniedException,
InvalidDataException
MAX_ABSTRACT_LENGTH constant.
theAbstract - The new abstract text
PermissionDeniedException - If the logged in user doesn't
have write permission
InvalidDataException - If the text is too longpublic String getAuthors()
public void setAuthors(String authors)
throws PermissionDeniedException,
InvalidDataException
MAX_AUTHORS_LENGTH constant.
authors - The new authors text
PermissionDeniedException - If the logged in user doesn't
have write permission
InvalidDataException - If the text is too longpublic String getAffiliations()
public void setAffiliations(String affiliations)
throws PermissionDeniedException,
InvalidDataException
MAX_AFFILIATIONS_LENGTH constant.
affiliations - The new affiliations text
PermissionDeniedException - If the logged in user doesn't
have write permission
InvalidDataException - If the text is too longpublic String getExperimentDesign()
public void setExperimentDesign(String experimentDesign)
throws PermissionDeniedException,
InvalidDataException
MAX_EXPERIMENT_DESIGN_LENGTH constant.
experimentDesign - The new experimental design
PermissionDeniedException - If the logged in user doesn't
have write permission
InvalidDataException - If the text is too longpublic String getExperimentType()
public void setExperimentType(String experimentType)
throws PermissionDeniedException,
InvalidDataException
MAX_EXPERIMENT_TYPE_LENGTH constant.
experimentType - The new experiment type
PermissionDeniedException - If the logged in user doesn't
have write permission
InvalidDataException - If the text is too longpublic String getPublication()
public void setPublication(String publication)
throws PermissionDeniedException,
InvalidDataException
MAX_PUBLICATION_LENGTH constant.
publication - The publication text
PermissionDeniedException - If the logged in user doesn't
have write permission
InvalidDataException - If the text is too longpublic String getPubMedId()
public void setPubMedId(String pubMedId)
throws PermissionDeniedException,
InvalidDataException
MAX_PUBMEDID_LENGTH constant.
pubMedId - The PubMed ID
PermissionDeniedException - If the logged in user doesn't
have write permission
InvalidDataException - If the text is too longpublic Date getPublicationDate()
Date object, or null if not known
public void setPublicationDate(Date publicationDate)
throws PermissionDeniedException
publicationDate - The date, or null if not known
PermissionDeniedException - If the logged in user doesn't have
write permission
public void addRawBioAssay(RawBioAssay rawBioAssay)
throws PermissionDeniedException,
InvalidDataException
RawDataType as this experiment.
rawBioAssay - The rawBioAssay to add to this experiment
PermissionDeniedException - If the
logged in user doesn't have Permission.WRITE
permission for the experiment and Permission.USE
for the raw bioassay
InvalidDataException - If the rawBioAssay is null,
or has a different raw data type
public void removeRawBioAssay(RawBioAssay rawBioAssay)
throws PermissionDeniedException,
InvalidDataException
rawBioAssay - The rawBioAssay to remove from this experiment
PermissionDeniedException - If the
logged in user doesn't have Permission.WRITE
permission for the experiment
InvalidDataException - If the rawBioAssay is nullpublic boolean isUsing(RawBioAssay rawBioAssay)
rawBioAssay - The raw bioassay to look for
public ItemQuery<RawBioAssay> getRawBioAssays()
ItemQuery object
public Transformation newTransformation(Job job,
Collection<RawBioAssay> rawSources)
throws PermissionDeniedException,
InvalidDataException,
BaseException
job - The job that executed the transformationrawSources - The raw bioassays used as source bioassays
PermissionDeniedException - If the logged in user doesn't have
use permission for the experiment
InvalidDataException - If any of the raw bioassays are not
part of the experiment
BaseException - 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 experiment
PermissionDeniedException - If the
logged in user doesn't have Permission.WRITE
permission for the experiment and Permission.USE
for the annotation type
InvalidDataException - If the annotationType is null
public void removeExperimentalFactor(AnnotationType annotationType)
throws PermissionDeniedException,
InvalidDataException
annotationType - The annotation type to remove from this experiment
PermissionDeniedException - If the
logged in user doesn't have Permission.WRITE
permission for the experiment
InvalidDataException - If the annotationType is nullpublic ItemQuery<AnnotationType> getExperimentalFactors()
ItemQuery objectprivate void unlinkJobs()
ExperimentData.getJobs()
|
3.0.2: 2012-01-25 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||