[Bioperl-l] writing sequences to a file

Jason Raymond jasonraymond@asu.edu
Mon, 22 Oct 2001 15:59:34 -0700


This is a multi-part message in MIME format.

--Boundary_(ID_hiWJFk81bBBKBexPd/7akw)
Content-type: text/plain;	charset="iso-8859-1"
Content-transfer-encoding: quoted-printable

Spinoff from an earlier post...
Per Seq::IO, I'm using
$stream =3D Bio::SeqIO->newFh(-file =3D> ">$output";
...
print $stream $seq;
to write to my $output file once retrieved from a local db.  How do I =
also write the (FASTA formatted) names of these sequences?  Previously =
(as in BLAST parsing) I had used:
open(OUT, ">$output);
...
print OUT ">",$hit->name;
But combining the parsing and retrieval scripts (i.e. mixing print OUT =
with the print $stream $seq above doesn't give the desired output of a =
nicely formatted file).



--Boundary_(ID_hiWJFk81bBBKBexPd/7akw)
Content-type: text/html;	charset="iso-8859-1"
Content-transfer-encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.3315.2870" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Spinoff from an earlier =
post...</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Per Seq::IO, I'm using</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>$stream =3D Bio::SeqIO-&gt;newFh(-file =
=3D&gt;=20
"&gt;$output";</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>...</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>print $stream $seq;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>to write to my $output file once =
retrieved from a=20
local db.&nbsp; How do I also write the (FASTA formatted) names of these =

sequences?&nbsp; Previously (as&nbsp;in BLAST parsing) I had =
used:<BR>open(OUT,=20
"&gt;$output);</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>...</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>print OUT =
"&gt;",$hit-&gt;name;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>But combining the parsing and retrieval =
scripts=20
(i.e. mixing&nbsp;print OUT with the print $stream&nbsp;$seq above =
doesn't give=20
the desired output of a nicely formatted file).</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV></BODY></HTML>

--Boundary_(ID_hiWJFk81bBBKBexPd/7akw)--