getCoverage
Class: BioMap
Compute read coverage in BioMap object
Note
getCoverage has been removed. Use getBaseCoverage, getCounts, or getIndex instead.
Syntax
Cov = getCoverage(BioObj, StartPos, EndPos)
[Cov, Indices]
= getCoverage(BioObj, StartPos, EndPos)
[Cov, Indices, Seqs]
= getCoverage(BioObj, StartPos, EndPos)
... = getCoverage(BioObj, StartPos, EndPos,
'ParameterName', ParameterValue)
Description
returns Cov = getCoverage(BioObj, StartPos, EndPos)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.
[
also returns Cov, Indices]
= getCoverage(BioObj, StartPos, EndPos)Indices, a vector of indices specifying the read
sequences that align within a specific region of the reference sequence.
[
also returns Cov, Indices, Seqs]
= getCoverage(BioObj, StartPos, EndPos)Seqs, a cell array of strings containing the
read sequences that align within a specific region of the reference sequence.
... = getCoverage(
accepts one or more comma-separated parameter name/value pairs. Specify
BioObj, StartPos, EndPos,
'ParameterName', ParameterValue)ParameterName inside single quotes.
Input Arguments
| Object of the |
| Either of the following:
|
| Either of the following:
|
Name-Value Arguments
Output Arguments
| Either of the following:
|
| Vector of indices specifying the read sequences from
|
| Cell array of strings containing the read sequences from
|
Examples
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
5Tips
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.