Main Content

renameBlock

Rename block in pipeline

Since R2023a

Description

example

renameBlock(pipeline,block,name) sets the name of the block to the specified name.

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 a FileChooser block.

FCB = FileChooser(which("ex1.bam"));

Add the block to the pipeline and set the block name to "File".

addBlock(p,FCB,"File");

Rename the block. Use the existing block name to reference the block to be renamed.

renameBlock(p,"File","BamFile");
p.BlockNames
ans = 
"BamFile"

Alternatively, you can use the block object itself.

renameBlock(p,FCB,"Ex1Bam");
p.BlockNames
ans = 
"Ex1Bam"

Input Arguments

collapse all

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

Pipeline block, specified as a bioinfo.pipeline.Block object, character vector, or string scalar, representing the current block name.

New block name, specified as a character vector or string scalar. The name must be a valid variable name and must be unique within a pipeline.

Version History

Introduced in R2023a