|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.basedb.core.BasicItem<D> net.sf.basedb.core.ChildItem<TransformationData> net.sf.basedb.core.Transformation
public class Transformation
A transformation represents an analysis step for an Experiment
. There
are two types of transformations. A root transformation is used to calculate
the initial set of intensities from a set of RawBioAssay
:s. The result
of a transformation is usually one or more BioAssaySet
:s. The other
type of transformation takes a bioassayset as the source and recalculates the
intensities, applies a filter or does something else.
A transformation is created by either the Experiment.newTransformation(Job, Collection)
method or the BioAssaySet.newTransformation(Job)
method.
Experiment.newTransformation(Job, Collection)
,
BioAssaySet.newTransformation(Job)
Field Summary | |
---|---|
private Job |
job
|
private Map<String,DataCube> |
namedCubes
Internal cache of named cubes used by the newProduct method. |
private Map<String,DataCubeLayer> |
namedLayers
Internal cache of named layers used by the newProduct method. |
static Item |
TYPE
The type of item represented by this class. |
Fields inherited from interface net.sf.basedb.core.Nameable |
---|
MAX_DESCRIPTION_LENGTH, MAX_NAME_LENGTH |
Constructor Summary | |
---|---|
Transformation(TransformationData data)
Creates a new experiment item from the given data. |
Method Summary | |
---|---|
private void |
deleteProducts()
Delete all product bioassaysets. |
static Transformation |
getById(DbControl dc,
int id)
Get a Transformation item when you know the id. |
String |
getDescription()
Get the description for the item. |
Experiment |
getExperiment()
Get the experiment this transformation belongs to. |
Job |
getJob()
Get the job that executed this transformation. |
String |
getName()
Get the name of the item. |
(package private) static Transformation |
getNew(DbControl dc,
Experiment experiment,
Job job)
Create a new Transformation item. |
(package private) Permission |
getPermissionForWriteDeleteAndCreate()
USE permission is enough to be able to manage transformations. |
ItemQuery<BioAssaySet> |
getProducts()
Get a query that return all bioassaysets created by this transformation. |
static ItemQuery<Transformation> |
getQuery(BioAssaySet bioAssaySet)
Get a query configured to retrieve transformations using the given bioassayset as source. |
static ItemQuery<Transformation> |
getQuery(Experiment experiment)
Get a query configured to retrieve transformations for a given experiment. |
ItemQuery<RawBioAssay> |
getRawSources()
Get a query that returns the raw bioassay sources used by this transformation. |
(package private) SharedData |
getSharedParent()
Get the experiment. |
BioAssaySet |
getSource()
Get the source bioassayset used by this transformation. |
Item |
getType()
Get the type of item represented by the object. |
boolean |
isRemoved()
Check if the removed flag is set for this item. |
BioAssaySet |
newProduct(String namedCube,
String namedLayer,
boolean createChildBioAssays)
Create a new product bioassayset from this transformation. |
(package private) void |
onBeforeCommit(Transactional.Action action)
Delete the product bioassaysets when deleting this transction. |
void |
setDescription(String description)
Set the description for the item. |
private void |
setExperiment(Experiment experiment)
Set the experiment. |
private void |
setJob(Job job)
Set the job that executed this transformation. |
void |
setName(String name)
Set the name of the item. |
(package private) void |
setRawSources(Collection<RawBioAssay> rawBioAssays)
Set the raw bioassay sources used in this transformation. |
void |
setRemoved(boolean removed)
Set the removed flag for this item. |
(package private) void |
setSource(BioAssaySet bioAssaySet)
Set the source bioassayset. |
Methods inherited from class net.sf.basedb.core.ChildItem |
---|
getPluginPermissions, initPermissions |
Methods inherited from class net.sf.basedb.core.BasicItem |
---|
addUsingItems, addUsingItems, checkPermission, equals, getData, getDbControl, getId, getPermissions, 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.Identifiable |
---|
getId, getVersion |
Methods inherited from interface net.sf.basedb.core.AccessControlled |
---|
checkPermission, getPermissions, hasPermission |
Field Detail |
---|
public static final Item TYPE
Item.TRANSFORMATION
,
getType()
private Job job
private Map<String,DataCube> namedCubes
private Map<String,DataCubeLayer> namedLayers
Constructor Detail |
---|
Transformation(TransformationData data)
data
- the dataMethod Detail |
---|
static Transformation getNew(DbControl dc, Experiment experiment, Job job) throws BaseException
Transformation
item. No source
has been specified. A caller should use either:
setSource(BioAssaySet)
or setRawSources(Collection)
.
dc
- The DbControl
which will be used for
permission checking and database access.experiment
- The experimentjob
- The job that executed the transformation
Transformation
item
BaseException
- If there is another errorExperiment.newTransformation(Job, Collection)
,
BioAssaySet.newTransformation(Job)
public static Transformation getById(DbControl dc, int id) throws ItemNotFoundException, PermissionDeniedException, BaseException
Transformation
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
Transformation
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<Transformation> getQuery(Experiment experiment) throws InvalidDataException
experiment
- The experiment to retreive transformations for, null
is not allowed
ItemQuery
object
InvalidDataException
- If required parameter is null.public static ItemQuery<Transformation> getQuery(BioAssaySet bioAssaySet) throws InvalidDataException
bioAssaySet
- The source bioassayset to retreive transformations for, null
is not allowed
ItemQuery
object
InvalidDataException
- If required parameter is null.public Item getType()
Identifiable
Item
enumeration.
getType
in interface Identifiable
public String getName()
Nameable
getName
in interface Nameable
String
with the name of the itempublic void setName(String name) throws PermissionDeniedException, InvalidDataException
Nameable
Nameable.MAX_NAME_LENGTH
constant.
setName
in interface Nameable
name
- The new name for the item
PermissionDeniedException
- If the logged in user doesn't
have write permission
InvalidDataException
- If the name is null or longer
than specified by the Nameable.MAX_NAME_LENGTH
constantpublic String getDescription()
Nameable
getDescription
in interface Nameable
String
with a description of the itempublic void setDescription(String description) throws PermissionDeniedException, InvalidDataException
Nameable
Nameable.MAX_DESCRIPTION_LENGTH
constant.
setDescription
in interface Nameable
description
- The new description for the item
PermissionDeniedException
- If the logged in user doesn't
have write permission
InvalidDataException
- If the description longer
than specified by the Nameable.MAX_DESCRIPTION_LENGTH
constantpublic boolean isRemoved()
Removable
isRemoved
in interface Removable
public void setRemoved(boolean removed) throws PermissionDeniedException
Removable
setRemoved
in interface Removable
removed
- TRUE if the item should be flagged as removed,
FALSE otherwise
PermissionDeniedException
- If the logged in user doesn't
have Permission.DELETE
permission for setting the flag
to TRUE or Permission.WRITE
permission for setting the
flag to FALSEvoid onBeforeCommit(Transactional.Action action) throws BaseException
onBeforeCommit
in class BasicItem<TransformationData>
BaseException
- If there is an errorTransactional
,
Core API overview - Transaction handling,
Coding rules and guidelines for item classesSharedData getSharedParent()
getSharedParent
in class ChildItem<TransformationData>
Permission getPermissionForWriteDeleteAndCreate()
getPermissionForWriteDeleteAndCreate
in class ChildItem<TransformationData>
public Experiment getExperiment() throws PermissionDeniedException, BaseException
Experiment
object
PermissionDeniedException
- If the logged in user doesn't have
read permission to the experiment
BaseException
- If there is another errorprivate void setExperiment(Experiment experiment)
public BioAssaySet getSource() throws PermissionDeniedException, BaseException
BioAssaySet
item, or null if this is a root
transformation
PermissionDeniedException
- If the logged in user doesn't have
read permission to the experiment
BaseException
- If there is another errorgetRawSources()
void setSource(BioAssaySet bioAssaySet)
BioAssaySet.newTransformation(Job)
public ItemQuery<RawBioAssay> getRawSources()
BioAssaySet
.
ItemQuery
objectgetSource()
void setRawSources(Collection<RawBioAssay> rawBioAssays) throws InvalidDataException
InvalidDataException
- If any of the raw bioassays are not part
of the experimentExperiment.newTransformation(Job, Collection)
,
Experiment.isUsing(RawBioAssay)
public Job getJob() throws PermissionDeniedException, BaseException
Job
object, ot null if this transformation
wasn't executed by a job
PermissionDeniedException
- If the logged in user doesn't have
read permission to the experiment
BaseException
- If there is another errorprivate void setJob(Job job)
public BioAssaySet newProduct(String namedCube, String namedLayer, boolean createChildBioAssays) throws PermissionDeniedException, InvalidDataException, BaseException
Transformation t = ... // Use same data cube, but a new layer; automatically create child bioassays BioAssaySet bas = t.newProduct(null, "new", true); // Use same data cube and layer; automatically create child bioassays BioAssaySet filtered = t.newProduct(null, null, true); // Use new data cube and layer; automatic creation of // child bioassays is not supported BioAsssySet merged = t.newProduct("new", "new", false); // Create four new bioassaysets using two datacubes, one // with two layers and one with one layer BioAssaySet bas1 = t.newProduct("cube1", "layer1", false); BioAssaySet bas2 = t.newProduct("cube1", "layer2", false); BioAssaySet bas3 = t.newProduct("cube2", "layer3", false); BioAssaySet bas4 = t.newProduct("cube2", "layer3", false);Note that the name of the layer is checked first, so we can't have the layers with the same name in two different cubes. For example the following call won't work:
// Don't! We bas3 is now using the same cube and layer as bas1 BioAssaySet bas3 = t.newProduct("cube2", "layer1", false);
namedCube
- The name of the data cube where the new bioassayset should
store/find it's data. If no data cube with the specified name exists a new
data cube is created. Specify 'null' to use the same data cube as
the source bioassayset.namedLayer
- The name of the data cube layer where the new bioassayset
should store/find it's data. If no layer with the specified name exists
a new layer is created. Specify 'null' to use the same layer as the
source bioassayset.createChildBioAssays
- TRUE to create one child bioassay for
each bioassay in the source bioassay set. This requires that
the product is created in the same data cube as the source
bioassay set, ie. namedCube should be null
PermissionDeniedException
- If the logged in user doesn't have
write permission for the experiment this transformation belongs to
or if this transformation has already been committed to the database
InvalidDataException
- If the layer is null or not part
of the same experiment as this transformation
BaseException
- If there is another errorpublic ItemQuery<BioAssaySet> getProducts()
ItemQuery
objectBioAssaySet.getQuery(Transformation)
private void deleteProducts()
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |