Bioperl: Creating a SeqIO object

Steve Chervitz sac@neomorphic.com (Steve A. Chervitz)
Fri, 26 May 2000 14:55:02 -0700 (PDT)


I found myself needing this functionality when I updated the remote
Blasting code. This is in fact the reason why Webblast.pm now requires
IO::Scalar.

Getting a stringified version of a formatted sequence is a common
enough need that I think it makes sense to wrap this up into the SeqIO
system. This way, different people won't re-invent their own possibly
incompatible solutions. What do you think?

Steve

Aaron J Mackey writes:
 > 
 > I think you might want to do something like this, using IO::Scalar to turn
 > your string into a pseudo-filehandle:
 > 
 > $seqs = param('seqs'); # grab your CGI form variable.
 > 
 > $fh = new IO::Scalar \$seqs;
 > 
 > $in = new Bio::SeqIO -fh => $fh, -format => 'Fasta';
 > 
 > while($seq = $in->next_seq()) {
 > 
 > 	# do stuff with each $seq.
 > 
 > }
 > 
 > 
 > -Aaron
 > 
 > On Fri, 26 May 2000, gert thijs wrote:
 > 
 > > Hello,
 > > 
 > > I hope this is not a stupid question, but I still haven't captured all the
 > > gory details of perl yet.
 > > I am developping a web interface where one can enter some DNA sequences that
 > > will be processed. Those DNA sequences should be in Fasta format. When I read
 > > the inputs of the web interface the sequences are stored as one long string in
 > > a variable $dnaseq. Now I am first writing this string to a file and then I
 > > use the filehandle to read the sequences into a new SeqIO object. 
 > > But I was wondering if I can do this without writing $dnaseq to a file. 
 > > 
 > > tnx,
 > > Gert Thijs
 > > 
 > > 
 > 
 > -- 
 >  o ~   ~   ~   ~   ~   ~  o
 > / Aaron J Mackey           \
 > \  Dr. Pearson Laboratory  / 
 >  \ University of Virginia  \     
 >  /  (804) 924-2821          \
 >  \  amackey@virginia.edu    /
 >   o ~   ~   ~   ~   ~   ~  o
 > 
 > 
 > =========== Bioperl Project Mailing List Message Footer =======
 > Project URL: http://bio.perl.org/
 > For info about how to (un)subscribe, where messages are archived, etc:
 > http://www.techfak.uni-bielefeld.de/bcd/Perl/Bio/vsns-bcd-perl.html
 > ====================================================================
 > 
=========== Bioperl Project Mailing List Message Footer =======
Project URL: http://bio.perl.org/
For info about how to (un)subscribe, where messages are archived, etc:
http://www.techfak.uni-bielefeld.de/bcd/Perl/Bio/vsns-bcd-perl.html
====================================================================