setReference

Class: BioMap

Set name of reference sequence for BioMap object

Description

newObj = setReference(Obj,RefSeqName) returns a new BioMap object newObj, constructed from an existing object Obj, with the Reference property set to RefSeqName, a character vector or string specifying the name of the reference sequence.

newObj = setReference(Obj,RefSeqName,Indices) sets the Reference property of the elements indexed by Indices to RefSeqName.

Input Arguments

expand all

Object of the BioMap class, specified as a BioMap object.

Name of reference sequence, specified as a character vector, string, string vector, or cell array of character vectors.

Indices to the elements of the input object, specified as a positive integer, vector of positive integers, logical array, character vector, string, string vector, or cell array of character vectors. For character vectors or strings, they must correspond to the valid Header values of the input object Obj.

Output Arguments

expand all

Object of the BioMap class, returned as a BioMap object.

Examples

expand all

Create a BioMap object from a SAM file. Set 'InMemory' to true to allow modifying the object properties.

bm = BioMap('ex2.sam','InMemory',true);

Check the reference sequence of the 5th read sequence.

bm.Reference(5)
ans = 1x1 cell array
    {'seq1'}

Change the reference sequence to another one in the sequence dictionary.

bm2 = setReference(bm,{'seq2'},5);
bm2.Reference(5)
ans = 1x1 cell array
    {'seq2'}