Write to file using FASTQ format
the contents of a MATLAB® structure or array of structures to
a FASTQ-formatted file. If you specify an existing FASTQ-formatted
fastqwrite appends the data to the file,
instead of overwriting the file.
header, sequence, and quality information to a FASTQ-formatted file.
To append FASTQ-formatted data to an existing file, simply specify
that file name.
If you are using
Then enter the following command line after the
warnState = warning %Save the current warning state warning('off','Bioinfo:fastqwrite:AppendToFile');
warning(warnState) %Reset warning state to previous settings
Character vector 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
Character vector or name of a variable containing information
about the nucleotide sequence. This text appears in the header of
the FASTQ-formatted file,
Character vector or name of a variable 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 name of a variable containing ASCII representation of per-base quality scores for a nucleotide sequence.
A FASTQ-formatted file contains nucleotide sequence and quality information on four lines:
Line 1 — Header information
prefixed with an
Line 2 — Nucleotide sequence
Line 3 — Header information
prefixed with a
Line 4 — ASCII representation of per-base quality scores for the nucleotide sequence using Phred or Solexa encoding
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)