|< 1 2 >| | 19 Einträge, 2 Seiten |
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
74
75
76
77
#!/usr/bin/perl -w
use strict;
use warnings;
use Bio::SeqIO;
use Bio::Tools::Run::RemoteBlast;
use Bio::Seq;
use IO::String;
use Bio::SearchIO;
my $prog = 'blastp';
my $db = 'swissprot';
my $e_val= '20000';
my $matrix = 'PAM30';
#my $outfile = 'Output';
my @data;
my $line_dataArray;
my $rid;
my $count = 1;
my @params = ( '-prog' => $prog,
'-data' => $db,
'-expect' => $e_val,
'-matrix' => $matrix);
my $seqio_obj = Bio::SeqIO->new(-file => "Perm.txt",
-format => "raw",
);
print "entering blast....";
my $factory = Bio::Tools::Run::RemoteBlast->new (@params);
print "Blast entered successfully \n";
while( my $query = $seqio_obj->next_seq ) {
print "submit Sequence...just do it....\n";
my $r = $factory->submit_blast($query);
print $query->seq;
print "\n";
# Wait for the reply and save the output file
print "entering while loop for saving Output.... \n";
while ( my @rids = $factory->each_rid ) {
foreach my $rid ( @rids ) {
my $rc = $factory->retrieve_blast($rid);
print "retrieved Results successfully \n";
if( !ref($rc) ) {
if( $rc < 0 ) {
$factory->remove_rid($rid);
}
sleep 5;
} else {
#my $result = $rc->next_result;
print $rid;
print "\n";
my $filename = " $count .out";
$factory->save_output($filename);
print "File saved successfully \n";
$count++;
$factory->remove_rid($rid);
# }
}
}
print "\n";
print "\n";
}
}
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
sub save_output {
my ($self, $filename) = @_;
if( ! defined $filename ) {
$self->throw("Can't save blast output. You must specify a filename to save to.");
}
#should be set when retrieving blast
my $blastfile = $self->file;
#open temp file and output file, have to filter out some HTML
open(TMP, $blastfile) or $self->throw("cannot open $blastfile");
open(SAVEOUT, ">$filename") or $self->throw("cannot open $filename");
my $seentop=0;
while(<TMP>) {
next if (/<pre>/);
if( /^(?:[T]?BLAST[NPX])\s*.+$/i ||
/^RPS-BLAST\s*.+$/i ) {
$seentop=1;
}
next if !$seentop;
if( $seentop ) {
print SAVEOUT;
}
}
close SAVEOUT;
close TMP;
return 1;
}
1
2
3
4
5
6
7
8
9
10
11
------------- EXCEPTION: Bio::Root::Exception -------------
MSG: Could not open Perm.txt for reading: No such file or directory
STACK: Error::throw
STACK: Bio::Root::Root::throw F:/Perl/site/lib/Bio/Root/Root.pm:342
STACK: Bio::Root::IO::_initialize_io F:/Perl/site/lib/Bio/Root/IO.pm:260
STACK: Bio::SeqIO::_initialize F:/Perl/site/lib/Bio/SeqIO.pm:437
STACK: Bio::SeqIO::raw::_initialize F:/Perl/site/lib/Bio\SeqIO\raw.pm:94
STACK: Bio::SeqIO::new F:/Perl/site/lib/Bio/SeqIO.pm:355
STACK: Bio::SeqIO::new F:/Perl/site/lib/Bio/SeqIO.pm:368
STACK: -:31
-----------------------------------------------------------
1
2
3
4
5
6
7
8
my $filename = $count.".out";
my $save_retval = $factory->save_output($filename);
print "Returnvalue of save_output(): $save_retval\n";
open(my $fh,"<$filename") or die $!;
while(<$fh>){
print;
}
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
74
#!/usr/bin/perl -w
use strict;
use warnings;
use Bio::SeqIO;
use Bio::Tools::Run::RemoteBlast;
use Bio::Seq;
use IO::String;
use Bio::SearchIO;
my $prog = 'blastp';
my $db = 'swissprot';
my $e_val = '20000';
my $matrix = 'PAM30';
#my $outfile = 'Output';
my @data;
my $line_dataArray;
my $rid;
my $count = 1;
my @params = (
'-prog' => $prog,
'-data' => $db,
'-expect' => $e_val,
'-matrix' => $matrix
);
my $seqio_obj = Bio::SeqIO->new(
-file => "Perm.txt",
-format => "raw",
);
print "entering blast....";
my $factory = Bio::Tools::Run::RemoteBlast->new(@params);
print "Blast entered successfully \n";
while ( my $query = $seqio_obj->next_seq ) {
print "submit Sequence...just do it....\n";
my $r = $factory->submit_blast($query);
print $query->seq;
print "\n";
# Wait for the reply and save the output file
print "entering while loop for saving Output.... \n";
while ( my @rids = $factory->each_rid ) {
foreach my $rid (@rids) {
my $rc = $factory->retrieve_blast($rid);
if ( !ref($rc) ) {
print '$rc is not a ref!', "\n";
if ( $rc < 0 ) {
print "Remove rid ...\n";
$factory->remove_rid($rid);
}
# sleep 5;
}
else {
print "retrieved Results successfully \n";
print $rid;
print "\n";
my $filename = "$count.out";
$factory->save_output($filename);
print "File saved successfully \n";
$count++;
$factory->remove_rid($rid);
}
}
print "\n";
print "\n";
}
}
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
entering blast....Blast entered successfully
submit Sequence...just do it....
RKKWWWRW
entering while loop for saving Output....
-------------------- WARNING ---------------------
MSG: <HTML>
<HEAD>
</HEAD>
<BODY BGCOLOR="#FFFFFF" LINK="#0000FF" VLINK="#660099" ALINK="#660099">
<IMG SRC="images/head_results.gif" ALT="Header of the page" BORDER="0"NAME="BlastHeaderGif" WIDTH="600" HEIGHT="45" ALIGN="middle">
<form action="Blast.cgi" enctype="application/x-www-form-urlencoded" method="POST"><hr><font color="red">ERROR: Invalid RID: 1133551880-19615-126416106060</font
---------------------------------------------------
$rc is not a ref!
Remove rid ...
submit Sequence...just do it....
RKKWWWKW
entering while loop for saving Output....
-------------------- WARNING ---------------------
MSG: <HTML>
<HEAD>
</HEAD>
<BODY BGCOLOR="#FFFFFF" LINK="#0000FF" VLINK="#660099" ALINK="#660099">
<IMG SRC="images/head_results.gif" ALT="Header of the page" BORDER="0"NAME="BlastHeaderGif" WIDTH="600" HEIGHT="45" ALIGN="middle">
<form action="Blast.cgi" enctype="application/x-www-form-urlencoded" method="POST"><hr><font color="red">ERROR: Invalid RID: 1133551883-28224-102103062411</font
---------------------------------------------------
$rc is not a ref!
Remove rid ...
submit Sequence...just do it....
KRKWKRKW
entering while loop for saving Output....
-------------------- WARNING ---------------------
MSG: <HTML>
<HEAD>
</HEAD>
<BODY BGCOLOR="#FFFFFF" LINK="#0000FF" VLINK="#660099" ALINK="#660099">
<IMG SRC="images/head_results.gif" ALT="Header of the page" BORDER="0"NAME="BlastHeaderGif" WIDTH="600" HEIGHT="45" ALIGN="middle">
<form action="Blast.cgi" enctype="application/x-www-form-urlencoded" method="POST"><hr><font color="red">ERROR: Invalid RID: 1133551891-20159-118320711185</font
---------------------------------------------------
$rc is not a ref!
Remove rid ...
submit Sequence...just do it....
RKRKWKRR
entering while loop for saving Output....
-------------------- WARNING ---------------------
MSG: <HTML>
<HEAD>
</HEAD>
<BODY BGCOLOR="#FFFFFF" LINK="#0000FF" VLINK="#660099" ALINK="#660099">
<IMG SRC="images/head_results.gif" ALT="Header of the page" BORDER="0"NAME="BlastHeaderGif" WIDTH="600" HEIGHT="45" ALIGN="middle">
<form action="Blast.cgi" enctype="application/x-www-form-urlencoded" method="POST"><hr><font color="red">ERROR: Invalid RID: 1133551897-20419-66770204654</font>
---------------------------------------------------
$rc is not a ref!
Remove rid ...
submit Sequence...just do it....
RKRKWKRW
entering while loop for saving Output....
-------------------- WARNING ---------------------
MSG: <HTML>
<HEAD>
</HEAD>
<BODY BGCOLOR="#FFFFFF" LINK="#0000FF" VLINK="#660099" ALINK="#660099">
<IMG SRC="images/head_results.gif" ALT="Header of the page" BORDER="0"NAME="BlastHeaderGif" WIDTH="600" HEIGHT="45" ALIGN="middle">
<form action="Blast.cgi" enctype="application/x-www-form-urlencoded" method="POST"><hr><font color="red">ERROR: Invalid RID: 1133551905-20883-151607413394</font
---------------------------------------------------
$rc is not a ref!
Remove rid ...
submit Sequence...just do it....
RKRKWKWK
entering while loop for saving Output....
-------------------- WARNING ---------------------
MSG: <HTML>
<HEAD>
</HEAD>
<BODY BGCOLOR="#FFFFFF" LINK="#0000FF" VLINK="#660099" ALINK="#660099">
<IMG SRC="images/head_results.gif" ALT="Header of the page" BORDER="0"NAME="BlastHeaderGif" WIDTH="600" HEIGHT="45" ALIGN="middle">
<form action="Blast.cgi" enctype="application/x-www-form-urlencoded" method="POST"><hr><font color="red">ERROR: Invalid RID: 1133551910-29540-201656722897</font
---------------------------------------------------
$rc is not a ref!
Remove rid ...
submit Sequence...just do it....
KRKWKWRW
entering while loop for saving Output....
-------------------- WARNING ---------------------
MSG: <HTML>
<HEAD>
</HEAD>
<BODY BGCOLOR="#FFFFFF" LINK="#0000FF" VLINK="#660099" ALINK="#660099">
<IMG SRC="images/head_results.gif" ALT="Header of the page" BORDER="0"NAME="BlastHeaderGif" WIDTH="600" HEIGHT="45" ALIGN="middle">
<form action="Blast.cgi" enctype="application/x-www-form-urlencoded" method="POST"><hr><font color="red">ERROR: Invalid RID: 1133551913-21163-178685964119</font
---------------------------------------------------
$rc is not a ref!
Remove rid ...
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
entering blast....Blast entered successfully
submit Sequence...just do it....
RKKWWWRW
entering while loop for saving Output....
retrieved Results successfully
1133555438-29092-124335031569.BLASTQ1
File saved successfully
submit Sequence...just do it....
RKKWWWKW
entering while loop for saving Output....
retrieved Results successfully
1133555439-4896-23908741072.BLASTQ1
File saved successfully
submit Sequence...just do it....
KRKWKRKW
entering while loop for saving Output....
retrieved Results successfully
1133555440-29328-95626490823.BLASTQ4
File saved successfully
submit Sequence...just do it....
RKRKWKRR
entering while loop for saving Output....
retrieved Results successfully
1133555444-29639-155573299435.BLASTQ4
File saved successfully
submit Sequence...just do it....
RKRKWKRW
entering while loop for saving Output....
retrieved Results successfully
1133555446-5204-89705951466.BLASTQ4
File saved successfully
submit Sequence...just do it....
RKRKWKWK
entering while loop for saving Output....
retrieved Results successfully
1133555451-29985-25534453809.BLASTQ1
File saved successfully
submit Sequence...just do it....
KRKWKWRW
entering while loop for saving Output....
retrieved Results successfully
1133555452-30075-83189027376.BLASTQ1
File saved successfully
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
74
75
76
77
78
79
80
81
#!/usr/bin/perl -w
use strict;
use warnings;
use Bio::SeqIO;
use Bio::Tools::Run::RemoteBlast;
use Bio::Seq;
use IO::String;
use Bio::SearchIO;
my $prog = 'blastp';
my $db = 'swissprot';
my $e_val = '20000';
my $matrix = 'PAM30';
#my $outfile = 'Output';
my @data;
my $line_dataArray;
my $rid;
my $count = 1;
my @params = (
'-prog' => $prog,
'-data' => $db,
'-expect' => $e_val,
'-matrix' => $matrix
);
my $seqio_obj = Bio::SeqIO->new(
-file => "Perm.txt",
-format => "raw",
);
print "entering blast....";
my $factory = Bio::Tools::Run::RemoteBlast->new(@params);
print "Blast entered successfully \n";
while ( my $query = $seqio_obj->next_seq ) {
print "submit Sequence...just do it....\n";
my $r = $factory->submit_blast($query);
print $query->seq;
print "\n";
# Wait for the reply and save the output file
print "entering while loop for saving Output.... \n";
while ( my @rids = $factory->each_rid ) {
foreach my $rid (@rids) {
my $rc = $factory->retrieve_blast($rid);
if ( !ref($rc) ) {
print '$rc is not a ref!', "\n";
if ( $rc < 0 ) {
print "Remove rid ...\n";
$factory->remove_rid($rid);
}
# sleep 5;
}
else {
print "retrieved Results successfully \n";
print $rid;
print "\n";
my $filename = "$count.out";
#my $checkname = "check$count.out";
$factory->save_output($filename);
print "File saved successfully \n";
my $checkinput = $factory->file;
open(my $fh,"<$checkinput") or die $!;
while(<$fh>){
print;
}
close $fh;
$count++;
$factory->remove_rid($rid);
}
}
print "\n";
print "\n";
}
}
|< 1 2 >| | 19 Einträge, 2 Seiten |