Main Content

findBlock

Get block objects from bioinformatics pipeline

Since R2023a

Description

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

example

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

example

Examples

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)
allBlocks=2×1 object
  2×1 heterogeneous Block (FileChooser, SamSort) array with properties:

    Inputs
    Outputs
    ErrorHandler

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"])
b1_2=2×1 object
  2×1 heterogeneous Block (FileChooser, SamSort) array with properties:

    Inputs
    Outputs
    ErrorHandler

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