Collection of blocks to use in bioinformatics pipelines
bioinfo.pipeline.library.Library object allows you to store
configured and custom pipeline blocks for use in bioinformatics pipelines. For more
information, see Bioinformatics Pipeline Block Libraries.
bioinfo.pipeline.library.Library to create a
Name — Block library name
"Untitled" (default) | character vector | string scalar
Block library name, specified as a character vector or string scalar. The library name must be a valid variable name.
Description — Block library description
"" (default) | character vector | string scalar
Block library description, specified as a character vector or string scalar. Use this property to add more information about the library.
BlockNames — Names of blocks in library
empty string array (default) | string scalar | string vector
This property is read-only.
Names of blocks in the library, specified as a string scalar or string vector.
You can define the block names when you add the blocks using
Blocks — Blocks in library
empty block array (default) |
bioinfo.pipeline.Block object | vector of block objects
This property is read-only.
Blocks in the library, specified as a
bioinfo.pipeline.Block or vector of block objects.
Create and Save Bioinformatics Pipeline Blocks in Block Libraries
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 pipeline.
P = Pipeline;
FileChooser block for a FASTQ file, that is provided with the toolbox, and add to the pipeline.
fastqfile = FileChooser(which("SRR005164_1_50.fastq")); addBlock(P,fastqfile);
Create a block library directly from the pipeline.
mylib = Library(P,Name="mylib")
mylib = Library with properties: Name: "mylib" Description: "" BlockNames: "FileChooser_1" Blocks: [1x1 bioinfo.pipeline.block.FileChooser]
Add a block to the library.
sequencefilter = SeqFilter(Method="MinLength"); addBlock(mylib,sequencefilter,"MinLengthSeqFilter");
Remove a block from the library.
Add a library to the list of available libraries.
You can also save a library as a MAT-file and share with others.
saveLibrary creates the corresponding MAT-file in the current folder. The MAT-file has the same base name as the library being saved. You may set
Overwrite=true to overwrite any existing library with the same name. For instance, the following call creates
mylib.mat in the current folder.
Instead of saving the file in the current directory, you can also specify an alternative location to save the file.
Load the library from the MAT-file.
mylib2 = loadLibrary("mylib.mat");
Create a new
SeqFilter block that filters sequences using their average base qualities instead. Add the block to mylib2 and rename the library.
mqseqfilter = SeqFilter(Method="MeanQuality"); addBlock(mylib,mqseqfilter,"MeanQuality"); mylib2.Name = "mylib2"
mylib2 = Library with properties: Name: "mylib2" Description: "" BlockNames: "FileChooser_1" Blocks: [1x1 bioinfo.pipeline.block.FileChooser]
Add mylib2 to the list of available libraries.
Get a list of all the available libraries.
availableLibs = getLibrary
availableLibs=1×2 object 1x2 Library array with properties: Name Description BlockNames Blocks
Remove the library
mylib from the list.
removeLibrary("mylib"); availableLibs = getLibrary
availableLibs = Library with properties: Name: "mylib2" Description: "" BlockNames: "FileChooser_1" Blocks: [1x1 bioinfo.pipeline.block.FileChooser]
Introduced in R2023b