Bioinformatics pipeline block to sort SAM files
SamSort block enables you to sort alignment records from SAM
files by the reference sequence name first, and then by position within the
outFileName — Name of output file
string | character vector
Name of the output file, specified as a string or character vector. The file
extension must be
ErrorHandler — Function to handle errors from
Function to handle errors from the
run method of the block, specified as a function handle. It specifies the function to call if the run method encounters an error within a pipeline. In order for the pipeline to continue after a block fails,
ErrorHandler must return a structure compatible with the output ports of the block. The error handling function is called with the following two input arguments:
Structure with the following fields:
Field Description identifier Identifier of the error that occurred message Text of the error message index Linear index indicating which block process failed in the parallel run. By default, the index is always 1 because there is only one run per block. For details on how block inputs can be split across different dimensions for multiple run calls, see Bioinformatics Pipeline SplitDimension.
Input structure passed to the
runmethod when it failed.
Inputs — Input ports
This property is read-only.
Input ports of the block, specified as a structure. The field names of the structure are the names of the block input ports and the field values are
bioinfo.pipeline.Input objects. These objects describe the input port behaviors. The input port names are the expected field names of the input structure that you pass in for the block
Inputs structure has the
Outputs — Output ports
This property is read-only.
Output ports of the block, specified as a structure. The field
names of the structure are the names of the block output ports and the field values are
bioinfo.pipeline.Output objects. These objects describe the output port behaviors.
The output structure returned by the block
run method has the field names
that are the same as the output port names.
Outputs structure has the
OutFilename — Output file name
Output file name, specified as a string. If it is empty, the output file will have
the same base name as the input file with the extension
Sort SAM File Using
Sort a sample SAM file using a
import bioinfo.pipeline.block.* import bioinfo.pipeline.Pipeline FC = FileChooser(which("Myco_1_1.sam")); SS = SamSort; P = Pipeline; addBlock(P,[FC,SS]); connect(P,FC,SS,["Files","SAMFile"]); run(P); R = results(P,SS)
R = struct with fields: SortedSAMFile: [1×1 bioinfo.pipeline.datatypes.File]
SortedSAMFile to see the
location of the output file.
ans = "C:\PipelineResults\SamSort_1\1\Myco_1_1.sorted.sam"
Introduced in R2023a