Asking for help on the bioperl mailing list. WAS: [Bioperl-l] seqIO
Lincoln Stein
lstein at cshl.edu
Wed Oct 8 10:18:38 EDT 2003
Hi Desmond and Others who Write to this Mailing List for Help,
The bioperl mailing list welcomes requests for help from programmers of all
levels of experience. However, as the recent thread indicates, a great deal
of unhelpful and redundant traffic can be generated when the question is
vague.
It would really help us all if next time you state the problem explicitly and
concisely, as in "I have a file that contains EMBL sequences, I've read them
into an array and want to print the results out as FASTA format." Note that
this is still underspecified because some people will understand this to mean
that you've created an array in which each element is a line from the EMBL
file, while others will think you've created one element per EMBL entry. But
it's much better than showing us a fragment of nonfunctional code taken out
of context and then asking us "why doesn't bioperl work the way I think it
should."
Also your problem raises another question. Why did you read the EMBL file
into a string array rather than using Bio::SeqIO from the beginning to do it?
Lincoln
On Tuesday 07 October 2003 09:16 pm, 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
--
========================================================================
Lincoln D. Stein Cold Spring Harbor Laboratory
lstein at cshl.org Cold Spring Harbor, NY
========================================================================
More information about the Bioperl-l
mailing list