Renaming a fasta object given a reference table

Share:

Description

this function could be used to rename the sequences in the fasta object, given a reference dataframe.

Usage

1
rename.fasta(fas, ref, fil = NULL, prefix = NULL)

Arguments

fas

the fasta object.

ref

Dataframe with first column of the names of the sequences , the second column which name to change into.

fil

A string indicating the file name, the result written to.

prefix

prefix of which the names of the sequences.

Details

Prefix providing the flexibility of modifying the input names of sequences, for example, if the sequences names begin with "P_seq1", and unfortunately the names in reference table are lack of "P_". You may set the prefix as "P_", and without changing the reference table.

Value

fasta object

Author(s)

Jinlong Zhang jinlongzhang01@gmail.com

References

None

See Also

gnames.fas

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
library(seqRFLP)
## loading data
data(fil.fas)
## Get the names of the sequences
col1 <- gnames.fas(fil.fas)
## Generating new names
col2 <- paste("seq", 1:length(col1), sep = "")
reftable.rename <- data.frame(col1, col2)
## 
rename.fasta(fil.fas, reftable.rename)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.