[Bioperl-l] [BULK] can't parse blast file anymore

Barry Moore barry.moore at genetics.utah.edu
Thu May 4 21:22:51 UTC 2006


Hubert,

My first suggestion would be to log onto your calgary server and  
change your password real quick (unless that is intended to post you  
password to the world).  Well, this isn't an answer, but it may help  
you find one.  Use perl -d your_script.pl to run your script under  
the debugger.  Type 'n' to step forward to the line where you start  
the while loop.  Type 'x $result' to see that an object exists (it  
should or you'd have gotten an error).  Type 's' to step into the  
next_results call, and then continue to type 'n' and 's' as needed to  
burrow down to see if you can find where you're hanging.

Barry

On May 4, 2006, at 1:35 PM, Hubert Prielinger wrote:

> Hi,
> the following perl script worked fine until a few days ago....
>
> ==============================================================
> #!/usr/bin/perl -w
>
> use Bio::SearchIO;
> use strict;
> use DBI;
> use Net::MySQL;
>
> #use lib qw(/usr/local/lib/perl5/site_perl/5.8.6/i686-linux);
>
> print "trying to connect to database \n";
> my $database = 'antimicro_peptides';
> my $host = 'ppc7.bio.ucalgary.ca';
> my $user = 'Hubert';
> my $password = 'Col00eng30';
>
> my $mysql = Net::MySQL->new(
>         hostname => $host,
>         database => $database,
>         user     => $user,
>         password => $password,
>     );
>
>
> print "Connection established \n";
>
> my $selectID = 0;
> my $count = 0;
>
>
>
> ##output database results
> #while (my @row = $sth->fetchrow_array)
> #   { print "@row\n" }
>
>
>
> print "start program\n";
> my $directory = '/home/Hubert/test';
> opendir(DIR, $directory) || die("Cannot open directory");
> print "opened directory\n";
>
> foreach my $file (readdir(DIR))  {
>   if ($file =~ /txt$/)   {
>       $count++;
>     print "read file $file \n";
>
>
>     $file = $directory . '/' . $file;
>
>     my $search = new Bio::SearchIO (-format => 'blast',
>                                        -file => $file);
>     print "bioperl seems to work....\n";
>     my $cutoff_len = 10;
>
>     #iterate over each query sequence
>     print "try to enter while loop\n";
>     while (my $result = $search->next_result) {
>     print "entered 1st while loop\n";
>
>       #iterate over each hit on the query sequence
>       while (my $hit = $result->next_hit) {
>       print "entered 2nd while loop\n";
>
>         #iterate over each HSP in the hit
>         while (my $hsp = $hit->next_hsp) {
>         print "entered 3rd while loop\n";
>
>           if ($hsp->length('sbjct') <= $cutoff_len) {
>           #print $hsp->hit_string, "\n";
>
>             for ($hsp->hit_string) {        #$hsp->hit_string
>              print "count files....., $count ,\n";
> .................
>
> ===================================================================
>
> Output:
>
> [Hubert at ppc7 Database_Search]$ /usr/bin/perl Blast.pl
> trying to connect to database
> Connection established
> start program
> opened directory
> read file 40026.txt
> bioperl seems to work....
> try to enter while loop
>
>
> but it doesn't enter the first while loop, it stuck there, first I
> thought it is a linux problem, because I updated from FC4 to FC5,  
> but it
> isn't because perl is working fine, and it seems bioperl is working  
> fine
> too, but it cannot parse the file anymore.....
>
> regards
> Hubert
>
>
>
>
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l




More information about the Bioperl-l mailing list