[Bioperl-l] seqIO

Jason Stajich jason at cgt.duhs.duke.edu
Tue Oct 7 21:43:55 EDT 2003


As has already been suggest on the list - use IO::String.

You don't have Bioperl Bio::Seq sequences yet, but an array of
strings which are EMBL format sequence data.

See the FAQ -
  http://www.bioperl.org/Core/Latest/faq.html#Q2.4
(hint - turn the array back into a single string with join )

-jason
On Wed, 8 Oct 2003, Desmond Lim wrote:

> Hi Lincoln,
>
> Thanks but what am I to do after this?
>
> I have a file that contains EMBL sequences. And I'm reading it into an
> array, manipulating it and then print it a file in fasta format.
>
> I know how to use the:
>
> my $seq_in = Bio::SeqIO->new('-file' => filename1, '-format' => 'embl');
> my $seq_out = Bio::SeqIO->new('-file' => filename2, '-format' => 'fasta');
>
> while ( my $inseq = $seq_in->next_seq ) {
>   $seq_out->write_seq($inseq);
> }
>
> But I don't have a file for filename1 but an array. Is there a way for reading the array (the manipulated embl one) and then write it as a fasta file?
>
> Thanks.
>
> -----Original Message-----
> From: Lincoln Stein [mailto:lstein at cshl.edu]
> Sent: Wednesday, October 08, 2003 7:18 AM
> To: Desmond Lim; Hilmar Lapp; BioPerl
> Subject: Re: [Bioperl-l] seqIO
>
>
> If you have an array of sequences then you can just create them using
> Bio::Seq:
>
> 	@bioperl_sequences = map {Bio::Seq->new(-seq=>$_)} @raw_seq;
>
> Lincoln
>
>
> On Tuesday 07 October 2003 12:45 am, Desmond Lim wrote:
> > > What made you think it would accept a -ph parameter? Besides, if
> > > there was
> > > one you'd have to provide an array reference.
> >
> > I didn't think it would work but I wanted to try it out.
> >
> > What I'm trying to do is get SeqIO to accept an array of sequences and not
> > a file.
> >
> > Desmond
> >
> > _______________________________________________
> > Bioperl-l mailing list
> > Bioperl-l at portal.open-bio.org
> > http://portal.open-bio.org/mailman/listinfo/bioperl-l
>
>

--
Jason Stajich
Duke University
jason at cgt.mc.duke.edu


More information about the Bioperl-l mailing list