|
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.OwnedItem<D> net.sf.basedb.core.SharedItem<D> net.sf.basedb.core.CommonItem<PlateMappingData> net.sf.basedb.core.PlateMapping
public class PlateMapping
This class represents a mapping from one plate geometry to another. Given one or more plates of some specific geometry, a mapping creates one or more new plates of some other or the same geometry. The new plates and their wells will be linked to the plates and wells they were created from.
A mapping is specified by a set of source/destination coordinate pairs. A coordinate is specified by plate number, row and column. With this information it is possible to pick wells from the source plates and link them to wells on the destination plates.
It is not required that the mapping is complete, ie. contains a mapping for each destination coordinate. Such destination wells will be marked as empty. A destination coordinate may only be mapped to one source coordinate, but it is possible that one source coordinate is mapped to several destination coordinates.
Plate
,
PlateGeometry
Field Summary | |
---|---|
static int |
MAX_IMAGE_LENGTH
The maximum length of the image name that can be stored in the database. |
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 | |
---|---|
PlateMapping(PlateMappingData plateMappingData)
|
Method Summary | |
---|---|
List<Plate> |
apply(List<Plate> sourcePlates,
PlateType destinationPlateType)
Apply this mapping to the given list of source plates and generate new plates of the specified type. |
private void |
checkCoordinate(MappingCoordinate c,
int plateCount,
PlateGeometryData geometry,
boolean destination)
Checks that the coordinate is within the bouds given by the mapping and geometry. |
static PlateMapping |
getById(DbControl dc,
int id)
Get a PlateMapping item when you know the id. |
int |
getDestinationCount()
Get the number of produced destination plates. |
PlateGeometry |
getDestinationGeometry()
Get the PlateGeometry of the created plates. |
Date |
getEntryDate()
Get the date that the item was registered in the database. |
String |
getImage()
Get the name of a small image that is a graphical representation of the mapping. |
static PlateMapping |
getNew(DbControl dc,
PlateGeometry sourceGeometry,
int sourceCount,
PlateGeometry destinationGeometry,
int destinationCount)
Create a new PlateMapping item. |
static ItemQuery<PlateMapping> |
getQuery()
Get a query that returns plate mappings. |
MappingCoordinate |
getSourceCoordinate(MappingCoordinate destinationCoordinate)
Get the source coordinate for a given destination coordinate. |
int |
getSourceCount()
Get the number of required source plates. |
PlateGeometry |
getSourceGeometry()
Get the PlateGeometry that is required for source plates. |
Item |
getType()
Get the type of item represented by the object. |
Set<ItemProxy> |
getUsingItems()
Get all: Plate :s created with this mapping
|
boolean |
isUsed()
Check if: A Plate has been created from this mapping
|
private void |
setDestinationCount(int destinationCount)
Set the number of produced destination plates. |
private void |
setDestinationGeometry(PlateGeometry destinationGeometry)
Set the destination geometry. |
void |
setImage(String image)
Set the name of a small image that is a graphical representation of the mapping. |
void |
setSourceCoordinate(MappingCoordinate destinationCoordinate,
MappingCoordinate sourceCoordinate)
Set the source coordinate for a given destination coordinate. |
private void |
setSourceCount(int sourceCount)
Set the number of source plates. |
private void |
setSourceGeometry(PlateGeometry sourceGeometry)
Set the source geometry. |
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, onBeforeCommit, 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, getVersion, hashCode, hasPermission, isDetached, isInDatabase, 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 |
Methods inherited from interface net.sf.basedb.core.Ownable |
---|
getOwner, isOwner, setOwner, takeOwnership |
Field Detail |
---|
public static final Item TYPE
Item.PLATEMAPPING
,
getType()
public static final int MAX_IMAGE_LENGTH
setImage(String)
method to avoid exceptions.
Constructor Detail |
---|
PlateMapping(PlateMappingData plateMappingData)
Method Detail |
---|
public static PlateMapping getNew(DbControl dc, PlateGeometry sourceGeometry, int sourceCount, PlateGeometry destinationGeometry, int destinationCount) throws PermissionDeniedException, InvalidDataException, BaseException
PlateMapping
item.
dc
- The DbControl
which will be used for
permission checking and database accesssourceGeometry
- The required geometry of the source platessourceCount
- The number of source platesdestinationGeometry
- The geometry of the created destination platesdestinationCount
- The number of created destination plates
PlateMapping
item
PermissionDeniedException
- If the loggged in user
doesn't have use permission for the geometries
InvalidDataException
- If any of the geometries are null, or
any of the count values are less than one
BaseException
- If there is another errorpublic static PlateMapping getById(DbControl dc, int id) throws ItemNotFoundException, PermissionDeniedException, BaseException
PlateMapping
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
PlateMapping
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<PlateMapping> getQuery()
ItemQuery
objectpublic Item getType()
Identifiable
Item
enumeration.
getType
in interface Identifiable
public Date getEntryDate()
Registered
getEntryDate
in interface Registered
public boolean isUsed() throws BaseException
Plate
has been created from this mapping
isUsed
in class BasicItem<PlateMappingData>
BaseException
- If not able to tell if item is used or not.BasicItem.getUsingItems()
public Set<ItemProxy> getUsingItems()
Plate
:s created with this mapping
getUsingItems
in class BasicItem<PlateMappingData>
BasicItem.addUsingItems(Set, Item, org.hibernate.Query)
public PlateGeometry getSourceGeometry() throws PermissionDeniedException, BaseException
PlateGeometry
that is required for source plates.
PlateGeometry
item
PermissionDeniedException
- If the logged in user doesn't have
Permission.READ
permission for the plate geometry
BaseException
- If there is another errorprivate void setSourceGeometry(PlateGeometry sourceGeometry) throws PermissionDeniedException, InvalidDataException
PermissionDeniedException
- If the logged in user doesn't have
use permission for the geometry
InvalidDataException
- If the geometry is nullpublic int getSourceCount()
private void setSourceCount(int sourceCount) throws InvalidDataException
InvalidDataException
- If the source count is less than onepublic PlateGeometry getDestinationGeometry() throws PermissionDeniedException, BaseException
PlateGeometry
of the created plates.
PlateGeometry
item
PermissionDeniedException
- If the logged in user doesn't have
Permission.READ
permission for the plate geometry
BaseException
- If there is another errorprivate void setDestinationGeometry(PlateGeometry destinationGeometry) throws PermissionDeniedException, InvalidDataException
PermissionDeniedException
- If the logged in user doesn't have
use permission for the geometry
InvalidDataException
- If the geometry is nullpublic int getDestinationCount()
private void setDestinationCount(int destinationCount) throws InvalidDataException
InvalidDataException
- If the destination count is less than onepublic String getImage()
public void setImage(String image) throws PermissionDeniedException, InvalidDataException
MAX_IMAGE_LENGTH
constant.
image
- The name of the image
PermissionDeniedException
- If the logged in user doesn't
have write permission
InvalidDataException
- If the value is too longpublic MappingCoordinate getSourceCoordinate(MappingCoordinate destinationCoordinate)
destinationCoordinate
- The destination coordinate
MappingCoordinate
object or null if
no source coordinate has been specifiedpublic void setSourceCoordinate(MappingCoordinate destinationCoordinate, MappingCoordinate sourceCoordinate) throws PermissionDeniedException, InvalidDataException
destinationCoordinate
- The destination coordinatesourceCoordinate
- The source coordinate, or null to remove the mapping
for the destination coordinate
PermissionDeniedException
- If the logged in user doesn't have
write permission or if the mapping has been saved to the database
InvalidDataException
- If the destination coordinate is null or
any of the coordinates are outside the range of valid coordinates
as specified by the geometriesprivate void checkCoordinate(MappingCoordinate c, int plateCount, PlateGeometryData geometry, boolean destination) throws InvalidDataException
InvalidDataException
public List<Plate> apply(List<Plate> sourcePlates, PlateType destinationPlateType) throws PermissionDeniedException, InvalidDataException, BaseException
getSourceGeometry()
and the destroyed
flag mustn't be set. The list must contain exactly the required number
of plates as specified by @link #getSourceCount()}.
The destination plate type must be of the required destination geometry,
getDestinationGeometry()
.
The new plates are not saved to the database and doesn't have any names, descriptions or other information. It is up to the client application to fill in this information and save the new plates.
sourcePlates
- A List
containing Plate
itemsdestinationPlateType
- The PlateType
of the
destination plates
List
containing the new (unsaved) Plate
items
PermissionDeniedException
- If the logged in user doesn't have
use permission for this plate mapping and to all source plates
InvalidDataException
- If any of the parameters are invalid
BaseException
- If there is another error
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |