read_fasta {blaster}R Documentation

Reads the contents of nucleotide or protein FASTA file into a dataframe.

Description

Reads the contents of nucleotide or protein FASTA file into a dataframe.

Usage

read_fasta(
  filename,
  filter = "",
  non_standard_chars = "error",
  alphabet = "nucleotide"
)

Arguments

filename

A string specifying the name of the FASTA file to be imported.

filter

An optional string specifying a sequence motif for sequence filtering. Only keeps those sequences containing this motif. Also splits the matched sequences and provides the split parts in two additional columns.

non_standard_chars

A string specifying instructions for handling non-standard nucleotide or amino acid characters. Options include 'remove', 'ignore' or throw an 'error'. Defaults to 'error'.

alphabet

A string specifying the query and database alphabet: 'nucleotide' or 'protein'. Defaults to 'nucleotide'.

Value

A dataframe containing FASTA ids (Id column) and sequences (Seq column). If 'filter' is specified, the split sequences are stored in additional columns Part1 and Part2.

Examples


query <- system.file("extdata", "query.fasta", package = "blaster")

query <- read_fasta(filename = query)


[Package blaster version 1.0.7 Index]