Read data from Short Oligonucleotide Analysis Package (SOAP) file
SOAPStruct = soapread(File)
SOAPStruct = soapread(File,Name,Value)
Character vector or string specifying a file name, path and file name, or the text of a SOAP-formatted file. If you specify only a file name, that file must be on the MATLAB search path or in the Current Folder.
comma-separated pairs of
the argument name and
Value is the corresponding value.
Name must appear inside quotes. You can specify several name and value
pair arguments in any order as
Scalar or vector that controls the reading of a single sequence
entry or block of sequence entries from a SOAP-formatted file containing
multiple sequences. Enter a scalar
Logical specifying whether or not to include the
An N-by-1 array of structures containing sequence alignment and mapping information from a SOAP-formatted file, where N is the number of alignment records stored in the SOAP-formatted file. Each structure contains the following fields.
Read the alignment records (entries) from the
into a MATLAB array of structures and access some of the data:
% Read the alignment records stored in the file sample01.soap data = soapread('sample01.soap')
data = 17x1 struct array with fields: QueryName Sequence Quality NumHits PairedEndSourceFile Length Strand ReferenceName Position AlignDetails
% Access the quality score for the 6th entry data(6).Quality
ans = <>.>>>8>;:1>>>3>6>
% Determine the strand direction (forward or reverse) of the reference % sequence to which the 12th entry aligns data(12).Strand
ans = -
Read a block of alignment records (entries) from the
into a MATLAB array of structures:
% Read a block of six entries from a SOAP file data_5_10 = soapread('sample01.soap','blockread', [5 10])
data_5_10 = 6x1 struct array with fields: QueryName Sequence Quality NumHits PairedEndSourceFile Length Strand ReferenceName Position AlignDetails
If your SOAP-formatted file is too large to read using available memory, try either of the following:
BlockRead name-value pair
arguments to read a subset of entries.
from the SOAP-formatted file (using
Format), and then access the entries
using methods of the
 Li, R., Yu, C., Li, Y., Lam, T., Yiu, S., Kristiansen, K., and Wang, J. (2009). SOAP2: an improved ultrafast tool for short read alignment. Bioinformatics 25, 15, 1966–1967.
 Li, R., Li, Y., Kristiansen, K., and Wang, J. (2008). SOAP: short oligonucleotide alignment program. Bioinformatics 24(5), 713–714.