Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

getHeader

Class: BioRead

Retrieve sequence headers from object

Syntax

Headers = getHeader(BioObj)
Headers = getHeader(BioObj, Subset)

Description

Headers = getHeader(BioObj) returns Headers, a cell array of character vectors containing sequence headers from an object.

Headers = getHeader(BioObj, Subset) returns header information for only object elements specified by Subset.

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 character vectors 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

Headers

Cell array of character vectors containing the sequence headers specified by Subset in BioObj.

Examples

Retrieve the headers from different elements of a BioRead object:

% Create variables containing sequences, quality scores, and headers
seqs = {randseq(10); randseq(15); randseq(20)};
quals = {repmat('!', 1, 10); repmat('%', 1, 15); repmat('&', 1, 20)};
headers = {'H1'; 'H2'; 'H3'};
% Construct a BioRead object from these three variables
BRObj = BioRead(seqs, quals, headers);
% Retrieve the Header value of the second element in the object
getHeader(BRObj, 2);
getHeader(BRObj, [false true false]);
% Retrieve the Header values of the first and third elements in the
% object
getHeader(BRObj, [1 3]);
getHeader(BRObj, [true false true]);
% Retrieve the Header value of all the elements in the object
getHeader(BRObj);
getHeader(BRObj, 1:3);

Alternatives

An alternative to using the getHeader method is to use dot indexing with the Header property:

BioObj.Header(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 containing sequence headers.

Was this topic helpful?