Main Content


Get block objects from bioinformatics pipeline

Since R2023a



blockObjects = findBlock(pipeline) returns all blocks in the pipeline as the array of block objects blockObjs.


blockObjects = findBlock(pipeline,blockIdentifiers) returns only the blocks specified by blockIdentifiers.


collapse all

Import the pipeline and block objects needed for the example.

import bioinfo.pipeline.Pipeline
import bioinfo.pipeline.block.*

Create a pipeline.

P = Pipeline;

Create the FileChooser and SamSort blocks.

FCB = FileChooser(which("ex1.sam"));
SSB = SamSort;

Add blocks to the pipeline and connect them.

addBlock(P, [FCB, SSB],["fcb","ssb"]);
connect(P, FCB, SSB, ["Files", "SAMFile"]);

Get all the block objects in the pipeline.

allBlocks = findBlock(P)

Find blocks by their names.

b1 = findBlock(P,"ssb")
b1 = 
  SamSort with properties:

     OutFilename: [0×0 string]
          Inputs: [1×1 struct]
         Outputs: [1×1 struct]
    ErrorHandler: []

b1_2 = findBlock(P,["fcb","ssb"])

Input Arguments

collapse all

Bioinformatics pipeline, specified as a bioinfo.pipeline.Pipeline object.

Block identifiers, specified as a scalar bioinfo.pipeline.Block object or vector of block objects. You can also specify a character vector, string scalar, string vector, or cell array of character vectors, representing block names.

Output Arguments

collapse all

Block objects, returned as a bioinfo.pipeline.Block object or a vector of block objects.

Version History

Introduced in R2023a