Main Content

getSignature

Class: BioMap

Retrieve signature (alignment information) from BioMap object

Syntax

Signature = getSignature(BioObj)
Signature = getSignature(BioObj, Subset)

Description

Signature = getSignature(BioObj) returns Signature, a cell array of CIGAR-formatted strings, each representing how a read sequence in a BioMap object aligns to the reference sequence.

Signature = getSignature(BioObj, Subset) returns signature strings for only object elements specified by Subset.

Input Arguments

BioObj

Object of the BioMap class.

Subset

One of the following to specify a subset of the elements in BioObj:

  • Vector of positive integers

  • Logical vector

  • Cell array of character vectors or string vector containing valid sequence headers

Note

If you use a cell array of headers to specify Subset, be aware that a repeated header specifies all elements with that header.

Output Arguments

Signature

Signature property of a subset of elements in BioObj. Signature is a cell array of CIGAR-formatted strings, each representing how read sequences, specified by Subset, align to the reference sequence.

Examples

Construct a BioMap object, and then retrieve the signatures for different elements in the object:

% Construct a BioMap object from a SAM file 
BMObj1 = BioMap('ex1.sam');
% Retrieve the signature property of the second element in
% the object
Sig_2 = getSignature(BMObj1, 2)
Sig_2 = 

    '35M'
% Retrieve the signature properties of the first and third
% elements in the object
Sig_1_3 = getSignature(BMObj1, [1 3])
Sig_1_3 = 

    '36M'
    '35M'
% Retrieve the signature properties of all elements in the object
Sig_All = getSignature(BMObj1);

Alternatives

An alternative to using the getSignature method is to use dot indexing with the Signature property:

BioObj.Sgnature(Indices)

In the previous syntax, Indices is a vector of positive integers or a logical vector. Indices cannot be a cell array of character vectors or string vector containing sequence headers.