Main Content

getMatePosition

Retrieve mate positions of read sequences from BioMap object

Description

example

MatePos = getMatePosition(BioObj) returns the mate positions of read sequences with respect to the position numbers in the reference sequence from BioObj.

example

MatePos = getMatePosition(BioObj,Subset) returns mate positions for only read sequences specified by Subset.

Examples

collapse all

Construct a BioMap object from a SAM file and determine the header for the 17th element.

BioObj = BioMap('ex1.sam');
hdr = BioObj.Header(17)
hdr = 1x1 cell array
    {'EAS114_32:5:78:583:499'}

Retrieve the MatePosition property of the 17th element in the object using the header.

MatePos_17 = getMatePosition(BioObj,hdr)
MatePos_17 = 2x1 uint32 column vector

   229
    37

Notice the previous example returned two mate positions. This is because the header EAS114_32:5:78:583:499 is a repeated header in the BMObj1 object. The getMatePosition method returns mate positions for all elements in the object with that header.

Retrieve the MatePosition properties of the 37th and 47th elements in the object.

MatePos_37_47 = getMatePosition(BioObj, [37 47])
MatePos_37_47 = 2x1 uint32 column vector

    95
   283

Retrieve the MatePosition properties of all elements in the object. Examine the size of the returned mate positions.

MatePos_All = getMatePosition(BioObj);
size(MatePos_All)
ans = 1×2

        1501           1

Input Arguments

collapse all

Object for read sequences, specified as a BioMap object. Construct BioObj using BioMap.

Subset of the elements in BioObj, specified as one of the following:

  • Vector of positive integers

  • Logical vector

  • Cell array of character vectors containing valid sequence headers

  • String vector containing valid sequence headers

Note

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

Example: [5 26]

Data Types: single | double | logical | char | string | cell

Output Arguments

collapse all

Mate positions of read sequences with respect to the position numbers in the reference sequence, returned as a vector of nonnegative integers. MatePos gives the MatePosition property of all or a subset of elements in BioObj.

Not all values in the MatePosition vector represent valid mate positions. For example, mates that map to a different reference sequence or mates that do not map. To determine if a mate position is valid, use the filterByFlag method with the 'pairedInMap' name-value argument.

Alternative Functionality

An alternative to using getMatePosition is to use dot indexing with the MatePosition property:

BioObj.MatePosition(Indices)

In this 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.

Version History

Introduced in R2010b