disconnect
Syntax
Description
disconnect(
removes all connections between pipeline
,sourceBlock
,targetBlock
)sourceBlock
and
targetBlock
in the pipeline
.
removes the specified connections, portMaps
= disconnect(pipeline
,sourceBlock
,targetBlock
,portsToDisconnect
)portsToDisconnect
, between
sourceBlock
and targetBlock
.
portMaps
is the list of remaining connections between the blocks
after disconnecting the specified ports.
Examples
Disconnect 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.
P = Pipeline;
Create two FileChooser
blocks and a Bowtie2
block. The files represent pair-end read data for the Drosophila genome. These read files are already provided with the toolbox.
reads1 = FileChooser(which("SRR6008575_10k_1.fq")); reads2 = FileChooser(which("SRR6008575_10k_2.fq")); bowtie2Block = Bowtie2;
Add the blocks. Define the block names as "reads1","reads2", and "bowtie2" and add them in the same call.
addBlock(P,[reads1,reads2,bowtie2Block],["reads1","reads2","bowtie2"]);
Check the names of the output and input ports of the blocks to connect.
reads1.Outputs
ans = struct with fields:
Files: [1×1 bioinfo.pipeline.Output]
reads2.Outputs
ans = struct with fields:
Files: [1×1 bioinfo.pipeline.Output]
bowtie2Block.Inputs
ans = struct with fields:
IndexBaseName: [1×1 bioinfo.pipeline.Input]
Reads1Files: [1×1 bioinfo.pipeline.Input]
Reads2Files: [1×1 bioinfo.pipeline.Input]
The Bowtie2
block has two required and one optional inputs. Set the value of the first required input IndexBaseName
to "Dmel_chr4"
, which is the base name for the reference index files, which are provided with the toolbox, for the Drosophila genome.
bowtie2Block.Inputs.IndexBaseName.Value = "Dmel_chr4";
Because you are providing the pair-end (paired) read data, connect Reads1Files
to the Files
output of the reads1
block, which contains the first mate reads "SRR6008575_10k_1.fq" and connect Reads2Files
to the reads2
block that contains the second mate reads "SRR6008575_10k_2.fq". The Reads2Files
input is optional and is not needed if you have the single-end (unpaired) read data.
connect(P,reads1,bowtie2Block,["Files","Reads1Files"]); connect(P,reads2,bowtie2Block,["Files","Reads2Files"]);
Run the pipeline.
run(P);
The Bowtie2 block generates a SAM file as the output.
mappedReads = results(P,bowtie2Block)
mappedReads = struct with fields:
SAMFile: [1×1 bioinfo.pipeline.datatype.File]
Suppose you want to provide a single end read data to the bowtie2Block
. You can update the reads1
block to read in such a single end read file and disconnect the Reads2File
optional input of bowtie2Block. The disconnect
function returns an empty string array, which means that there are no more connection between two blocks.
reads1.Files = which("SRR005164_1_50.fastq"); disconnect(P,reads2,bowtie2Block,["Files","Reads2Files"])
ans = 0×2 empty string array
Alternatively, you can use portMap to check if there are any connections between two blocks.
portMap(P,reads2,bowtie2Block)
ans = 0×2 empty string array
You can then run the pipeline again.
run(P); mappedReads = results(P,bowtie2Block)
mappedReads = struct with fields:
SAMFile: [1×1 bioinfo.pipeline.datatype.File]
Input Arguments
pipeline
— Bioinformatics pipeline
bioinfo.pipeline.Pipeline
object
Bioinformatics pipeline, specified as a bioinfo.pipeline.Pipeline
object.
sourceBlock
— Source block
bioinfo.pipeline.Block
object | character vector | string scalar
Source block, specified as a bioinfo.pipeline.Block
object or character vector or string scalar
representing a block name.
targetBlock
— Target block
bioinfo.pipeline.Block
object | character vector | string scalar
Target block, specified as a bioinfo.pipeline.Block
object or character vector or string scalar
representing a block name.
Output Arguments
portsToDisconnect
— Remaining connections between source and target blocks
N-by-2 string array
Remaining connections between the source and target blocks, returned as an N-by-2 string array, where N is the total number of connections. The string array lists the names of output ports (of the source blocks) and input ports (of the target blocks) that are still connected.
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 (한국어)