|
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<D> net.sf.basedb.core.AnnotatedItem<ArrayDesignData> net.sf.basedb.core.ArrayDesign
public class ArrayDesign
An array design is a description of the design of a microarray
slide. An array design item is first created without any Feature
information. A feature maps a coordinate on the array to a
Reporter
. Features can be added with links directly to
reporters, or to Well
s if the array design is associated
with a set of Plate
s.
Once features has been added to the array design, they cannot be removed or modified.
ArrayBatch
,
ArraySlide
,
Plate
,
Feature
,
ArrayDesignBlock
Field Summary | |
---|---|
private Map<BlockInfo,Integer> |
blocks
|
private FeatureBatcher |
featureBatcher
|
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 | |
---|---|
ArrayDesign(ArrayDesignData arrayDesignData)
|
Method Summary | |
---|---|
ArrayDesignBlock |
addArrayDesignBlock(BlockInfo bi)
Adds an ArrayDesignBlock to the array design. |
void |
addPlate(Plate plate)
Adds a single plate to the plate list. |
Set<Annotatable> |
getAnnotatableParents()
Get the plates, if any. |
ItemQuery<ArrayBatch> |
getArrayBatches()
Get a query that returns the batches for this design. |
ItemQuery<ArrayDesignBlock> |
getArrayDesignBlocks()
Get a query that returns the block of this array design. |
ItemQuery<ArrayDesignPlate> |
getArrayDesignPlates()
Get plate connections for this array design. |
static ArrayDesign |
getById(DbControl dc,
int id)
Get an ArrayDesign item when you know the ID. |
Date |
getEntryDate()
Get the date that the item was registered in the database. |
FeatureBatcher |
getFeatureBatcher()
Deprecated. Use getFeatureBatcher(FeatureIdentificationMethod, Job) instead |
FeatureBatcher |
getFeatureBatcher(FeatureIdentificationMethod fiMethod,
Job job)
Get a feature batcher which can be used to add regular features to the array design. |
FeatureData |
getFeatureById(int id)
Get a feature when you know the id. |
FeatureData |
getFeatureById(int id,
boolean forceInitialization)
Get a feature when you know the id. |
FeatureIdentificationMethod |
getFeatureIdentificationMethod()
Get the method used to identify features on this array design. |
DataQuery<FeatureData> |
getFeatures()
Get a query that returns the regular features of this array design. |
FileSet |
getFileSet()
Get the file set that collects all files that holds data for this item. |
Job |
getJob()
Get the job that imported features to this array design. |
static ArrayDesign |
getNew(DbControl dc,
boolean affyChip)
Deprecated. Use getNew(DbControl, Platform) instead |
static ArrayDesign |
getNew(DbControl dc,
Platform platform)
Create a new ArrayDesign item for a given platform. |
static ArrayDesign |
getNew(DbControl dc,
PlatformVariant variant)
Create a new ArrayDesign item for a given platform
variant. |
int |
getNumArrays()
Get the number of arrays on a single slide. |
int |
getNumDbFeatures()
Get the number of features on this array design that are stored in the database. |
long |
getNumFeatures(DbControl dc)
Deprecated. Use getNumDbFeatures() and/or getNumFileFeatures()
instead |
int |
getNumFileFeatures()
Get the number of features on this array design that are stored inside files. |
int |
getNumPlates()
The number of plates connected to this array design. |
Collection<FileSet> |
getParentFileSets()
There are no parent file sets. |
Plate |
getPlate(int position)
Get a Plate from a given position. |
int |
getPlatePosition(Plate plate)
Get the position of a Plate in this array design. |
ItemQuery<Plate> |
getPlates()
Get a query that returns the plates that are used by this arraydesign. |
Platform |
getPlatform()
Get the platform the item is related to. |
static ItemQuery<ArrayDesign> |
getQuery()
Get a ItemQuery object configured
to retrieve array designs. |
DataQuery<ReporterData> |
getReporters()
Get a query that returns the reporters on this array design. |
Item |
getType()
Get the type of item represented by the object. |
Set<ItemProxy> |
getUsingItems()
Get all: ArrayBatch :s of this design
RawBioAssay :s of this design
|
PlatformVariant |
getVariant()
Get the platform variant the item is related to. |
boolean |
hasFeatures()
Check if this array design has information about features, either in the database or in files. |
boolean |
hasFileSet()
Check if this item has a file set. |
boolean |
isAffyChip()
Deprecated. Use isPlatform(String) instead with
Platform.AFFYMETRIX as the parameter |
boolean |
isFileOnlyPlatform()
Check if this array design uses a file-only platform or variant. |
boolean |
isPlatform(String externalId)
Check if the platform/variant of this array design has the given external ID. |
boolean |
isUsed()
Check if this item is used by some other item. |
ArrayBatch |
newArrayBatch()
Create a new ArrayBatch with this design. |
void |
setNumArrays(int numArrays)
Set the number of arrays on a single slide. |
void |
setNumFileFeatures(int numFeatures)
Set the number of features that are stored in files. |
void |
setPlateList(List<Plate> plates)
Set the list of plates to be used by this array design. |
void |
setPlatform(Platform platform)
Set the platform of the array design. |
void |
setVariant(PlatformVariant variant)
Set the platform and variant of the array design. |
ArrayDesignInfo |
toTransferable(ArrayDesignInfo info)
Transfer the internal state to a transferable object. |
FeatureBatcher |
xgetFeatureBatcher(FeatureIdentificationMethod fiMethod)
Deprecated. Use getFeatureBatcher(FeatureIdentificationMethod, Job)
instead |
Methods inherited from class net.sf.basedb.core.AnnotatedItem |
---|
getAnnotationSet, getProtocol, isAnnotated, removeAnnotations, toTransferable |
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.ARRAYDESIGN
,
getType()
private FeatureBatcher featureBatcher
private Map<BlockInfo,Integer> blocks
Constructor Detail |
---|
ArrayDesign(ArrayDesignData arrayDesignData)
Method Detail |
---|
public static ArrayDesign getNew(DbControl dc, boolean affyChip) throws BaseException
getNew(DbControl, Platform)
instead
ArrayDesign
item.
dc
- The DbControl
which will be used for
permission checking and database accessaffyChip
- true
if the new design is an Affymetrix chip,
false
otherwise
ArrayDesign
item
BaseException
- If there is an errorpublic static ArrayDesign getNew(DbControl dc, Platform platform)
ArrayDesign
item for a given platform.
dc
- The DbControl
which will be used for
permission checking and database accessplatform
- The platform of the array design
ArrayDesign
item
BaseException
- If there is an errorpublic static ArrayDesign getNew(DbControl dc, PlatformVariant variant)
ArrayDesign
item for a given platform
variant.
dc
- The DbControl
which will be used for
permission checking and database accessvariant
- The platform variant of the array design
ArrayDesign
item
BaseException
- If there is an errorpublic static ArrayDesign getById(DbControl dc, int id) throws ItemNotFoundException, PermissionDeniedException, BaseException
ArrayDesign
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
ArrayDesign
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<ArrayDesign> getQuery()
ItemQuery
object configured
to retrieve array designs.
ItemQuery
objectpublic Item getType()
Identifiable
Item
enumeration.
getType
in interface Identifiable
public Set<Annotatable> getAnnotatableParents() throws BaseException
getAnnotatableParents
in interface Annotatable
BaseException
- If there is an errorpublic FileSet getFileSet()
FileStoreEnabled
DbControl.commit()
is called. To check if an item has files without creating a new
file set use the FileStoreEnabled.hasFileSet()
method.
getFileSet
in interface FileStoreEnabled
public boolean hasFileSet()
FileStoreEnabled
FileStoreEnabled.getFileSet()
to avoid creating a new file set when there is
no need for it.
hasFileSet
in interface FileStoreEnabled
public Platform getPlatform()
FileStoreEnabled
DataFileType
:s that can be added to the file set.
getPlatform
in interface FileStoreEnabled
public PlatformVariant getVariant()
FileStoreEnabled
DataFileType
:s that can be added to the file set.
getVariant
in interface FileStoreEnabled
public Collection<FileSet> getParentFileSets()
getParentFileSets
in interface FileStoreEnabled
public Date getEntryDate()
Registered
getEntryDate
in interface Registered
public boolean isUsed() throws BaseException
BasicItem
super.isUsed()
, unless it has decided
that the item is used by some other means.
isUsed
in class BasicItem<ArrayDesignData>
BaseException
- If not able to tell if item is used or not.BasicItem.getUsingItems()
public Set<ItemProxy> getUsingItems()
ArrayBatch
:s of this design
RawBioAssay
:s of this design
getUsingItems
in class BasicItem<ArrayDesignData>
BasicItem.addUsingItems(Set, Item, org.hibernate.Query)
public void setPlatform(Platform platform)
setVariant(PlatformVariant)
if you want to
set a specific variant.
platform
- The new platform
PermissionDeniedException
- If the logged in user doesn't have
write permission
InvalidDataException
- If platform is nullpublic void setVariant(PlatformVariant variant)
PlatformVariant.getPlatform()
.
variant
- The new platform variant, or null to remove
the variant and keep the platform as it is
PermissionDeniedException
- If the logged in user doesn't have
write permissionpublic boolean isPlatform(String externalId)
externalId
- The external ID to match
public boolean isFileOnlyPlatform()
public boolean isAffyChip()
isPlatform(String)
instead with
Platform.AFFYMETRIX
as the parameter
public Job getJob() throws PermissionDeniedException, BaseException
Job
object, ot null if this information is
not available
PermissionDeniedException
- If the logged in user doesn't have
read permission to the job
BaseException
- If there is another errorpublic int getNumArrays()
public void setNumArrays(int numArrays)
numArrays
- A value > 0
NumberOutOfRangeException
- If the value is <=0public boolean hasFeatures()
public FeatureIdentificationMethod getFeatureIdentificationMethod()
FeatureIdentificationMethod
public ItemQuery<Plate> getPlates() throws BaseException
ItemQuery
object
BaseException
- If something fails when getting the query.public ItemQuery<ArrayDesignPlate> getArrayDesignPlates()
getPlates()
and getPlatePosition(Plate)
and/or
getPlate(int)
methods since it only requires a single query to the database.
ItemQuery
objectpublic int getPlatePosition(Plate plate)
Plate
in this array design.
plate
- The plate.
public Plate getPlate(int position)
Plate
from a given position.
position
- The position of the plate, starting at 0
public int getNumPlates()
public void setPlateList(List<Plate> plates) throws PermissionDeniedException
Permission.USE
to any plate in the list no plates will be added.
plates
- A list of plates to replace the old list with. It may not contain nulls, but
if the list is null or empty all plates will be removed.
PermissionDeniedException
- If the logged in user doesn't
have Permission.WRITE
permission to this ArrayDesign item or
Permission.USE
permission to any plate item in the list or tries
to add a plate to an arraydesign that has features.public void addPlate(Plate plate) throws PermissionDeniedException
plate
- the Plate
item to be added to the list. It may be null.
PermissionDeniedException
- If the logged in user doesn't
have Permission.WRITE
permission to this ArrayDesign item
, Permission.USE
permission to the plate item or tries
to add a plate to an arraydesign that has features.public ArrayBatch newArrayBatch() throws PermissionDeniedException, BaseException
ArrayBatch
with this design.
ArrayBatch
item
PermissionDeniedException
- If
the logged in user doesn't have use
permission for this design
BaseException
- If there is another errorpublic ItemQuery<ArrayBatch> getArrayBatches()
ItemQuery
objectpublic ArrayDesignBlock addArrayDesignBlock(BlockInfo bi) throws PermissionDeniedException, BaseException
ArrayDesignBlock
to the array design. If the block
already exists it is returned instead. Unlike other items,
the block is automatically saved to the database. The reason is that
otherwise we wouldn't be able to add features to the block since
the FeatureBatcher
object requires that the block has an id.
Use the getFeatureBatcher()
method to get an batcher object
that can add features to the new block.
It is not possible to add blocks to an array design which uses a
file-only platform. The must store feature information in files
instead. See Platform
and DataFileType
.
bi
- The information for the new block
ArrayDesignBlock
PermissionDeniedException
- if the logged in user doesn't have
write permission on the array design
BaseException
- If there is another errorpublic FeatureBatcher getFeatureBatcher() throws PermissionDeniedException, BaseException
getFeatureBatcher(FeatureIdentificationMethod, Job)
instead
PermissionDeniedException
BaseException
public FeatureBatcher xgetFeatureBatcher(FeatureIdentificationMethod fiMethod) throws PermissionDeniedException, BaseException
getFeatureBatcher(FeatureIdentificationMethod, Job)
instead
PermissionDeniedException
BaseException
public FeatureBatcher getFeatureBatcher(FeatureIdentificationMethod fiMethod, Job job) throws PermissionDeniedException, BaseException
It is not possible to add blocks to an array design which uses a
file-only platform. The must store feature information in files
instead. See Platform
and DataFileType
.
fiMethod
- The method to use for identifying featuresjob
- The job that is currently running, or null if the feature import
is not running as a job
fiMethod
and job
parameter is ignored
and the same batcher as before is returned.
PermissionDeniedException
- If raw data has already been added
or the logged in user doesn't have write permission
BaseException
- If there is another errorpublic DataQuery<FeatureData> getFeatures()
DataQuery
objectpublic DataQuery<ReporterData> getReporters()
getFeatures()
can be
used without modifications on this query.
DataQuery
objectpublic FeatureData getFeatureById(int id) throws ItemNotFoundException, BaseException
getFeatureById(int, boolean)
instead.
id
- The id of the feature
ItemNotFoundException
- If the feature could not be found.
BaseException
- If something else fails when getting the feature.public FeatureData getFeatureById(int id, boolean forceInitialization)
id
- The id of the featureforceInitialization
- If TRUE the feature and associated reporter
are sure to be initialized
ItemNotFoundException
- If the feature could not be found.
BaseException
- If something else fails when getting the featurepublic ItemQuery<ArrayDesignBlock> getArrayDesignBlocks()
ItemQuery
objectArrayDesignBlock.getQuery(ArrayDesign)
public long getNumFeatures(DbControl dc)
getNumDbFeatures()
and/or getNumFileFeatures()
instead
getNumDbFeatures()
is returned, otherwise the value from getNumFileFeatures()
public int getNumDbFeatures()
public int getNumFileFeatures()
public void setNumFileFeatures(int numFeatures)
numFeatures
- The number of featurespublic ArrayDesignInfo toTransferable(ArrayDesignInfo info)
ToTransferable
toTransferable
in interface ToTransferable<ArrayDesignInfo>
info
- The transferable object to use
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |