| Contents | Index |
Compute read coverage in BioMap object
Note getCoverage has been removed. Use getBaseCoverage, getCounts, or getIndex instead. |
Cov = getCoverage(BioObj, StartPos, EndPos)
[Cov, Indices]
= getCoverage(BioObj, StartPos, EndPos)
[Cov, Indices, Seqs]
= getCoverage(BioObj, StartPos, EndPos)
... = getCoverage(BioObj, StartPos, EndPos,
'ParameterName', ParameterValue)
Cov = getCoverage(BioObj, StartPos, EndPos) returns Cov, a nonnegative integer indicating the number of read sequences that cover (align within) a specific region of the reference sequence in BioObj, a BioMap object. The specific region of the reference sequence is defined by StartPos and EndPos. StartPos and EndPos can be two nonnegative integers such that StartPos is less than EndPos, and both are smaller than the length of the reference sequence. StartPos and EndPos can also be two column vectors representing a collection of regions of the reference sequence. In this case, Cov is a column vector of nonnegative integers indicating the number of read sequences that cover each region.
[Cov, Indices] = getCoverage(BioObj, StartPos, EndPos) also returns Indices, a vector of indices specifying the read sequences that align within a specific region of the reference sequence.
[Cov, Indices, Seqs] = getCoverage(BioObj, StartPos, EndPos) also returns Seqs, a cell array of strings containing the read sequences that align within a specific region of the reference sequence.
... = getCoverage(BioObj, StartPos, EndPos, 'ParameterName', ParameterValue) accepts one or more comma-separated parameter name/value pairs. Specify ParameterName inside single quotes.
Use the Indices output from the getCoverage method as input to other BioMap methods. Doing so lets you determine other information about the read sequences in the coverage region, such as header, start position, mapping quality, etc.
BioObj |
Object of the BioMap class. |
StartPos |
Either of the following:
|
EndPos |
Either of the following:
|
Construct a BioMap object, and then retrieve the coverage of the first 50 positions of the reference sequence:
% Construct a BioMap object from a SAM file
BMObj1 = BioMap('ex1.sam');
% Retrieve the number of sequences that cover the first 50
% positions of the reference sequence
cov = getCoverage(BMObj1, 1, 50)cov =
20Construct a BioMap object, and then retrieve the starting positions for the read sequences that cover the first 50 positions of the reference sequence:
% Construct a BioMap object from a SAM file
BMObj1 = BioMap('ex1.sam');
% Retrieve the number of sequences that cover the first 50
% positions of the reference sequence
% Also retrieve the indices of these sequences
[cov, idx] = getCoverage(BMObj1, 1, 50);
% Use the indices for these sequences to determine their start
% positions
startPositions = getStart(BMObj1, idx);Construct a BioMap object, and then retrieve the coverage of the first 50 positions of the reference sequence, considering only read sequences that align fully within the region:
% Construct a BioMap object from a SAM file
BMObj1 = BioMap('ex1.sam');
% Retrieve the number of sequences that cover the first 50
% positions of the reference sequence
% Consider only read sequences that align fully within the region
fullCov = getCoverage(BMObj1, 1, 50, 'full', true)fullCov =
8Construct a BioMap object, and then retrieve the coverage for the first 10 positions of the reference sequence, on a base-by-base basis:
% Construct a BioMap object from a SAM file
BMObj1 = BioMap('ex1.sam');
% Retrieve the number of sequences that cover each base position of
% the first 10 positions of the reference sequence
baseCov = getCoverage(BMObj1, 1, 10, 'base', true)baseCov =
1
1
2
2
3
4
4
4
5
5align2cigar | BioMap | cigar2align | getAlignment | getCompactAlignment

See how to analyze, visualize, and model biological data and systems using MathWorks products.
Get free kit| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |