readFastq: Read and write FASTQ files

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/fastq.R

Description

Reads and writes files in the FASTQ format.

Usage

1
2
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.

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.

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.

Author(s)

Lars Snipen and Kristian Hovde Liland.

See Also

codereadFasta, plot.Fastq, summary.Fastq.

Examples

1
2
3
4
5
6
## Not run: 
ex.file <- file.path(file.path(path.package("microseq"),"extdata"),"small.fastq")
fdta <- readFastq(ex.file)
summary(fdta)

## End(Not run)

microseq documentation built on May 30, 2017, 12:39 a.m.

Search within the microseq package
Search all R packages, documentation and source code