Class Transformation

    • Field Detail

      • job

        private Job job
      • namedCubes

        private Map<String,​DataCube> namedCubes
        Internal cache of named cubes used by the newProduct method.
      • namedLayers

        private Map<String,​DataCubeLayer> namedLayers
        Internal cache of named layers used by the newProduct method.
    • Constructor Detail

      • Transformation

        Transformation​(TransformationData data)
        Creates a new experiment item from the given data.
        Parameters:
        data - the data
    • Method Detail

      • 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
      • getName

        public String getName()
        Description copied from interface: Nameable
        Get the name of the item.
        Specified by:
        getName in interface Nameable
        Returns:
        A String with the name of the item
      • getDescription

        public String getDescription()
        Description copied from interface: Nameable
        Get the description for the item.
        Specified by:
        getDescription in interface Nameable
        Returns:
        A String with a description of the item
      • isRemoved

        public boolean isRemoved()
        Description copied from interface: Removable
        Check if the removed flag is set for this item.
        Specified by:
        isRemoved in interface Removable
        Returns:
        TRUE if the item is flagged as removed, FALSE otherwise
      • setExperiment

        private void setExperiment​(Experiment experiment)
        Set the experiment. This cannot be changed after the transformation has been created.
      • getRawSources

        public ItemQuery<RawBioAssay> getRawSources()
        Get a query that returns the raw bioassay sources used by this transformation. It is only a root transformation that has raw bioassays as sources, other transformations has a source BioAssaySet.
        Returns:
        An ItemQuery object
        See Also:
        getSource()
      • setJob

        private void setJob​(Job job)
        Set the job that executed this transformation. Once set it can't be changed.
      • newProduct

        public BioAssaySet newProduct​(String namedCube,
                                      String namedLayer,
                                      boolean createChildBioAssays)
                               throws PermissionDeniedException,
                                      InvalidDataException,
                                      BaseException
        Create a new product bioassayset from this transformation. The transformation mustn't have been committed to the database. The bioassayset can use either the same data cube/layer as the source bioassayset is using, a new data cube/layer or a data cube/layer that has previously been created by this method. The names specified here are only valid for the current session and are only needed if the transformation must create more than one bioassayset in a different data cube than it's source bioassayset.
        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);
        
        Parameters:
        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
        Returns:
        The new bioassayset
        Throws:
        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 error
      • deleteProducts

        private void deleteProducts()
        Delete all product bioassaysets. Called by onBeforeCommit when the transformation is deleted.