[Bioperl-l] Help with hmmpfam
Kary Ann Del Carmen Soriano Ocana
Kary at ioc.fiocruz.br
Thu Mar 24 15:24:11 EST 2005
Dear All,
I am new to bioperl and would like (if possible) to obtain some help with the SearcIO module and hmmpfam. I am listing my code below and the output containing the following error:
(partial) output and error:
[kary at vivax inserir_dados]$ perl bioperl_pfam_23_03_05.pl
Passou a definicao do arquivo query
passou abrir o arquivo mmm.hmm
sh: -c: line 0: syntax error near unexpected token `('
sh: -c: line 0: `/usr/local/bin/hmmpfam -E 0.0001 1 HMMER2.0 [2.3.2]\nNAME 76GJYz8zFm\nLENG 327\nALPH
I put some "print" commands everywhere to see where I am getting the error and looks like it is not entering/printing the while results (eg: next_result, next_hit). Any help would be greatly appreciated.
Thanks, Kary
************
Script:
#!/usr/bin/perl -w
use lib "/usr/local/bioperl14";
use lib "/usr/local/bioperl-run-1.4";
use Bio::Search::Result::HMMERResult;
use Bio::Tools::Run::Hmmer;
use Bio::Tools::Run::Hmmpfam;
use strict;
my $query;
my $db;
my $seq;
my $dbfile;
my @array;
$query = "sequencia_fasta_4_arg.txt";
print "Passou a definicao do arquivo query\n";
open (READ, "$query") or die "Cannot open $query: $!";
while (my $sequence = <READ>){
for ($sequence) {
&hmmpfam($sequence);
#print $seq;
}
}
close (READ);
print "Passou leitura do arquivo query\n";
#############################################################################################################################################
sub hmmpfam {
my ($seq) = @_;
$db = "mmm.hmm";
open (DH, "$db") or die "Cannot open $db: $!";
print "passou abrir o arquivo mmm.hmm\n\n";
while ($dbfile = <DH>){
#Build a Hmmpfam factory
my @params = ('DB'=>$dbfile,'E'=>0.0001);
my $factory = Bio::Tools::Run::Hmmpfam->new(@params);
# Pass the factory a Bio::Seq object or a file name
# returns a Bio::SearchIO object
my $search = $factory->run($seq);
print "Search: $search\n";
print "Passou search com parametros \n";
my @feat;
my $searchio = new Bio::SearchIO(-format => 'hmmer',
-file => 'result.hmmer') or die print "Error for open the file";
while (my $result = $searchio->next_result){
print "começa o while do NEXT RESULT\n\n";
while(my $hit = $result->next_hit){
print "começa o while do HIT - NEXT HIT\n\n";
while (my $hsp = my $hit->next_hsp){
print join("\t", ( my$r->query_name,
$hsp->query->start,
$hsp->query->end,
$hit->name,
$hsp->hit->start,
$hsp->hit->end,
$hsp->score,
$hsp->evalue,
$hsp->seq_str,
)), "\n";
print "terminou o while dos HSPs\n\n";
}
}
}
}
close (DH);
}
More information about the Bioperl-l
mailing list