fastodf: Read in a FASTA file as a data.frame.

View source: R/fastodf.R

fastodfR Documentation

Read in a FASTA file as a data.frame.

Description

Utility function that uses read.fasta to load a FASTA file as a data.frame.

Usage

fastodf(path = NULL, seqtype = c("DNA", "AA"), incl_filepath = TRUE)

Arguments

path

(character string, mandatory) the path to the input FASTA file.

seqtype

(character string, optional) the type of sequence being read in; DNA ("DNA") or amino acid ("AA"). Defaults to "DNA".

incl_filepath

(logical, optional) should the path to the file being read be included in the data.frame. Irrespective of whether the user sets this to TRUE or FALSE, a column (filename) will be included in the output data.frame to keep the number of columns consistent.

Value

a data.frame with the following columns: seqname, seq, and filename. If incl_filepath is set to TRUE, then filename will include the full path to the input file. It will be set to NA otherwise.

Examples

## Not run: 
#Input data
inpath <- system.file("extdata", "cdsearchr_testdata.fasta", package = "seqvisr", mustWork = TRUE)
#Reading in some sample amino acid sequences
fastodf(path = inpath, seqtype = "AA")

## End(Not run)


vragh/seqvisr documentation built on April 20, 2024, 10:06 a.m.