Main Content

bioinfo.pipeline.block.Load

Load data from MAT-file into pipeline

Since R2024b

  • load block icon

Description

A Load block enables you to load variables from a MAT-file into a pipeline.

Creation

Description

b = bioinfo.pipeline.block.Load creates a Load block.

example

b = bioinfo.pipeline.block.Load(Name=Value) specifies additional options using one or more name-value arguments. The name-value arguments set the property names and values of a Load block.

Properties

expand all

Function to handle errors from the run method of the block, specified as a function handle. The handle specifies the function to call if the run method encounters an error within a pipeline. For the pipeline to continue after a block fails, ErrorHandler must return a structure that is compatible with the output ports of the block. The error handling function is called with the following two inputs:

  • Structure with these fields:

    FieldDescription
    identifierIdentifier of the error that occurred
    messageText of the error message
    indexLinear index indicating which block process failed in the parallel run. By default, the index is 1 because there is only one run per block. For details on how block inputs can be split across different dimensions for multiple run calls, see Bioinformatics Pipeline SplitDimension.

  • Input structure passed to the run method when it fails

Data Types: function_handle

This property is read-only.

Input ports of the block, specified as a structure. The field names of the structure are the names of the block input ports, and the field values are bioinfo.pipeline.Input objects. These objects describe the input port behaviors. The input port names are the expected field names of the input structure that you pass to the block run method.

The Load block Inputs structure has a field named MatFile, which represents the name of a MAT-file. This input is required and must be satisfied.

Data Types: struct

This property is read-only.

Output ports of the block, specified as a structure. The field names of the structure are the names of the block output ports, and the field values are bioinfo.pipeline.Output objects. These objects describe the output port behaviors. The field names of the output structure returned by the block run method are the same as the output port names.

The Load block Outputs structure has a field named AllVariables, and the value is a bioinfo.pipeline.Output object. If you specify variables in the Variables property, the Outputs structure contains fields named after the variables.

Data Types: struct

Names of variables to load from the MAT-file, specified as a character vector, string scalar, string vector, or cell array of character vectors. By default, the value is "-all", which specifies to load all variables from the MAT-file and return them as fields of a structure after you run the block.

Setting this property specifies the output ports of the block. For instance, if the property value is ["X","Y"], then the block has two output ports named X and Y, and running the block loads "X" and "Y" variables from the MAT-file.

Object Functions

compilePerform block-specific additional checks and validations
copyCopy array of handle objects
emptyInputsCreate input structure for use with run method
evalEvaluate block object
runRun block object

Examples

collapse all

Create a Bioinformatics pipeline.

P = bioinfo.pipeline.Pipeline;

Create a Load block to load sample sequence data from filteredyeastdata.mat, which is provided with the software. The MAT-file contains three variables: yeastvalues, genes, and times, representing filtered yeast microarray data with gene expression levels mesured at seven time points during the diauxic shift.

lb = bioinfo.pipeline.block.Load;
addBlock(P,lb);

Set the MatFile property to the name of the input MAT-file.

lb.Inputs.MatFile.Value = which(fullfile("filteredyeastdata.mat"));

Set the Variables property to the names of the variables saved in the MAT-file. Setting this property specify the output ports of the block. When you run the pipeline, the corresponding variables from the MAT-file are loaded.

lb.Variables = ["yeastvalues","genes","times"];

Create a UserFunction block to create a pricipal component analysis PCA plot of the microarray data. The first input of the block is the expression data, and the second input is the gene labels.

pcaplotBlock = bioinfo.pipeline.block.UserFunction;
pcaplotBlock.Function = "mapcaplot";
pcaplotBlock.RequiredArguments = ["expData","labels"];
addBlock(P,pcaplotBlock);
connect(P,lb,pcaplotBlock,["yeastvalues","expData";"genes","labels"]);

Run the pipeline to see the PCA plot.

run(P);

Version History

Introduced in R2024b