Using the package prozor for creating standardized FASTA. The package can be used to:
merge several FASTA files into a single FASTA file
add reverse sequences to the FASTA file.
add contaminants to the FASTA file
Contaminants
This package provides several sets of typical contaminant proteins and peptides, which can be loaded with load_contaminants(); no_human = TRUE leaves out the contaminants of human origin. At the FGCZ we always are adding contaminants to the database. To databases already containing human proteins, we add the contaminants without the human ones. The contaminants are easy to distinguish from other entries thanks to the zz|FGCZCont prefix.
Creating a FASTA protein amino acid sequence database for searching.
To merge several FASTA databases into a single file place them into a single folder and give the folder the name of the database. At the FGCZ the database name is the project number, e.g. p1000, a consecutive number, e.g. db1, and a descriptive name, e.g. example: p1000_db1_example.
Add to the folder also an annotation.txt file. The annotation file should contain a single line formatted like a FASTA entry header with the following content: aa|p<project_number>_<database_name>|<YYYYMMDD> <detailed_description>.
Example : AA|p1000_db1_example|20180119_Example https://github.com/prolfqua/prozor
The package provides an example of such a folder with the FASTA files. create_fgcz_fasta_db() reads the FASTA files in it (*.fasta, *.fa or *.faa, optionally gzipped) and the first line of annotation.txt; here we do the same step by step.
[1] "AA|p1000_db1_example|20180118 Example: Homo sapiens UniProt entries (Swiss-Prot and TrEMBL, with isoforms) matched by the peptides of extdata/IDResults.txt.gz"
Create non decoy database
create_decoy_db() puts a dummy entry, whose header is the annotation, first, followed by the sequences of the FASTA files and the contaminants. Of entries with the same name, only the first is kept.
db <-create_decoy_db(files, contaminants =load_contaminants("fgcz2021"), rev_lab =NULL, header = annotation)length(db)
[1] 1572
Based on the directory name we build the name of the FASTA file adding the current date.
To add decoys, reversed sequences, specify the rev_lab parameter of create_decoy_db(). Apart from the dummy entry, the resulting database is twice as long as the non-decoy database. The names stay unique.
create_fgcz_fasta_db() runs these steps, writes the file to output_dir and returns a summary.
res <-create_fgcz_fasta_db( database_dir,contaminants =load_contaminants("fgcz2021"),output_dir =tempdir(),make_summary =FALSE)cat(res$summary)
Database created with prozor 0.5.0
database_dir : /home/runner/work/_temp/Library/prozor/p1000_db1_example
contaminants : 499 sequences
rev_lab : REV_
output_dir : /tmp/RtmpIzhgIX
FASTA name : p1000_db1_example_d
FASTA file name : p1000_db1_example_d_20261125.fasta
annotation : AA|p1000_db1_example|20180118 Example: Homo sapiens UniProt entries (Swiss-Prot and TrEMBL, with isoforms) matched by the peptides of extdata/IDResults.txt.gz
n_sequences : 3143
unlink(c(db_file, db_decoy_file, res$file_path))
Session Info
sessionInfo()
R version 4.6.2 (2026-10-29)
Platform: x86_64-pc-linux-gnu
Running under: Ubuntu 26.04.1 LTS
Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.32.so; LAPACK version 3.12.0
locale:
[1] LC_CTYPE=C.UTF-8 LC_NUMERIC=C LC_TIME=C.UTF-8
[4] LC_COLLATE=C.UTF-8 LC_MONETARY=C.UTF-8 LC_MESSAGES=C.UTF-8
[7] LC_PAPER=C.UTF-8 LC_NAME=C LC_ADDRESS=C
[10] LC_TELEPHONE=C LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C
time zone: UTC
tzcode source: system (glibc)
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] prozor_0.5.0
loaded via a namespace (and not attached):
[1] compiler_4.6.2 R6_2.6.1 fastmap_1.2.0 cli_3.6.6
[5] tools_4.6.2 htmltools_0.5.9 otel_0.3.0 yaml_2.3.12
[9] rmarkdown_2.32 knitr_1.52 jsonlite_2.0.0 xfun_0.62
[13] digest_0.6.39 rlang_1.3.0 evaluate_1.0.5