[Bioperl-l] Problems installing bioperl (bioperl-live tarball from CVS)

Chris Fields cjfields at uiuc.edu
Fri Nov 30 23:37:50 EST 2007


Make sure to keep this on the list.

ncbi_gi() is only in bioperl-live (CVS); my guess is you either  
somehow got 1.5.2 instead or the bioperl-live version is not found in  
your path.  It's very likely the latter, as perl's looking for  
whatever else is present (which appears to be an older version of  
bioperl). That should give you a hint that the problem may be with  
your lib path.  Try changing the 'Use lib '/home/awaller/bioperl-live/ 
Bio'' to:

use lib '/home/awaller/bioperl-live';

chris

On Nov 30, 2007, at 8:09 PM, alison waller wrote:

> Okay so Now I'm really confused.
> I edited > #!usr/bin/perl
>> Use lib '/home/awaller/bioperl-live/Bio.
> I ran the script below with the *special hit->ncbi from Chris.  It  
> worked,
> it was great, I got the gi! No errors, no bugs that I saw in  
> checking the
> output.  Then I went back in, edited the script to retrieve further  
> info
> (specifically the strand).  Saved it, now when I try to run it I get  
> the
> same error message that I was previously getting.
>
> barrett ~ $ perl blast_parse_awcf.pl OldMoBlastxGiTest.txt 1
> Can't locate object method "ncbi_gi" via package
> "Bio::Search::Hit::BlastHit" at blast_parse_awcf.pl line 50, <GEN1>  
> line
> 189.
>
> Thanks soo much,
>
>
> #!usr/bin/perl
>
> use strict;
> use warnings;
> use lib "/home/awaller/bioperl-live/Bio";
> use Bio::Perl;
> use Bio::SearchIO;
>
> my $usage = "to run type: blast_parse_aw.pl <blast report> <# of  
> hits per
> query> \n"; if (@ARGV != 2) { die $usage; }
>
> my $infile  = $ARGV[0];
> my $outfile = $infile . '.parsed';
> my $tophit  = $ARGV[1]; # to specify in the command line how many hits
>                      # to report for each query
>
> open( OUT, ">$outfile" ) || die "Can't open outputfile $outfile! $! 
> \n";
>
> my $report = Bio::SearchIO->new(
>  -file   => $infile,
>  -format => "blast"
> );
>
> print OUT join("\t",qw(
>              Query
>              HitDesc
>              HitAccess
>              HitGi
> 		HitBits
>              Evalue
>              %id
>              AlignLen
>              NumIdent
>              NumPos
>              gaps
>              Qframe
>              Qstrand
>              Hframe
> 		Hstrand))."\n";
>
> # Go through BLAST reports one by one
> while ( my $result = $report->next_result ) {
>  my $ct = 0;
>  my @tophits = grep {$ct++ < $tophit } $result->hits;
>  if (scalar(@tophits) == 0) {
>     print OUT "no hits\n";
>  }
>  for my $hit (@tophits) {
>     my $tophsp=$hit->hsp('best');
>     # Print some tab-delimited data about this hit
>     print OUT join("\t",
>                    $result->query_name,
>                    $hit->description,
>                    $hit->accession,
>                    $hit->ncbi_gi,
>                    $hit->bits,
>                    $tophsp->evalue,
>                    $tophsp->percent_identity,
>                    $tophsp->length('total'),
>                    $tophsp->num_identical,
>                    $tophsp->num_conserved,
>                    $tophsp->gaps,
>                    $tophsp->query->frame,
> 		      $tophsp->strand('query'),	
>                    $tophsp->hit->frame,
> 		      $tophsp->strand('hit'),	
>                   )."\n";
>  }
> }
>
>
>
>
> -----Original Message-----
> From: Sendu Bala [mailto:bix at sendu.me.uk]
> Sent: Friday, November 30, 2007 6:24 PM
> To: alison waller
> Subject: Re: [Bioperl-l] Problems installing bioperl (bioperl-live  
> tarball
> from CVS)
>
> alison waller wrote:
>> Thank you Sendu,
>>
>> So I'm trying the second option.  I have downloaded the bioperl-live
> tarball
>> from the CVS on my windows laptop, and then moved it to my home  
>> directory
> in
>> the linux cluster where I unzipped and tared it.  So I now have a
> directory
>> /home/awaller/bioperl-live.
>>
>> I edited my .bashrc file as below:
>> Export PERL5LIB='/home/awaller/bioperl-live'
>>
>> I also edited a sample script to include:
>> #!usr/bin/perl
>> Use lib '/home/awaller/bioperl-live'
>
> Does this directory contain a 'Bio' directory with all the BioPerl
> modules inside it?
>
>
>> But it still isn't working.
>> At the prompt I typed$ perl script.pl
>> It gave me the warning - can't locate object method ncbi_gi which  
>> is why
> I'm
>> trying to download the CVS version as Chris Fields added code to  
>> make the
>> ncbi-gi object.
>
> You'll have to give me the complete, unedited error message and  
> ideally
> the script itself before I can help you further.
>
>
>> Don't I have to do something similar to what the Build.PL file does?
>
> Probably not. It doesn't matter where your perl executable is, btw, as
> long as the system knows how to run perl, which it obviously does.
> <OldMoBlastxGiTest.txt.parsed><OldMoBlastxGiTest.txt>

Christopher Fields
Postdoctoral Researcher
Lab of Dr. Robert Switzer
Dept of Biochemistry
University of Illinois Urbana-Champaign





More information about the Bioperl-l mailing list