Default renameFA() replacement function. Maps an accession number to its name
Default rename_fasta() replacement function. Maps an accession number to its name
Usage
mapAcc2Name(line, acc2name, acc_col = "AccNum", name_col = "Name")
mapAcc2Name(line, acc2name, acc_col = "AccNum", name_col = "Name")
Value
A character string representing the updated FASTA line, where the accession number is replaced with its corresponding name.
Character string. The modified line from the Fasta file header with the name instead of the accession number.
Examples
if (FALSE) { # \dontrun{
mapAcc2Name(">P12345 some description", acc2name, "AccNum", "Name")
} # }
if (FALSE) { # \dontrun{
acc2name_table <- data.table(AccNum = c("ACC001", "ACC002"),
Name = c("Species A", "Species B"))
line <- ">ACC001 some additional info"
mapped_line <- mapAcc2Name(line, acc2name_table)
mapped_line # Expected output: ">Species A"
} # }