[Bioperl-l] Bio::Tools::BPbl2seq Parsing bl2seq
Jason Stajich
jason.stajich at duke.edu
Tue Dec 14 08:52:01 EST 2004
I'd use Bio::SearchIO, format 'blast' instead of BPbl2seq.
But anyways...
You want to protect the calls with a while loop:
while( my $hsp = $report->next_feature ) {
}
Because if there are no alignments you'll get an error like you just
saw.
Passing option " -report_type => 'blastn' " is necessary for guessing
how to do the strandedness correctly.
-jason
On Dec 13, 2004, at 7:13 AM, Harry Noyes wrote:
> I am trying to parse a bl2seq output file using Bio::Tools::BPbl2seq
> and I get the followoing error message:
> Can't call method "nextHSP" on unblessed reference at
> /usr/lib/perl5/site_perl/5.8.0/Bio/Tools/BPbl2seq.pm line 243, <GEN0>
> line 7.
>
> The error is generated when I run this script
>
>
> use Bio::Tools::BPbl2seq;
> my $report = Bio::Tools::BPbl2seq->new(
> -file => 'temp.txt');
> $report->sbjctName;
> $report->sbjctLength;
> my $hsp = $report->next_feature;
> my $S_start = $hsp->sbjct->start;
> my $S_end = $hsp->sbjct->end;
>
>
> if ($S_start) {print "Start $S_start \n";}
>
>
> Since I am a beginner at this,I am probably doing something stupid.
> The file I am parsing is below and was generated with the statement:
> system("/usr/local/genome/blast/bl2seq -i $probe_file -j
> target_file.txt -p blastn -o temp.txt");
>
> .
> I have also tried inserting a statement " -format => 'blastn',
> " before the " -file => " statement but I still get
> the Warning message and the message about the unblessed reference.
> Any help would be much appreciated.
> Thanks
>
> Harry
>
> ######################################################################
> #COMMAND LINE OUTPUT
>
> perl blast_parser_test.pl
>
> -------------------- WARNING ---------------------
> MSG: Must provide which type of BLAST was run (blastp,blastn, tblastn,
> tblastx, blastx) if you want strand information to get set properly
> for DNA query or subjects
> ---------------------------------------------------
> Can't call method "nextHSP" on unblessed reference at
> /usr/lib/perl5/site_perl/5.8.0/Bio/Tools/BPbl2seq.pm line 243, <GEN0>
> line 7.
>
> ######################################################################
> #INPUT FILE (I HAVE OMMITTED MINOR ALIGNMENTS)
> Query=
> (250 letters)
>
> >
> Length = 105880
>
> Score = 496 bits (250), Expect = e-142
> Identities = 250/250 (100%)
> Strand = Plus / Minus
>
>
> Query: 1
> acctgctagagccttgatctgggaatctaagttttcataattatgaacaataaatttatg 60
>
> ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> Sbjct: 3962
> acctgctagagccttgatctgggaatctaagttttcataattatgaacaataaatttatg 3903
>
>
> Query: 61
> ttatttataaactacccgatataagatattttattacagcagcaagaatggactaagatg 120
>
> ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> Sbjct: 3902
> ttatttataaactacccgatataagatattttattacagcagcaagaatggactaagatg 3843
>
>
> Query: 121
> agtgcaaaatctgagaaggaaaccacaggtacctgcaagtactggaatattccataattg 180
>
> ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> Sbjct: 3842
> agtgcaaaatctgagaaggaaaccacaggtacctgcaagtactggaatattccataattg 3783
>
>
> Query: 181
> attaggtgggagtttaaatgtaagacagtaagttatattgctaaatatgaatgctgaggt 240
>
> ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> Sbjct: 3782
> attaggtgggagtttaaatgtaagacagtaagttatattgctaaatatgaatgctgaggt 3723
>
>
> Query: 241 cctccctaaa 250
> ||||||||||
> Sbjct: 3722 cctccctaaa 3713
>
>
>
> Score = 28.2 bits (14), Expect = 0.079
> Identities = 14/14 (100%)
> Strand = Plus / Plus
>
>
> Query: 34 ttcataattatgaa 47
> ||||||||||||||
> Sbjct: 3916 ttcataattatgaa 3929
>
> Lambda K H
> 1.37 0.711 1.31
>
> Gapped
> Lambda K H
> 1.37 0.711 1.31
>
>
> Matrix: blastn matrix:1 -3
> Gap Penalties: Existence: 5, Extension: 2
> Number of Hits to DB: 15
> Number of Sequences: 0
> Number of extensions: 15
> Number of successful extensions: 15
> Number of sequences better than 10.0: 1
> Number of HSP's better than 10.0 without gapping: 1
> Number of HSP's successfully gapped in prelim test: 0
> Number of HSP's that attempted gapping in prelim test: 0
> Number of HSP's gapped (non-prelim): 15
> length of query: 250
> length of database: 105,880
> effective HSP length: 12
> effective length of query: 238
> effective length of database: 105,868
> effective search space: 25196584
> effective search space used: 25196584
> T: 0
> A: 0
> X1: 6 (11.9 bits)
> X2: 15 (29.7 bits)
> S1: 12 (24.3 bits)
> S2: 11 (22.3 bits)
>
>
>
> *******************************NOTE NEW ADDRESS AND PHONE
> NUMBERS*****************
> Harry Noyes
> Room 231
> Biosciences Building
> School of Biological Sciences,
> University of Liverpool,
> Crown St.
> Liverpool
> L69 7ZB
> Internal 7334
> Tel 0151-794-7334
> Fax 0151-795-4408
> email harry at liv.ac.uk
> http://www.genomics.liv.ac.uk/
>
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at portal.open-bio.org
> http://portal.open-bio.org/mailman/listinfo/bioperl-l
>
>
--
Jason Stajich
jason.stajich at duke.edu
http://www.duke.edu/~jes12/
More information about the Bioperl-l
mailing list