Learn R Programming

microseq (version 1.3)

readFastq: Read and write FASTQ files

Description

Reads and writes files in the FASTQ format.

Usage

readFastq(in.file, Sanger = FALSE)
writeFastq(fdta, out.file)

Arguments

in.file

url/directory/name of FASTQ file to read.

Sanger

logical indicating if old, multi-line Sanger format is used (default = FALSE).

fdta

FASTQ object to write.

out.file

url/directory/name of FASTQ file to write.

Value

readFastq returns a Fastq object with the contents of the FASTQ file. This is an extension to a data.frame and contains three columns of text. The first, named Header, contains the headerlines and the second, named Sequence, contains the sequences and the third, named Quality, contains the base quality scores.

readFastq returns a Fastq object with the header, sequence and quality part of the FASTQ file.

Details

These functions handle input/output of sequences in the commonly used FASTQ format, typically used for storing DNA sequences (reads) after sequencing.

The sequences are stored in a Fastq object. This is an extension of a data.frame containing three text-columns named Header, Sequence and Quality. If other columns are present, these will be ignored by writeFastq.

The Fastq object can be treated as a data.frame, but the generic functions plot.Fastq and summary.Fastq are defined. The data.frame property makes it straightforward to manipulate all headers or all sequences, or to extract or delete entries (rows), or to merge several data sets using rbind.

A Fastq object can also be treated as a Fasta object. Using writeFasta will write the Fastq object to a file in Fasta format.

See Also

codereadFasta, plot.Fastq, summary.Fastq.

Examples

Run this code
# NOT RUN {
ex.file <- file.path(file.path(path.package("microseq"),"extdata"),"small.fastq")
fdta <- readFastq(ex.file)
summary(fdta)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab