Main Content

getMappingQuality

Class: BioMap

Retrieve sequence mapping quality scores from BioMap object

Syntax

MappingQuality = getMappingQuality(BioObj)
MappingQuality = getMappingQuality(BioObj, Subset)

Description

MappingQuality = getMappingQuality(BioObj) returns MappingQuality, a vector of integers specifying mapping quality scores for each read sequence in BioObj, a BioMap object.

MappingQuality = getMappingQuality(BioObj, Subset) returns mapping quality scores 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

MappingQuality

MappingQuality property of a subset of elements in BioObj. MappingQuality is a vector of integers specifying the mapping quality scores for read sequences specified by Subset.

Examples

Construct a BioMap object, and then retrieve the mapping quality scores for different elements in the object:

% Construct a BioMap object from a SAM file 
BMObj1 = BioMap('ex1.sam');
% Retrieve the mapping quality property of the second element in
% the object
MQ_2 = getMappingQuality(BMObj1, 2)
MQ_2 =

   99
% Retrieve the mapping quality properties of the first and third
% elements in the object
MQ_1_3 = getMappingQuality(BMObj1, [1 3])
MQ_1_3 =

   99
   99
% Retrieve the mapping quality properties of all elements in the
% object
MQ_All = getMappingQuality(BMObj1);

Alternatives

An alternative to using the getMappingQuality method is to use dot indexing with the MappingQuality property:

BioObj.MappingQuality(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.