setSubset
Update elements of object
Description
Examples
Update Elements of BioRead Object
Construct two BioRead objects, one with 10 elements, and one with 2 elements. Trim the headers to the first white space.
struct1 = fastqread('SRR005164_1_50.fastq',... 'blockread', [1 10], 'trimheaders', true); struct2 = fastqread('SRR005164_1_50.fastq',... 'blockread', [11 12], 'trimheaders', true); brObj1 = BioRead(struct1)
brObj1 = BioRead with properties: Quality: {10x1 cell} Sequence: {10x1 cell} Header: {10x1 cell} NSeqs: 10 Name: ''
brObj2 = BioRead(struct2)
brObj2 = BioRead with properties: Quality: {2x1 cell} Sequence: {2x1 cell} Header: {2x1 cell} NSeqs: 2 Name: ''
Replace the first two elements in brObj1
with the elements in brObj2
. The object brObj2
must contain the same number of elements as the number of elements in subset
(in this case, 2).
subset = [1:2]; brObj1 = setSubset(brObj1,brObj2,subset)
brObj1 = BioRead with properties: Quality: {10x1 cell} Sequence: {10x1 cell} Header: {10x1 cell} NSeqs: 10 Name: ''
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.
Output Arguments
newObject
— New object with updated properties
BioRead
object | BioMap
object
New object with updated properties, returned as a BioRead
or BioMap
object.
Version History
Introduced in R2010a
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
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)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)