Main Content

bioinfo.pipeline.datatype.Incomplete

Incomplete pipeline result object

Since R2023a

Description

A bioinfo.pipeline.datatype.Incomplete object is the value returned by the results function when the block result is not yet computed, or when the block contains partial results.

If the block contains partially computed results, the returned Incomplete object shows the number of processes that did not run, the number completed, and the number that encountered an error. An example output is shown below.

Incomplete result (1x3) with the following outputs:

    TrimmedFASTQFiles
    NumTrimmed
    NumUntrimmed


  Not Run:  0
  Complete: 1
  Error:    2
You can also access the results from completed processes. For an example, see Access Bioinformatics Pipeline Partial Results.

Creation

The Incomplete object is returned when you call the results function of a pipeline after you run the pipeline, and the block processes are not all completed.

Object Functions

completedGet indices of completed processes

Examples

collapse all

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 FileChooser block that takes in a SAM file as an input.

samFile = FileChooser(which("Myco_1_1.sam"));

Create a SeqTrim block.

trimsequences = SeqTrim;

Add blocks to the pipeline.

addBlock(P,[samFile,trimsequences]);

Check the names of the output port and input port of the blocks to connect.

samFile.Outputs
ans = struct with fields:
    Files: [1x1 bioinfo.pipeline.Output]

trimsequences.Inputs
ans = struct with fields:
    FASTQFiles: [1x1 bioinfo.pipeline.Input]

Connect the ports.

connect(P,samFile,trimsequences,["Files","FASTQFiles"]);

The block returns an incomplete result as the block has not yet run.

results(P,trimsequences)
ans = 
  Incomplete result (0x0) with the following outputs:

    TrimmedFASTQFiles
    NumTrimmed
    NumUntrimmed


  Not Run:  0
  Complete: 0
  Error:    0

Run the pipeline and check the run status of each block in the process table. The samFile block had no error, but the SeqTrim block generated an error as indicated by the Status column. The SeqTrim block generated an error because it was expecting a FASTQ file as an input but received a SAM file instead.

run(P);
t = processTable(P,Expanded=true)
t=2×5 table
         Block          Status            RunStart                 RunEnd              RunErrors    
    _______________    _________    ____________________    ____________________    ________________

    "FileChooser_1"    Completed    05-Sep-2024 19:52:35    05-Sep-2024 19:52:35    {0x0 MException}
    "SeqTrim_1"        Error        05-Sep-2024 19:52:36    05-Sep-2024 19:52:36    {1x1 MException}

You can see the printed error message at the MATLAB® command line. You can also enter the following commands to see the message.

seqTrimInfo = t(2,:);
seqTrimInfo.RunErrors{:}

Since R2024b

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))'

Version History

Introduced in R2023a

expand all