Skip to contents
0.16.6 documentation

Complete canonical API text; task articles explain the workflows. Tutorials

Site guide · find your task

file reads a single FASTA file; files reads multiple files at once and combines them. files accepts a character vector of literal paths and/or wildcard patterns (e.g. "examples/fasta/*.fna").

Usage

Code
read_fasta_lengths(
  file = NULL,
  files = NULL,
  header_delim = NULL,
  source_file = FALSE
)

Arguments

file

Optional path vector or glob patterns; read before files.

files

Optional character vector of FASTA files (literal paths and/or wildcard patterns). All matched files are read and combined.

header_delim

Optional character. When given, each header is split at every occurrence of this delimiter and only the first piece is kept.

source_file

Logical. Add a .source_file column when reading one or more files, default FALSE.

Value

A data.frame with columns accver and length. A ggchord_import attribute records files and per-file output row counts.

Examples

Code
if (FALSE) { # \dontrun{
library(dplyr)
# Requires the source checkout or tutorial input bundle.
source <- read_fasta_lengths("examples/fasta/MT108731.1.fna")
seqs <- source |>
  select(accver, length)
} # }