bioinfo.pipeline.block.Load
Description
A Load
block enables you to load variables from a MAT-file into a
pipeline.
Creation
Description
creates a
b
= bioinfo.pipeline.block.LoadLoad
block.
specifies additional options using one or more name-value arguments. The name-value
arguments set the property names and values of a b
= bioinfo.pipeline.block.Load(Name=Value
)Load
block.
Properties
ErrorHandler
— Function to handle errors from run
method
[]
(default) | function handle
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:
Field Description identifier Identifier of the error that occurred message Text of the error message index Linear 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
Inputs
— Input ports
structure
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
Outputs
— Output ports
structure
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
Variables
— Names of variables to load
"-all"
(default) | character vector | string scalar | ...
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
compile | Perform block-specific additional checks and validations |
copy | Copy array of handle objects |
emptyInputs | Create input structure for use with run method |
eval | Evaluate block object |
run | Run block object |
Examples
Load and Plot Gene Expression Data in Bioinformatics Pipeline
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
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)