Documentation Center

  • Trial Software
  • Product Updates

setSubsequence

Class: BioRead

Set partial sequences for object

Syntax

NewObj = setSubsequence(BioObj, Subsequences, Subset, Positions)

Description

NewObj = setSubsequence(BioObj, Subsequences, Subset, Positions) returns NewObj, a new object, created from BioObj, an existing object, with the partial sequences, specified by Positions, of a subset of the elements in BioObj, set to Subsequences, a cell array of strings containing the letter representations of partial nucleotide sequences. setSubsequence sets the subsequences for only the object elements specified by Subset.

Tips

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

Input Arguments

BioObj

Object of the BioRead or BioMap class.

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

Subsequences

Cell array of strings containing the letter representations of partial nucleotide sequences. Each string must be the same length.

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 Subsequences 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.

Positions

Either of the following to indicate positions in the nucleotide sequences:

  • Vector of positive integers

  • Logical vector

The number of positions specified by Positions must equal the length of the strings in Subsequences.

Output Arguments

NewObj

Object of the BioRead or BioMap class.

Examples

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

% Construct a BioRead object from a FASTQ file 
BRObj = BioRead('SRR005164_1_50.fastq');
% Set the first five positions of the second sequence to NNNNN 
BRObj = setSubsequence(BRObj, {'NNNNN'}, 2, [1:5]);
BRObj = setSubsequence(BRObj, {'NNNNN'}, 'SRR005164.2', [1:5]);
% Set the 10th position of the first three sequences to X
BRObj = setSubsequence(BRObj, {'X', 'X', 'X'}, 1:3, 10);

See Also

| |

How To

Related Links

Was this topic helpful?