Skip to main content

Write protein sequences to a FASTA file

Description

Writes each sequence with its Annot header and 60 residues per line. A header without the leading > gets one.

Usage

write_fasta(fasta, file)

Arguments

fasta A list of SeqFastaAA objects, e.g. from read_fasta() or create_decoy_db(); each needs the attribute Annot, a single string.
file Path of the FASTA file to write.

Value

file, invisibly.

See Also

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

Examples

library("prozor")

file <- system.file("extdata/fgcz_contaminants2021_20210929.fasta.gz", package = "prozor")
fasta <- read_fasta(file)
decoy_db <- c(fasta, reverse_seq(fasta))
out <- tempfile(fileext = ".fasta")
write_fasta(decoy_db, out)
length(read_fasta(out))
[1] 998
unlink(out)