Main Content


Retrieve sequence headers from object



headers = getHeader(object) returns sequence headers (names) from a BioRead or BioMap object.


subsetHeaders = getHeader(object,subset) returns the header information subsetHeaders for only the object elements specified by subset.


collapse all

Store read data from a SAM-formatted file in a BioRead object.

br = BioRead('ex1.sam')
br = 
  BioRead with properties:

     Quality: [1501x1 File indexed property]
    Sequence: [1501x1 File indexed property]
      Header: [1501x1 File indexed property]
       NSeqs: 1501
        Name: ''

Retrieve sequence header information.

allHeaders = getHeader(br);

Retrieve sequence header information from the first and third elements in the object.

subset = getHeader(br,[1 3])
subset = 2x1 cell

Use a logical vector to get the same information.

subset2 = getHeader(br,[true false true])
subset2 = 2x1 cell

Access each property of the object by using the dot notation.

allHeaders  = br.Header;
subset      = br.Header([1 3])
subset = 2x1 cell

Input Arguments

collapse all

Object containing the read data, specified as a BioRead or BioMap object.

Example: bioreadObj

Subset of elements in the object, specified as a vector of positive integers, logical vector, string vector, or cell array of character vectors containing valid sequence headers.

Example: [1 3]

Output Arguments

collapse all

Sequence headers, returned as a cell array of character vectors.

Sequence headers for a subset of elements from the object, returned as a cell array of character vectors.

Version History

Introduced in R2010a