Class: BioRead

Set elements for object


NewObj = setSubset(BioObj, Elements, Subset)


NewObj = setSubset(BioObj, Elements, Subset) returns NewObj, a new object, created from BioObj, an existing object, with a subset of the elements in BioObj set to Elements, an object containing the appropriate number of elements. setSubset sets the object elements specified by Subset.


To update an existing object, use the same object as the input BioObj and the output NewObj.

Input Arguments


Object of the BioRead or BioMap class.

    Note:   If BioObj was constructed from a BioIndexedFile object, you cannot modify it.


BioRead or BioMap object containing a number of elements equal to the number of elements specified by 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:   A one-to-one relationship must exist between the number and order of elements in Elements and Subset. If you use a cell array of header strings to specify Subset, be aware that a repeated header specifies all elements with that header.

Output Arguments


Object of the BioRead or BioMap class.


Construct a BioRead object, and then set a subset of the elements in the object:

% Construct two BioRead objects, one with 10 elements, and one
% with 2 elements
struct1 = fastqread('SRR005164_1_50.fastq',...
                    'blockread', [1 10], 'trimheaders', true);
struct2 = fastqread('SRR005164_1_50.fastq',...
                    'blockread', [11 12], 'trimheaders', true);
BRObj1 = BioRead(struct1);
BRObj2 = BioRead(struct2);
% Replace the first two elements in BRObj1 with the elements
% in BRObj2
BRObj1 = setSubset(BRObj1, BRObj2, 1:2);
Was this topic helpful?