Entering edit mode
4.5 years ago
kbaitsi
•
0
I have a fasta file with 10 protein sequences. Using R I generate a new protein sequence and using write.fasta I insert the new sequence in the original file. Is there a way to create a new fasta file with a new name containing the 11 sequences? Basically I need to "save as".
What have you tried? Show us your code please.
The original fasta file is called histone4.fa. After I have generated the new sequence(new hist) I write
write.fasta(newhist, names = names("histone4.fa"), file.out = "histone4.fa", open = "a")
and a new line is added to my open fasta file. If I writewrite.fasta(newhist, names = names("histone4.fa"), file.out = "histone4new.fa", open = "a")
a new file is created but only with the new sequence. If I writeit works but I was wondering if there is a more compact way to do it.
*histone = readAAStringSet("histone4.fa")
You could concatenate
histone
andnewhist
and write it in a single line.