Hi,
I have a couple of plain sequences (without any formatting and annotations) saved in sqlite3 database. After reading them into Perl strings, I have to convert them into fasta format using Perl. I see methods in Bio::SeqIO to convert one file format to another. But my sequences are in perl string variables and not in files.
Thanks
Quite right; printing out Fasta is simple without libraries (you might want to include a line wrap since sequence lines are in principle not supposed to exceed 80 characters). I just explained the Bioperl solution because the OP was using Bio::SeqIO and seemed confused by it.
A simple line wrapping can be obtained using unpack:
print '>', $seqId, "\n"; foreach $seqLine (unpack('(a[60])*', $seqStr)) { print $seqLine, "\n"; }
I cannot see any reason why a library would be useful. This solution is simple, fast and scalable.