Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

FastaFile-class

FastaFile objects


Description

These functions support the import and export of the Fasta sequence format, using the Biostrings package.

Usage

## S4 method for signature 'FastaFile,ANY,ANY'
import(con, format, text,
           type = c("DNA", "RNA", "AA", "B"), ...)

## S4 method for signature 'ANY,FastaFile,ANY'
export(object, con, format, ...)
## S4 method for signature 'XStringSet,FastaFile,ANY'
export(object, con, format, ...)

Arguments

con

A path or FastaFile object. URLs and connections are not supported. If con is not a FastaFile, either the file extension or the format argument needs to be “fasta”. Compressed files (“gz”, “bz2” and “xz”) are handled transparently.

object

The object to export, should be an XStringSet or something coercible to a DNAStringSet, like a character vector.

format

If not missing, should be “fasta”.

text

If con is missing, a character vector to use as the input

type

Type of biological sequence.

...

Arguments to pass down to writeXStringSet (export) or the readDNAStringSet family of functions (import).

FastaFile objects

The FastaFile class extends RTLFile and is a formal represention of a resource in the Fasta format. To cast a path, URL or connection to a FastaFile, pass it to the FastaFile constructor.

Author(s)

Michael Lawrence

See Also

These functions are implemented by the Biostrings writeXStringSet (export) and the readDNAStringSet family of functions (import).

See export-methods in the BSgenome package for exporting a BSgenome object as a FASTA file.


rtracklayer

R interface to genome annotation files and the UCSC genome browser

v1.50.0
Artistic-2.0 + file LICENSE
Authors
Michael Lawrence, Vince Carey, Robert Gentleman
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.