Skip to main content

Create an FGCZ FASTA database from a directory of FASTA files

Description

Reads all FASTA files in database_dir (.fasta, .fa or *.faa, optionally gzipped), adds contaminants and decoys with create_decoy_db(), which drops duplicated entries, and writes the result to output_dir as <name>[_d]_<date>.fasta, where _d marks a database with decoys. The first line of annotation.txt in database_dir becomes the header of the dummy source entry.

Usage

create_fgcz_fasta_db(
  database_dir,
  output_dir,
  contaminants = load_contaminants(),
  rev_lab = "REV_",
  make_summary = TRUE
)

Arguments

database_dir Directory with the FASTA files and annotation.txt.
output_dir Existing directory the FASTA file is written to; must not be database_dir, where the next run would read the written database as targets.
contaminants Contaminant sequences to add, e.g. from load_contaminants(), or NULL for none.
rev_lab Prefix of the reversed decoy sequences, or NULL for no decoys.
make_summary If TRUE, append the sequence lengths and amino-acid counts of make_fasta_summary() to the summary.

Details

The whole database, decoys included, is held in memory. Peak memory grows linearly with the database, by about 4 KB per written sequence or 6 to 7 times the size of the written file: 250,000 target proteins (500,000 sequences with decoys, a 320 MB file) take 2.2 GB.

Value

A list with the elements fasta (the sequences written), file_path, summary (text with the argument values, the file name and the number of sequences), call and db_name.

See Also

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

Examples

library("prozor")

res <- create_fgcz_fasta_db(
  system.file("p1000_db1_example", package = "prozor"),
  output_dir = tempdir(),
  make_summary = FALSE
)
basename(res$file_path)
[1] "p1000_db1_example_d_20261125.fasta"
unlink(res$file_path)