findBlock
Description
finds a block or vector of blocks from the block library blockObjects
= findBlock(lib
,blockNames
)lib
.
Examples
Find and Rename Bioinformatics Pipeline Blocks from Block Library
Import the pipeline, block, and library objects needed for the example.
import bioinfo.pipeline.library.* import bioinfo.pipeline.block.* import bioinfo.pipeline.Pipeline
Create a library and add it to the list of available libraries.
mylib = Library;
mylib.Name = "customLib";
addLibrary(mylib);
Create a FeatureCount
block and a FileChooser
block for a FASTQ file, that is provided with the toolbox and add to the library.
fcBlock = FeatureCount;
fastqfile = FileChooser(which("SRR005164_1_50.fastq"));
Add the blocks to the library. Name the blocks as "featurecount" and "fastqfile", respectively.
addBlock(mylib,fcBlock,"featurecount"); addBlock(mylib,fastqfile,"fastqfile");
Find a block by its name from the library.
b1 = findBlock(mylib,"featurecount")
b1 = FeatureCount with properties: Options: [1x1 bioinfo.pipeline.options.FeatureCountOptions] Inputs: [1x1 struct] Outputs: [1x1 struct] ErrorHandler: []
You can also search for multiple blocks.
bArray = findBlock(mylib,["fastqfile","featurecount"]); length(bArray)
ans = 2
Rename the "featurecount" block to "fcBlock".
renameBlock(mylib,"featurecount","fcBlock"); mylib.BlockNames
ans = 2x1 string
"fastqfile"
"fcBlock"
Input Arguments
lib
— Block library
bioinfo.pipeline.library.Library
Block library, specified as a bioinfo.pipeline.library.Library
object.
blockNames
— Names of blocks
character vector | string scalar | ...
Names of blocks to find, specified as a character vector, string scalar, string vector, or cell array of character vectors.
Data Types: char
| string
| cell
Output Arguments
blockObjects
— Block objects
bioinfo.pipeline.Block
object | vector of block objects
Block objects, returned as a bioinfo.pipeline.Block
object or a
vector of block objects.
Version History
Introduced in R2023b
Ouvrir l'exemple
Vous possédez une version modifiée de cet exemple. Souhaitez-vous ouvrir cet exemple avec vos modifications ?
Commande MATLAB
Vous avez cliqué sur un lien qui correspond à cette commande MATLAB :
Pour exécuter la commande, saisissez-la dans la fenêtre de commande de MATLAB. Les navigateurs web ne supportent pas les commandes MATLAB.
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)