getSubsequence
Retrieve partial sequences from object
Description
Examples
Retrieve Subsequences from NGS Data
Store read data from a SAM-formatted file in a BioRead object.
br = BioRead('ex1.sam')
br = BioRead with properties: Quality: [1501x1 File indexed property] Sequence: [1501x1 File indexed property] Header: [1501x1 File indexed property] NSeqs: 1501 Name: ''
Retrieve the sequences (reads) from the object.
seqs = getSequence(br);
Retrieve the first, third, and fifth sequences from the object.
seqs2 = getSequence(br,[1 3 5])
seqs2 = 3x1 cell
{'CACTAGTGGCTCATTGTAAATGTGTGGTTTAACTCG'}
{'AGTGGCTCATTGTAAATGTGTGGTTTAACTCGTCC' }
{'GCTCATTGTAAATGTGTGGTTTAACTCGTCCATGG' }
Retrieve the first five positions of those sequences.
seqs3 = getSubsequence(br,[1 3 5],[1:5])
seqs3 = 3x1 cell
{'CACTA'}
{'AGTGG'}
{'GCTCA'}
You can use a header to get the corresponding sequences with that header. If multiple sequences have the same header, the function returns all of those sequences.
Get the first five positions of the sequences with the header B7_591:4:96:693:509.
seqs4 = getSubsequence(br,{'B7_591:4:96:693:509'},[1:5])
seqs4 = 1x1 cell array
{'CACTA'}
Retrieve the first, fourth, and sixth positions of the first three sequences.
seq5 = getSubsequence(br,[1:3],[1 4 6])
seq5 = 3x1 cell
{'CTG'}
{'CGG'}
{'AGC'}
Input Arguments
subset
— Subset of elements in object
vector of positive integers | logical vector | string vector | cell array of character vectors
Subset of elements in the object, specified as a vector of positive integers, logical vector, string vector, or cell array of character vectors containing valid sequence headers.
Example: [1 3]
Tip
When you use a sequence header (or a cell array of headers) for subset
, a
repeated header specifies all elements with that header.
positions
— Sequence positions
vector of positive integers | logical vector
Sequence positions, specified as a vector of positive integers or logical
vector. The last position must be within the range of positions for each
sequence specified by subset
.
Example: [2:10]
Output Arguments
subSeqs
— Subsequences from subset of elements
cell array of character vectors
Subsequences from a subset of elements, returned as a cell array of character vectors.
Version History
Introduced in R2010a
Comando de MATLAB
Ha hecho clic en un enlace que corresponde a este comando de MATLAB:
Ejecute el comando introduciéndolo en la ventana de comandos de MATLAB. Los navegadores web no admiten comandos de MATLAB.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)