Skip to main content

Read a FASTA file of protein sequences

Description

Reads amino-acid sequences, each sequence as one string. Lines starting with ; and lines before the first header are skipped; an entry without sequence lines gets the empty string.

Usage

read_fasta(file)

Arguments

file Path to a FASTA file, optionally gzip-compressed.

Value

A named list with one SeqFastaAA object per sequence: the sequence as a string, with the attributes name (the first word of the header, up to the first whitespace, without >; also the list name) and Annot (the header line).

See Also

Other FASTA databases: create_decoy_db(), create_fgcz_fasta_db(), load_contaminants(), make_chain_id(), make_chain_id_uniprot(), make_fasta_summary(), remove_signal_peptide(), reverse_seq(), write_fasta()

Examples

library("prozor")

file <- system.file("extdata/fgcz_contaminants2021_20210929.fasta.gz", package = "prozor")
fasta <- read_fasta(file)
length(fasta)
[1] 499
attributes(fasta[[1]])
$name
[1] "zz|fgczContaminants2021|"

$Annot
[1] ">zz|fgczContaminants2021| jg: 2021-09-29 updated list of important MS contaminants, incl Preomics LysC, BioID, APEX2 domain compiled by FGCZ protInf"

$class
[1] "SeqFastaAA"