Class ArrayDesign

    • Method Detail

      • getNew

        public static ArrayDesign getNew​(DbControl dc,
                                         Platform platform)
        Create a new ArrayDesign item for a given platform.
        Parameters:
        dc - The DbControl which will be used for permission checking and database access
        platform - The platform of the array design
        Returns:
        The new ArrayDesign item
        Throws:
        BaseException - If there is an error
        Since:
        2.5
      • getNew

        public static ArrayDesign getNew​(DbControl dc,
                                         PlatformVariant variant)
        Create a new ArrayDesign item for a given platform variant.
        Parameters:
        dc - The DbControl which will be used for permission checking and database access
        variant - The platform variant of the array design
        Returns:
        The new ArrayDesign item
        Throws:
        BaseException - If there is an error
        Since:
        2.5
      • getType

        public Item getType()
        Description copied from interface: Identifiable
        Get the type of item represented by the object. The returned value is one of the values defined in the Item enumeration.
        Specified by:
        getType in interface Identifiable
        Returns:
        A value indicating the type of item
      • getFileSet

        public FileSet getFileSet()
        Description copied from interface: FileStoreEnabled
        Get the file set that collects all files that holds data for this item. If no file set exists a new one is created and automatically saved to the database when DbControl.commit() is called. To check if an item has files without creating a new file set use the FileStoreEnabled.hasFileSet() method.
        Specified by:
        getFileSet in interface FileStoreEnabled
        Returns:
        A file set
        Since:
        2.5
      • hasFileSet

        public boolean hasFileSet()
        Description copied from interface: FileStoreEnabled
        Check if this item has a file set. Always call this method before FileStoreEnabled.getFileSet() to avoid creating a new file set when there is no need for it.
        Specified by:
        hasFileSet in interface FileStoreEnabled
        Returns:
        TRUE if a file set exists, FALSE if not
        Since:
        2.5
      • getPlatform

        public Platform getPlatform()
        Description copied from interface: FileStoreEnabled
        Get the platform the item is related to. The platform is used to limit the DataFileType:s that can be added to the file set.
        Specified by:
        getPlatform in interface FileStoreEnabled
        Returns:
        A platform or null if the items is not related to any platform.
        Since:
        2.5
      • getVariant

        public PlatformVariant getVariant()
        Description copied from interface: FileStoreEnabled
        Get the platform variant the item is related to. The platform is used to limit the DataFileType:s that can be added to the file set.
        Specified by:
        getVariant in interface FileStoreEnabled
        Returns:
        A platform or null if the items is not related to any variant.
        Since:
        2.5
      • getEntryDate

        public Date getEntryDate()
        Description copied from interface: Registered
        Get the date that the item was registered in the database.
        Specified by:
        getEntryDate in interface Registered
        Returns:
        A date or null if this is not known
      • setEntryDate

        public void setEntryDate​(Date entryDate)
        Description copied from interface: Registered
        Set the date the entry was registered in the database. Implementations should only allow this property to be set before the item is first stored in the database. The intention of this method is to facilitate export/import of data between server.
        Specified by:
        setEntryDate in interface Registered
        Parameters:
        entryDate - A date or null to use today's date
      • isUsed

        public boolean isUsed()
                       throws BaseException
        Description copied from class: BasicItem
        Check if this item is used by some other item. With used we mean that another item is linking to this item in way that prevents this item from beeing deleted. Ie. if we tried to delete an item that is used, we would get a foreign key violation error from the database. If the subclass overrides this method it should propagate the call to the superclass, ie. super.isUsed(), unless it has decided that the item is used by some other means.
        Overrides:
        isUsed in class BasicItem
        Returns:
        TRUE if this item is used, FALSE otherwise
        Throws:
        BaseException - If not able to tell if item is used or not.
        See Also:
        BasicItem.getUsingItems()
      • setVariant

        public void setVariant​(PlatformVariant variant)
        Set the platform and variant of the array design. This method will automatically set the platform to PlatformVariant.getPlatform().
        Parameters:
        variant - The new platform variant, or null to remove the variant and keep the platform as it is
        Throws:
        PermissionDeniedException - If the logged in user doesn't have write permission
        Since:
        2.5
      • isPlatform

        public boolean isPlatform​(String externalId)
        Check if the platform/variant of this array design has the given external ID.
        Parameters:
        externalId - The external ID to match
        Returns:
        TRUE if either the variant of platform matches the external ID
        Since:
        2.5
      • isFileOnlyPlatform

        public boolean isFileOnlyPlatform()
        Check if this array design uses a file-only platform or variant. If the array design has a platform variant, the setting from the variant is returned, otherwise the setting from the platform.
        Returns:
        TRUE if this array design use a file-only variant / platform
        Since:
        2.5
      • getNumArrays

        public int getNumArrays()
        Get the number of arrays on a single slide. The default value is 1.
        Since:
        2.6
      • setNumArrays

        public void setNumArrays​(int numArrays)
        Set the number of arrays on a single slide.
        Parameters:
        numArrays - A value > 0
        Throws:
        NumberOutOfRangeException - If the value is <=0
        Since:
        2.6
      • hasFeatures

        public boolean hasFeatures()
        Check if this array design has information about features, either in the database or in files.
        Returns:
        TRUE if this object has features, FALSE otherwise
      • getFeatureIdentificationMethod

        public FeatureIdentificationMethod getFeatureIdentificationMethod()
        Get the method used to identify features on this array design.
        Returns:
        A FeatureIdentificationMethod
        Since:
        2.6
      • getPlatePosition

        public int getPlatePosition​(Plate plate)
        Get the position of a Plate in this array design.
        Parameters:
        plate - The plate.
        Returns:
        The position of the plate. -1 if the array design doesn't contain this plate.
      • getPlate

        public Plate getPlate​(int position)
        Get a Plate from a given position.
        Parameters:
        position - The position of the plate, starting at 0
        Returns:
        The plate or null if the position couldn't be found
      • getNumPlates

        public int getNumPlates()
        The number of plates connected to this array design.
        Returns:
        The number of plates.
      • setPlateList

        public void setPlateList​(List<Plate> plates)
                          throws PermissionDeniedException
        Set the list of plates to be used by this array design. If the logged in user lacks Permission.USE to any plate in the list no plates will be added.
        Parameters:
        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.
        Throws:
        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.
      • getArrayBatches

        public ItemQuery<ArrayBatch> getArrayBatches()
        Get a query that returns the batches for this design.
        Returns:
        An ItemQuery object
      • getFeatureBatcher

        public FeatureBatcher getFeatureBatcher​(FeatureIdentificationMethod fiMethod,
                                                Job job)
                                         throws PermissionDeniedException,
                                                BaseException
        Get a feature batcher which can be used to add regular features to the array design.

        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.

        Parameters:
        fiMethod - The method to use for identifying features
        job - The job that is currently running, or null if the feature import is not running as a job
        Returns:
        The feature batcher of the array design. If this method is called multiple times the fiMethod and job parameter is ignored and the same batcher as before is returned.
        Throws:
        PermissionDeniedException - If raw data has already been added or the logged in user doesn't have write permission
        BaseException - If there is another error
        Since:
        2.7
      • getFeatures

        public DataQuery<FeatureData> getFeatures()
        Get a query that returns the regular features of this array design.
        Returns:
        A DataQuery object
      • getReporters

        public DataQuery<ReporterData> getReporters()
        Get a query that returns the reporters on this array design. The query is rooted at the features, which means that:
        • All filters, sorting, etc. that works for getFeatures() can be used without modifications on this query.
        • The same reporter may be returned multiple times if it is present on several features.
        • 'Null' values may be returned if there are features without a reporter
        Returns:
        A DataQuery object
        Since:
        2.8
      • getFeatureById

        public FeatureData getFeatureById​(int id,
                                          boolean forceInitialization)
        Get a feature when you know the id.
        Parameters:
        id - The id of the feature
        forceInitialization - If TRUE the feature and associated reporter are sure to be initialized
        Throws:
        ItemNotFoundException - If the feature could not be found.
        BaseException - If something else fails when getting the feature
        Since:
        2.15
      • getNumDbFeatures

        public int getNumDbFeatures()
        Get the number of features on this array design that are stored in the database.
        Returns:
        The number of features or probesets
        Since:
        2.5
      • getNumFileFeatures

        public int getNumFileFeatures()
        Get the number of features on this array design that are stored inside files.
        Returns:
        The number of features or probesets
        Since:
        2.5
      • setNumFileFeatures

        public void setNumFileFeatures​(int numFeatures)
        Set the number of features that are stored in files.
        Parameters:
        numFeatures - The number of features
        Since:
        2.5