[Bioperl-l] SearchIO function to save raw blast output?

Wiepert, Mathieu Wiepert.Mathieu@mayo.edu
Wed, 11 Sep 2002 16:29:03 -0500


>retrieve the report more than once and/or can put the hooks there.  In
> fact with LWP the data is either memory resident with a 
> string or saved in
> a temp file - Make the user provide a filename to save the 
> report too -
> strip out so that it is only the <pre></pre> block and that 
> should be good
> enough in my opinion.

So, say I want to do just one or two of the rids.  Would something like

$factory->save_output($rid $filename);

work?  That way I can at least control by rid, and save only those that meet criteria like (simplified code)
while ( my @rids = $factory->each_rid ) {
  foreach my $rid ( @rids ) {
    my $rc = $factory->retrieve_blast($rid);
    my $result = $rc->next_result;
    my $saved=0;
    while( my $hit = $result->next_hit ) {		
      if ($hit->length > 100){
        if (!$saved) {
          my $filename = $result->accession()."blastoutput";
          $factory->save_output($rid $result->accession.);
          $saved=1;
        }
      }
    }
    $factory->remove_rid($rid); 
  }
}


-Mat
> -j
> 
> On Wed, 11 Sep 2002, Wiepert, Mathieu wrote:
> 
> > This makes sense for RemoteBlast, since the data is in a temporary
> > file and never really seen.  Is it senseless otherwise?  Should this
> > function be an option for RemoteBlast?  There is a bit more control
> > given to the user when it is in SearchIO, in that they can 
> control the
> > outputfile names better.  In RemoteBLast it would be harder to do
> > that, probably have to put all the results in one file.  If it is in
> > SearchIO the user can only save some of the result files based on
> > filters.  RemoteBlast would have to save them all.
> >
> > -Mat
> >
> > > -----Original Message-----
> > > From: Wiepert, Mathieu [mailto:Wiepert.Mathieu@mayo.edu]
> > > Sent: Wednesday, September 11, 2002 2:59 PM
> > > To: 'bioperl-l@bioperl.org'
> > > Subject: [Bioperl-l] SearchIO function to save raw blast output?
> > >
> > >
> > > I want to have the option to save the blast output.  SaerchIO
> > > seems to have a handle on the Blast Results file, or whatever
> > > type of Search it is handling I presume.  is it fair to say
> > > that this might be a good place to have a method like
> > >
> > > my $rc = $factory->retrieve_blast($rid);
> > > $rc->save_output("searchio.out");
> > >
> > > Or is this way off, and SearchIO doesn't actually always have
> > > a file or filehandle.
> > >
> > > Is there a better name for a function like this?  Can I
> > > always count on
> > >
> > > $self->file;
> > >
> > > in SearchIO?  If so it is trivial to copy the output to a
> > > different file (I assume)
> > >
> > > I implemented something that works in the simple case, with
> > > RemoteBlast output anyway.
> > >
> > > -Mat
> > >
> > > Mathieu Wiepert
> > > Medical Information Resources
> > > Mayo Foundation
> > > (507) 266-2317 Fax (507)-284-0360
> > > wiepert.mathieu@mayo.edu
> > > _______________________________________________
> > > Bioperl-l mailing list
> > > Bioperl-l@bioperl.org
> > > http://bioperl.org/mailman/listinfo/bioperl-l
> > >
> > _______________________________________________
> > Bioperl-l mailing list
> > Bioperl-l@bioperl.org
> > http://bioperl.org/mailman/listinfo/bioperl-l
> >
> 
> -- 
> Jason Stajich
> Duke University
> jason at cgt.mc.duke.edu
>