Skip to main content

Remove signal peptides from protein sequences

Description

Remove signal peptides from protein sequences

Usage

remove_signal_peptide(fasta, signal, id_fun = make_chain_id)

Arguments

fasta A list of UniProt protein sequences, as returned by read_fasta(), named with UniProt IDs such as “sp|P30443|1A01_HUMAN” (the accession follows the first |).
signal A data frame with one row per entry of fasta, in the same order, and the columns Entry (the UniProt accession) and Signal.peptide (UniProt’s signal peptide feature, e.g. “SIGNAL 1 20” or “SIGNAL 1..20; /evidence=…”; empty if there is none).
id_fun Function that makes the ID of the remaining chain from the protein sequence, its ID and the start of the chain, e.g. make_chain_id() or make_chain_id_uniprot().

Value

fasta with the signal peptides removed. A shortened sequence gets the ID made by id_fun as its list name, its name and the first word of its header; the rest of the header is kept.

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(), reverse_seq(), write_fasta()

Examples

library("prozor")

file <- system.file("extdata/fgcz_contaminants2021_20210929.fasta.gz", package = "prozor")
fasta <- read_fasta(file)[2:3]
names(fasta)
[1] "zz|Y-FGCZCont00001|" "zz|Y-FGCZCont00002|"
signal <- data.frame(
  Entry = c("Y-FGCZCont00001", "Y-FGCZCont00002"),
  Signal.peptide = c("SIGNAL 1 20", "")
)
res <- remove_signal_peptide(fasta, signal)
nchar(fasta[[1]])
[1] 148
nchar(res[[1]])
[1] 128