completed
Syntax
Description
Examples
Access Bioinformatics Pipeline Partial Results
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 SeqTrim
block and add it to the pipeline.
seqTrimBlock = SeqTrim; addBlock(P,seqTrimBlock);
Specify two FASTQ files as the block inputs.
file1 = string(fullfile(which("SRR6008575_10k_1.fq"))); file2 = string(fullfile(which("SRR6008575_10k_2.fq"))); seqTrimBlock.Inputs.FASTQFiles.Value = [file1,file2];
Set SplitDimension
to 2 so that each file is processed independently using one process for each file.
seqTrimBlock.Inputs.FASTQFiles.SplitDimension = 2;
Run the pipeline.
run(P);
Get the block results. The block returns completed results for both files.
r1 = results(P,seqTrimBlock)
r1 = struct with fields:
TrimmedFASTQFiles: [1×2 bioinfo.pipeline.datatype.File]
NumTrimmed: [1495 1602]
NumUntrimmed: [8505 8398]
Display the total number of trimmed sequences for each file.
r1.NumTrimmed
ans = 1×2
1495 1602
Next specify a third FASTQ file, which is invalid. When you run the pipeline, the block returns partial results: two completed results for two valid files and one error for the invalid file.
file3 = "sample.fastq";
seqTrimBlock.Inputs.FASTQFiles.Value = [file1,file2,file3];
run(P);
r2 = results(P,seqTrimBlock)
r2 = Incomplete result (1x3) with the following outputs: TrimmedFASTQFiles NumTrimmed NumUntrimmed Not Run: 0 Complete: 2 Error: 1
Access the completed results of the valid files. First, use the completed
function first to get the indices of the completed processes, and then use those indices to extract the results.
validIdx = completed(r2); r2.NumTrimmed(validIdx)
ans = 1×2
1495 1602
You can use unwrap
to see the location of the trimmed FASTQ files.
unwrap(r2.TrimmedFASTQFiles(validIdx))'
Input Arguments
results
— Partial block results
bioinfo.pipeline.datatype.Incomplete
object
Partial block results, specified as a bioinfo.pipeline.datatype.Incomplete
object. The object is returned when you
call the results
function of a pipeline after you run the pipeline.
Output Arguments
LIP
— Logical index for completed processes
logical array
Logical index for completed processes, returned as a logical array. A logical value
of 1
in the array indicates that the corresponding process is
completed and a value of 0
indicates otherwise.
Data Types: logical
Version History
Introduced in R2024b
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 (한국어)