Products & Services Solutions Academia Support User Community Company

Learn more about Bioinformatics Toolbox   

fastqwrite - Write to file using FASTQ format

Syntax


fastqwrite(File, FASTQStruct)
fastqwrite(File, Header, Sequence, Qual)

Description

fastqwrite(File, FASTQStruct) writes the contents of a MATLAB structure or array of structures to a FASTQ-formatted file. If you specify an existing FASTQ-formatted file, fastqwrite appends the data to the file, instead of overwriting the file.

fastqwrite(File, Header, Sequence, Qual) writes header, sequence, and quality information to a FASTQ-formatted file.

Inputs

File

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, fastqwrite saves the file to the MATLAB Current Folder. If you specify an existing file, fastqwrite appends the data to the file, instead of overwriting the file.

FASTQStruct

MATLAB structure or array of structures containing the fields Header, Sequence, and Quality, such as returned by fastqread.

Header

String or name of a variable containing information about the nucleotide sequence. This text appears in the header of the FASTQ-formatted file, File.

Sequence

String 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.

Qual

String or name of a variable containing ASCII representation of per-base quality scores for a nucleotide sequence.

Definitions

A FASTQ-formatted file contains nucleotide sequence and quality information on four lines:

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)

See Also

fastainfo | fastaread | fastawrite | fastqinfo | fastqread | sffinfo | sffread

Tutorials

How To

Related Links

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS