fastqwrite
Write to file using FASTQ format
Syntax
fastqwrite(File, FASTQStruct)
fastqwrite(File, Header, Sequence, Qual)
Description
fastqwrite( writes
the contents of a MATLAB® structure or array of structures to
a FASTQ-formatted file. If you specify an existing FASTQ-formatted
file, File, FASTQStruct)fastqwrite appends the data to the file,
instead of overwriting the file.
fastqwrite( writes
header, sequence, and quality information to a FASTQ-formatted file.File, Header, Sequence, Qual)
Tip
To append FASTQ-formatted data to an existing file, simply specify
that file name. fastqwrite adds the data to the
end of the file.
If you are using fastqwrite in a script,
you can disable the append warning message by entering the following
command lines before the fastqwrite command:
warnState = warning %Save the current warning state
warning('off','Bioinfo:fastqwrite:AppendToFile'); fastqwrite command:warning(warnState) %Reset warning state to previous settings
Input Arguments
| Character vector or string specifying either a file name or a path and file name for saving
the FASTQ-formatted data. If you specify only a file name,
|
| MATLAB structure or array of structures containing the fields
|
| Character vector or string containing header information about the nucleotide sequence. This
text appears in the header of the FASTQ-formatted file,
|
| Character vector or string containing a nucleotide sequence using the standard IUB/IUPAC letter or integer codes. For a list of valid characters, see Amino Acid Lookup or Nucleotide Lookup. |
| Character vector or string containing ASCII representation of per-base quality scores for a nucleotide sequence. |
Examples
Write multiple sequences to a FASTQ file from an array of structures:
% Read the contents of a FASTQ-formatted file into
% an array of structures
reads = fastqread('SRR005164_1_50.fastq');
% Create another array of structures for the first five reads
reads5 = reads(1:5);
% Write the first five reads to a separate FASTQ-formatted file
fastqwrite('fiveReads.fastq', reads5)Write a single sequence to a FASTQ file from separate variables:
% Create separate variables for the header, sequence, and
% quality information of a nucleotide sequence
h = 'MYSEQ-000_1_1_1_953_493';
s = 'GTTACCATGATGTTATTTCTTCATTTGGAGGTAAAA';
q = ']]]]]]]]]]]]]]]]]]]]]]T]]]]RJRZTQLOA';
% Write the information to a FASTQ-formatted file
fastqwrite('oneRead.fastq', h, s, q)More About
Version History
Introduced in R2009b