[Bioperl-l] problem with Bio::SearchIO::Writer

lidaof lidaof at gmail.com
Thu Jan 11 07:50:14 EST 2007


Hi,Dave and Chris,

sorry for disturbing again
in the code i paste below:

#!/usr/bin/perl -w

use strict;
use warnings;
use Bio::SearchIO;
#use Bio::SearchIO::Writer::TextResultWriter;

my $in = new Bio::SearchIO (-format => 'blast', -file => "$ARGV[0]");

$cutoff = 1e-10;
open OP,">out";
while(my $result = $in->next_result){
my $resultname = $result->query_name();
while(my $hit = $result->next_hit){
my $name = $hit->name();
my $e = $hit->significance();
if($e < $cutoff){
print OP "$resultname\t$name\t$e\n";
next;
}
}
}

i use a filehandle "OP" for file output
i want to use Bio::SearchIO::Writer::TextResultWriter but actually i didn't
use it
that is the place you are not sure in your last mail
and i will spend some time on reading the website of bioperl and this
mailing list

Thanks for your kindness:)

Li

On 1/10/07, David Messina <dmessina at wustl.edu> wrote:
>
> this document also available on CPAN and i have saw it:)
>
>
> That's good, but you may want to become familiar with the BioPerl website,
> because the information there is more extensive and more up-to-date.
>
>
> i use a filehandle for output before i know some Text output module such
> as Bio::SearchIO::Writer::TextResultWriter or other module
> so which variables could be visited by the object created by
> Writer::TextResultWriter module?
>
>
> I'm not exactly sure what you're asking here. Do you want to know what
> methods can be used on a TextResultWriter object?
>
>
> i have seen no FILE option of the synopsis of TextResultWriter
>
>
> Ahh, that is because TextResultWriter doesn't have a file option. :)
> If you look carefully at the example, it is actually Bio::SearchIO that
> take the -file parameter:
>
>
>   my $in = new Bio::SearchIO(-format => 'blast',
>                             -file   => shift @ARGV);
>
>
>
> This example might be a little confusing because it uses an unusual
> (antiquated?) syntax.
> This would do the same thing:
>
> my $in = Bio::SearchIO->new(-format => 'blast',
>  -file => shift @ARGV);
>
> The Bio::SearchIO documentation for the new() method describes all of the
> parameters it can take:
>
> http://doc.bioperl.org/bioperl-live/Bio/SearchIO.html#POD1
>
>
> that is exactly i confusing with
>
>
> BioPerl can be hard to understand at first. Time spent reading bioperl.organd this mailing list is a good way to become familiar with the "Bioperl
> way" of doing things.
>
>
> Dave
>



-- 
Li


More information about the Bioperl-l mailing list