Main Content

addBlock

Add blocks to pipeline

Since R2023a

Description

example

addBlock(pipeline,inBlocks) adds a block or vector of blocks inBlocks to pipeline, a bioinfo.pipeline.Pipeline object.

example

addBlock(pipeline,inBlocks,blockNames) also specifies the corresponding block name or vector of block names blockNames.

addedBlocks = addBlock(___), for any syntax, returns the added block or vector of blocks outBlocks as a bioinfo.pipeline.Block object or vector of such objects.

Examples

collapse all

Import the Pipeline and block objects needed for the example.

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

Create a pipeline.

qcpipeline = Pipeline;

Select an input FASTQ file using a FileChooser block.

fastqfile = FileChooser(which("SRR005164_1_50.fastq"));

Add the fastqfile block to the pipeline.

addBlock(qcpipeline,fastqfile);

By default, if you do not provide the block name, the pipeline gives a unique and valid variable name for the block when the block is added to the pipeline.

qcpipeline.BlockNames
ans = 
"FileChooser_1"

Add the sequence filter (SeqFilter) block to the pipeline. Optionally, you can provide the block name.

sequenceFilter = addBlock(qcpipeline,SeqFilter,"SF");
qcpipeline.BlockNames
ans = 2×1 string
    "FileChooser_1"
    "SF"

Input Arguments

collapse all

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

Input blocks, specified as a bioinfo.pipeline.Block object or vector of such objects. Each block gets assigned a unique name unless you provide blockNames as the third input argument.

Names of input blocks, specified as a character vector, string scalar, string vector, or cell array of character vectors.

If inBlocks is a single block, blockNames must be a character vector or string scalar. Otherwise, blockNames must be a string vector or cell array of character vectors with the same number of elements as inBlocks. The block names must be valid variable names and must be unique within a pipeline.

Data Types: char | string | cell

Output Arguments

collapse all

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

Version History

Introduced in R2023a