getSubset
Class: BioIndexedFile
Create object containing subset of elements from BioIndexedFile object
Syntax
NewObj
= getSubset(BioIFObj
, Indices
)
NewObj
= getSubset(BioIFObj
, Keys
)
Description
returns NewObj
= getSubset(BioIFObj
, Indices
)NewObj
,
a new BioIndexedFile object that accesses a subset of entries in the
source file associated with BioIFObj
, a
BioIndexedFile object. The entries are specified by Indices
,
a vector containing unique positive integers.
returns NewObj
= getSubset(BioIFObj
, Keys
)NewObj
,
a new BioIndexedFile object that accesses a subset of entries in the
source file associated with BioIFObj
, a
BioIndexedFile object. The entries are specified by Keys
,
a character vector or cell array of unique character vectors specifying
keys.
Input Arguments
|
Object of the |
|
Vector containing unique positive integers that specify the
entries in the source file to access with |
|
Character vector or cell array of unique character vectors specifying
keys that specify the entries in the source file to access with |
Output Arguments
|
Object of the |
Examples
Construct a BioIndexedFile object to access a table containing cross-references between gene names and gene ontology (GO) terms:
% Create a variable containing the full absolute path of the source file. sourcefile = which('yeastgenes.sgd'); % Create a BioIndexedFile object from the source file. Indicate % the source file is a tab-delimited file where contiguous rows % with the same key are considered a single entry. Store the % index file in the Current Folder. Indicate that keys are % located in column 3 and that header lines are prefaced with ! gene2goObj = BioIndexedFile('mrtab', sourcefile, '.', ... 'KeyColumn', 3, 'HeaderPrefix','!')
Create a new BioIndexedFile object that accesses only the first
1,000 cross-references and reuses the same index file as gene2goObj
:
% Create a new BioIndexedFile object. gene2goSubset = getSubset(gene2goObj,1:1000);
Tips
Use this method to create a smaller, more manageable BioIndexedFile object.
See Also
BioIndexedFile
| getEntryByKey
| getIndexByKey
| getEntryByIndex
| getKeys
| read