Store read data from a SAM-formatted file in a BioRead
object. By default, the data remains in the source file, and BioRead
uses an index file to access the data, making the process more memory efficient.
br =
BioRead with properties:
Quality: [1501x1 File indexed property]
Sequence: [1501x1 File indexed property]
Header: [1501x1 File indexed property]
NSeqs: 1501
Name: ''
Set the 'InMemory'
name-value pair argument to true
to store the data in memory, enabling you to access the data faster and edit the properties of the object.
brInMemory =
BioRead with properties:
Quality: {1501x1 cell}
Sequence: {1501x1 cell}
Header: {1501x1 cell}
NSeqs: 1501
Name: ''
Retrieve the second and third elements from the object br
. By default, the resulting object subset
is not placed in memory if the parent object br
is not in memory. If br
is already in memory, the resulting subset is placed in memory.
subset =
BioRead with properties:
Quality: [2x1 File indexed property]
Sequence: [2x1 File indexed property]
Header: [2x1 File indexed property]
NSeqs: 2
Name: ''
Alternatively, you can keep the parent object br
in the source file, and load the resulting subset in memory if the subset is small enough. You access the subset faster and update it as needed.
subsetInMemory =
BioRead with properties:
Quality: {2x1 cell}
Sequence: {2x1 cell}
Header: {2x1 cell}
NSeqs: 2
Name: ''
Update the header information of the first element.
ans = 1x1 cell array
{'EAS54_65:7:152:368:113'}
ans = 1x1 cell array
{'NewHeader'}
You can use a header to get the corresponding elements with that header. If multiple elements have the same header, the function returns all those elements.
Get all the elements with the header 'B7_591:4:96:693:509'
from the br
object stored in memory.
subset2 =
BioRead with properties:
Quality: {'<<<<<<<<<<<<<<<;<<<<<<<<<5<<<<<;:<;7'}
Sequence: {'CACTAGTGGCTCATTGTAAATGTGTGGTTTAACTCG'}
Header: {'B7_591:4:96:693:509'}
NSeqs: 1
Name: ''