portMap
Description
returns the names of connected ports between portnames
= portMap(pipeline
,sourceBlock
,targetBlock
)sourceBlock
and
targetBlock
in the pipeline
.
Examples
Connect Blocks in Bioinformatics Pipeline
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"));
Create a SeqFilter
block.
sequencefilter = SeqFilter;
Add blocks to the pipeline. Optionally, you can specify the block names.
addBlock(qcpipeline,[fastqfile,sequencefilter],["FF","SF"]);
Connect the output of the first block to the input of the second block. To do so, you need to first check the input and output port names of the corresponding blocks.
View the Outputs (port of the first block) and Inputs (port of the second block).
fastqfile.Outputs
ans = struct with fields:
Files: [1×1 bioinfo.pipeline.Output]
sequencefilter.Inputs
ans = struct with fields:
FASTQFiles: [1×1 bioinfo.pipeline.Input]
Connect the Files
output port of the fastqfile
block to the FASTQFiles
port of sequencefilter
block. The output is a 1-by-2 string array, indicating the names of two ports that are now connected. You can use either the block objects themselves or the block names that you have defined previously. The next command uses the block names to identify and connect these two blocks.
connectedports = connect(qcpipeline,"FF","SF",["Files","FASTQFiles"])
connectedports = 1×2 string
"Files" "FASTQFiles"
You can also query the names of connected ports using portMap
.
portnames = portMap(qcpipeline,"FF","SF")
portnames = 1×2 string
"Files" "FASTQFiles"
Input Arguments
pipeline
— Bioinformatics pipeline
bioinfo.pipeline.Pipeline
object
Bioinformatics pipeline, specified as a bioinfo.pipeline.Pipeline
object.
sourceBlock
— Block in pipeline
bioinfo.pipeline.Block
object | character vector | string scalar
Block in the pipeline, specified as a scalar bioinfo.pipeline.Block
object or a character vector or string scalar that
represents a block name.
targetBlock
— Block in pipeline
bioinfo.pipeline.Block
object | character vector | string scalar
Block in the pipeline, specified as a bioinfo.pipeline.Block
object or a character vector or string scalar that
represents a block name.
Output Arguments
portnames
— Connected port names
string array
Connected port names, specified as an N-by-2 string array, where
N is the number of connections. Each row of
portnames
is a connection. For instance, for the
nth connection,
portnames(n,1)
is the name of an output port of a source
block and portnames(n,2)
is the name of the input
port of a target block.
Version History
Introduced in R2023a
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 (한국어)