get

Class: BioRead

Retrieve property of object

Syntax

Struct = get(BioObj)
PropValues = get(BioObj, PropertyName)

Description

Struct = get(BioObj) returns a MATLAB® structure containing a field for each property of an object. Each field contains the current value of that property.

PropValues = get(BioObj, PropertyName) returns the value(s) of the property or properties specified by PropertyName, a string or cell array of strings specifying property names of BioObj. PropValues is a single property value or a cell array of property values.

Tips

  • Use the get method to determine all the object properties and their current values.

  • Specific get methods are also available for each property such as BioRead.getHeader, BioRead.getSequence, and BioRead.getQuality. Some of these specific get methods let you access all or a subset of a property.

Input Arguments

BioObj

Object of the BioRead or BioMap class.

PropertyName

Either of the following:

  • String specifying the name of a property of the class

  • Cell array of strings specifying the names of properties of the class

Output Arguments

Struct

MATLAB structure with a field for each property of an object. Each field contains the current value of that property.

PropValues

Single property value or a cell array of property values.

Examples

Retrieve properties from 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 values of the 'Header' property
get(BRObj, 'Header')
ans = 

    'H1'
    'H2'
    'H3'
% Retrieve the values of the 'Sequence' and 'Quality' properties
get(BRObj, {'Sequence', 'Quality'});

Transform a BioRead object into a MATLAB structure:

% Return a MATLAB structure containing a field for each property of
% a BioRead object
BRStruct = get(BRObj)
BRStruct = 

     Quality: {3x1 cell}
    Sequence: {3x1 cell}
      Header: {3x1 cell}
       NSeqs: 3
        Name: ''
Was this topic helpful?