[Bioperl-l] Query sequence length <= 0

Brian Osborne brian_osborne at cognia.com
Thu Apr 7 21:11:11 EDT 2005


Yanfeng,

On my computer, running Cygwin/Windows and bioperl-live, your script won't
work because without the fasta "-Q” option the script will simply stop,
waiting forever for user input. Of course, it could be the file contents
themselves since I’m using mine, not yours. At any rate, this works:

use strict;
use Bio::SearchIO;

my $fh;
my $fasta   = "/usr/local/bin/fasta34";
my $library = "hahu.aa"; # modified
my $query   = "hahu.aa"; # modified

my $options = "-E 0.01 -m 9 -d 0 -Q"; # modified
my $command = "$fasta $options $query $library";
print "Start running\n$command\n";
open $fh,"$command |";

my $searchio  = Bio::SearchIO->new(-format => 'fasta', -fh => $fh);
if( my $r = $searchio->next_result ) {
	if ( my $hit = $r->next_hit ) {
		  if( my $hsp = $hit->next_hsp ) {
				 print "location is ",   $hsp->hit->location->to_FTstring(), " ",
					$hsp->hit->length, " nt long\n";
		  }
	}
}


Brian O.

-----Original Message-----
From: bioperl-l-bounces at portal.open-bio.org
[mailto:bioperl-l-bounces at portal.open-bio.org]On Behalf Of Yanfeng Shi
Sent: Monday, April 04, 2005 4:52 PM
To: bioperl-l at bioperl.org
Subject: [Bioperl-l] Query sequence length <= 0


 I have a mitochondrial genome sequence and one short sequence of other
species
mitochondrial genome. I want to find the relative positon of my
mitochondrial
genome which is similar to that cds sequence.

I run the code below.But I got "
***[/usr/local/bin/fasta34] Query sequence length <= 0:
/home/yanfeng/BioInf/Project/qu.fasta***

-------------------- WARNING ---------------------
MSG: unable to find and set query length

Why does this happen?

  $|=1;
  my $fasta   = "/usr/local/bin/fasta34";
  my $library = "/home/yanfeng/BioInf/Project/mun_lab.fasta";
  my $query   = "/home/yanfeng/BioInf/Project/qu.fasta";

   my $options = "-E 0.01 -m 9 -d 0 ";
  my $command = "$fasta $options $query $library";
  print "Start running\n$command\n";
  open($fh,"$command |");

my $searchio  = Bio::SearchIO->new(-format => 'fasta', -fh => $fh);
if( my $r = $searchio->next_result ) {
  if ( my $hit = $r->next_hit ) { # only want the BEST hit in this SIMPLE
example
    if( my $hsp = $hit->next_hsp ) { # only one HSP per hit for FASTA,change
for
BLAST
     print "location is ",   $hsp->hit->location->to_FTstring(), " ",
                 $hsp->hit->length, " nt long\n";
    }
  }
}
--


_______________________________________________
Bioperl-l mailing list
Bioperl-l at portal.open-bio.org
http://portal.open-bio.org/mailman/listinfo/bioperl-l





More information about the Bioperl-l mailing list