getSubsequence

Class: BioRead

Retrieve partial sequences from object

Syntax

Subsequences = getSubsequence(BioObj, Subset, Positions)

Description

Subsequences = getSubsequence(BioObj, Subset, Positions) returns Subsequences, a cell array of strings containing the letter representations of partial nucleotide sequences from an object. getSubsequence returns sequence strings for only object elements specified by Subset and for only sequence positions specified by Positions.

Input Arguments

BioObj

Object of the BioRead or 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 strings containing valid sequence headers

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

Positions

One of the following to specify a subset of positions in a sequence:

  • Vector of positive integers

  • Logical vector

    Note:   The last position specified by Positions must be within the range of positions for each sequence specified by Subset.

Output Arguments

SubSequences

Cell array of strings containing the partial sequences specified by Subset and Positions in BioObj.

Examples

Retrieve subsequences from different elements of a BioRead object:

% Construct a BioRead object from a FASTQ file 
BRObj = BioRead('SRR005164_1_50.fastq');
% Retrieve the first five positions of the first three sequences in
% the object
getSubsequence(BRObj, 1:3, 1:5)
% Retrieve the first five positions of the sequence with a header
% of SRR005164.3
getSubsequence(BRObj, 'SRR005164.3', 1:5)
Was this topic helpful?