Documentation

This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the page.

setReference

Class: BioMap

Set name of reference sequence for BioMap object

Syntax

NewObj = setReference(BioObj, Reference)

Description

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

Tips

Rename the reference sequence of an existing BioMap object, by using the same object as the input BioObj and the output NewObj.

Input Arguments

BioObj

Object of the BioMap class.

Reference

Character vector specifying the name of the reference sequence.

Output Arguments

NewObj

Object of the BioMap class.

Examples

Construct a BioMap object, and then set the reference sequence to a new sequence:

% Construct a BioMap object from a SAM file 
BMObj1 = BioMap('ex1.sam');
% Create a random reference sequence
newRefSeq = randseq(50);
% Set the Reference property of the object
BMObj1 = setReference(BMObj1, newRefSeq);

Alternatives

An alternative to using the setReference method to update an existing object is to use dot indexing with the Reference property:

BioObj.Reference = NewReference

In the previous syntax, NewReference is a character vector of single-letter codes specifying a reference sequence.

Was this topic helpful?