Bonjour,
Je suis étudiante en bioinformatique et je débute sur bioperl. J'essaye depuis quelques jours d'effectuer un blast avec bioperl mais je rencontre un certain nb de difficultés.J'aurais voulu savoir si quelqu'un aurait pu m'aider pour résoudre mon probleme.
J'ai utilisé le code suivant pour tester blast mais quand je le lance il me retourne une erreur que je n'arrive pas à résoudre.
voila l'erreur qu'il m'affiche dans la console
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73 1 #!/usr/bin/perl 2 #Remote-blast "factory object" creation and blast-parameter initialization 3 4 use Bio::Tools::Run::RemoteBlast; 5 use Bio::Search::Result::ResultI; 6 use strict; 7 my $prog = 'blastp'; 8 my $db = 'swissprot'; 9 my $e_val= '1e-10'; 10 11 my @params = ( '-prog' => $prog, 12 '-data' => $db, 13 '-expect' => $e_val, 14 '-readmethod' => 'SearchIO' ); 15 16 my $factory = Bio::Tools::Run::RemoteBlast->new(@params); 17 18 #change a paramter 19 $Bio::Tools::Run::RemoteBlast::HEADER{'ENTREZ_QUERY'} = 'Homosapiens [ORGN]'; 20 21 #remove a parameter 22 delete $Bio::Tools::Run::RemoteBlast::HEADER{'FILTER'}; 23 24 my $v = 1; 25 #$v is just to turn on and off the messages 26 27 my $str = Bio::SeqIO->new(-file=>'1prot.fasta' , '-format' => 'fasta' ); 28 29 while (my $input = $str->next_seq()){ 30 #Blast a sequence against a database: 31 32 #Alternatively, you could pass in a file with many 33 #sequences rather than loop through sequence one at a time 34 #Remove the loop starting 'while (my $input = $str->next_seq())' 35 #and swap the two lines below for an example of that. 36 my $r = $factory->submit_blast($input); 37 #my $r = $factory->submit_blast('amino.fa'); 38 39 print STDERR "waiting..." if( $v > 0 ); 40 while ( my @rids = $factory->each_rid ) { 41 foreach my $rid ( @rids ) { 42 my $rc = $factory->retrieve_blast($rid); 43 if( !ref($rc) ) { 44 if( $rc < 0 ) { 45 $factory->remove_rid($rid); 46 } 47 print STDERR "." if ( $v > 0 ); 48 sleep 5; 49 } else { 50 my $result = $rc->next_result(); 51 #save the output 52 my $filename = $result->query_name()."\.out"; 53 $factory->save_output($filename); 54 $factory->remove_rid($rid); 55 print "\nQuery Name: ", $result->query_name(), "\n"; 56 while ( my $hit = $result->next_hit ) { 57 next unless ( $v > 0); 58 print "\thit name is ", $hit->name, "\n"; 59 while( my $hsp = $hit->next_hsp ) { 60 print "\t\tscore is ", $hsp->score, "\n"; 61 } 62 } 63 } 64 } 65 } 66 } 67 68 # This example shows how to change a CGI parameter: 69 #$Bio::Tools::Run::RemoteBlast::HEADER{'MATRIX_NAME'} = 'BLOSUM25'; 70 71 # And this is how to delete a CGI parameter: 72 #delete $Bio::Tools::Run::RemoteBlast::HEADER{'FILTER'}; 73
####################
waiting...Can't call method "query_name" on an undefined value at blast.pl line 52,<GEN4>line 185
####################
Partager