May
24
Adding a text to sequence names of a fasta file using R
Sometimes painstaking text modifications specially when one is dealing with large data could easily be solved using few lines of scripts of a programming language. In the following I'll issue an R function that could be used to add a text to the end of the sequence names of a multi/single fasta file. The lines of the fasta file that represent the sequence names start with '>' sign. you can also download the script from here .
addTextToFastaName<-function(fileIn, fileOut, addText){
# Read fasta file line by line into a vector
tmp=scan(fileIn, what='character')
# Replace each element of the vector that starts with '>', i.e.
addTextToFastaName<-function(fileIn, fileOut, addText){
# Read fasta file line by line into a vector
tmp=scan(fileIn, what='character')
# Replace each element of the vector that starts with '>', i.e.