Documentation Center

  • Trial Software
  • Product Updates

getData

Class: GFFAnnotation

Create structure containing subset of data from GFFAnnotation object

Syntax

AnnotStruct = getData(AnnotObj)
AnnotStruct = getData(AnnotObj,StartPos,EndPos)
AnnotStruct = getData(AnnotObj,Subset)
AnnotStruct = getData(___,Name,Value)

Description

AnnotStruct = getData(AnnotObj) returns AnnotStruct, an array of structures containing data from all elements in AnnotObj. The fields in the return structures are the same as the elements in the FieldNames property of AnnotObj.

AnnotStruct = getData(AnnotObj,StartPos,EndPos) returns AnnotStruct, an array of structures containing data from a subset of the elements in AnnotObj that falls within each reference sequence range specified by StartPos and EndPos.

AnnotStruct = getData(AnnotObj,Subset) returns AnnotStruct, an array of structures containing subset of data from AnnotObj specified by Subset, a vector of integers.

AnnotStruct = getData(___,Name,Value) returns AnnotStruct, an array of structures, using any of the input arguments in the previous syntaxes and additional options specified by one or more Name,Value pair arguments.

Tips

Using getData creates a structure, which provides better access to the annotation data than an object.

  • You can access all field values in a structure.

  • You can extract, assign, and delete field values.

  • You can use linear indexing to access field values of specific annotations. For example, you can access the start value of only the fifth annotation.

Input Arguments

AnnotObj

Object of the GFFAnnotation class.

StartPos

Nonnegative integer specifying the start of a range in each reference sequence in AnnotObj. The integer StartPos must be less than or equal to EndPos.

EndPos

Nonnegative integer specifying the end of a range in each reference sequence in AnnotObj. The integer EndPos must be greater than or equal to StartPos.

Subset

Vector of positive integers less than or equal to the number of entries in the object. Use the vector Subset to retrieve any element or subset of data from the object.

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside single quotes (' '). You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

'Reference'

String or cell array of strings specifying one or more reference sequences in AnnotObj. Only annotations whose reference field matches one of the strings are included in AnnotStruct.

'Feature'

String or cell array of strings specifying one or more features in AnnotObj. Only annotations whose feature field matches one of the strings are included in AnnotStruct.

'Overlap'

Minimum number of base positions that an annotation must overlap in the range, to be included in AnnotStruct. This value can be any of the following:

  • Positive integer

  • 'full' — An annotation must be fully contained in the range to be included.

  • 'start' — An annotation's start position must lie within the range to be included.

Default: 1

Output Arguments

AnnotStruct

Array of structures containing data from elements in AnnotObj. The fields in the return structures are the same as the elements in the FieldNames property of AnnotObj, and specified by GFF (General Feature Format) specifications document. Specifically, these fields are:

  • Reference

  • Start

  • Stop

  • Feature

  • Source

  • Score

  • Strand

  • Frame

  • Attributes

Examples

Retrieve Subsets of Data from a GFFAnnotation Object

Construct a GFFAnnotation object using a GFF-formatted file that is provided with Bioinformatics Toolbox™.

GFFAnnotObj = GFFAnnotation('tair8_1.gff');

Extract annotations for positions 10,000 through 20,000 from the reference sequence.

AnnotStruct1 = getData(GFFAnnotObj,10000,20000)
AnnotStruct1 = 

9x1 struct array with fields:
    Reference
    Start
    Stop
    Feature
    Source
    Score
    Strand
    Frame
    Attributes

Extract the first five annotations from the object.

AnnotStruct2 = getData(GFFAnnotObj,[1:5])

AnnotStruct2 = 

5x1 struct array with fields:
    Reference
    Start
    Stop
    Feature
    Source
    Score
    Strand
    Frame
    Attributes

See Also

How To

Related Links

Was this topic helpful?