Main Content

emptyInputs

Create input structure for use with run method

Since R2023a

Description

S = emptyInputs(blockObj) returns a scalar structure that you can then modify and use as an input for the block run method.

example

S = emptyInputs(blockObj,IncludeOptional=tf) specifies to also include the optional input ports as fields of S.

example

Examples

collapse all

Create a Bowtie2 block to map the read sequences to the reference sequence.

bowtie2block = bioinfo.pipeline.block.Bowtie2;

Use the emptyInputs method of the block to construct an input structure with field names prepopulated to match the names of required input port names of the block.

inStruct = emptyInputs(bowtie2block)
inStruct = struct with fields:
    IndexBaseName: []
      Reads1Files: []

Some of the built-in blocks have optional input ports. To see the names of these ports, set IncludeOptional=true. For instance, the Bowtie2 block has an optional input port (Reads2Files) that accepts files for the second mate reads when you have paired-end read data.

inStructAll = emptyInputs(bowtie2block,IncludeOptional=true)
inStructAll = struct with fields:
    IndexBaseName: []
      Reads1Files: []
      Reads2Files: []

Set the field values of the prepopulated structure. Specifically, set IndexBaseName to "Dmel_chr4", which is the base name for the reference index files for the Drosophila genome. Set Reads1Files to "SRR6008575_10k_1.fq" and Reads2Files to "SRR6008575_10k_2.fq". These files are already provided with the toolbox.

inStructAll.IndexBaseName = "Dmel_chr4";
inStructAll.Reads1Files   = "SRR6008575_10k_1.fq";
inStructAll.Reads2Files   = "SRR6008575_10k_2.fq";

Run the block using the structure as an input. The mapped results are saved as Aligned.sam in the current working directory.

run(bowtie2block,inStructAll);

Input Arguments

collapse all

Block object, specified as a scalar bioinfo.pipeline.Block object.

Flag to include optional input port names, specified as a numeric or logical 1 (true) or 0 (false). An optional inport port is an input port (bioinfo.pipeline.Input) with its Required property set to false.

Output Arguments

collapse all

Prepared input structure for the block run method, returned as a structure. The field names of the structure are the names of the required input ports of the block blockObj. The value of each field is set as an empty array [].

If you set IncludeOptional=true, the structure also contains the fields for optional input ports of the block.

Version History

Introduced in R2023a