remap_accessions {MSnID} | R Documentation |
Changes accessions from one protein id to another.
remap_accessions(object, conversion_table, extraction_pttrn=c("\\|([^|-]+)(-\\d+)?\\|", "([A-Z]P_\\d+)", "(ENS[A-Z0-9]+)"), path_to_FASTA=NULL)
object |
An instance of class "MSnID". |
conversion_table |
(data.frame) first column in the data frame corresponds to identifiers in the FASTA file. Second column is the new identifier. |
extraction_pttrn |
(string) regex pattern that extract protein identifier from
FASTA entry name as first group (that is |
path_to_FASTA |
(string) path to FASTA file. If provided only accessions present in the given FASTA file will be retained. |
Returns an instance of "MSnID" with updated accessions
.
Vladislav A Petyuk vladislav.petyuk@pnnl.gov
m <- MSnID(".") mzids <- system.file("extdata","phospho.mzid.gz",package="MSnID") m <- read_mzIDs(m, mzids) head(m$accessions) conv_tab <- fetch_conversion_table("Homo sapiens", "UNIPROT", "SYMBOL") m2 <- remap_accessions(m, conv_tab, "\\|([^|-]+)(-\\d+)?\\|") head(m2$accessions) unlink(".Rcache", recursive=TRUE)