[Bioperl-l] seq to fasta

stephan rosecker stephan.rosecker at ish.de
Sun May 23 18:17:30 EDT 2004


Hi,
is it possible to get the fasta format from a seqobject-sequence in a 
variable without using filhandles like below ?

use Bio::SeqIO;
   $in  = Bio::SeqIO->new(-file => "inputfilename",
                          -format => 'EMBL');
   $out = Bio::SeqIO->new(-file => ">outputfilename",
                          -format => 'Fasta');
   while ( my $seq = $in->next_seq() ) {$out->write_seq($seq); }

e.g:
I've a seqobject ($seq).
and this is what i want:

my $fastavar = $seq->seq_fastaformat();
print $fastavar;

result:
 >sp|P32234|128U_DROME GTP-binding protein 128UP - Drosophila 
melanogaster (Fruit fly).
MITILEKISAIESEMARTQKNKATSAHLGLLKANVAKLRRELISPKGGGGGTGEAGFEVA
KTGDARVGFVGFPSVGKSTLLSNLAGVYSEVAAYEFTTLTTVPGCIKYKGAKIQLLDLPG
IIEGAKDGKGRGRQVIAVARTCNLIFMVLDCLKPLGHKKLLEHELEGFGIRLNKKPPNIY
YKRKDKGGINLNSMVPQSELDTDLVKTILSEYKIHNADITLRYDATSDDLIDVIEGNRIY
IPCIYLLNKIDQISIEELDVIYKIPHCVPISAHHHWNFDDLLELMWEYLRLQRIYTKPKG
QLPDYNSPVVLHNERTSIEDFCNKLHRSIAKEFKYALVWGSSVKHQPQKVGIEHVLNDED
VVQIVKKV

regards,
stephan


More information about the Bioperl-l mailing list