Thread xml output wird nicht gespeichert (6 answers)
Opened by paidopoieo at 2006-06-07 04:39

paidopoieo
 2006-06-07 04:39
#67022 #67022
User since
2005-12-02
96 Artikel
BenutzerIn
[default_avatar]
hallo leute,
das folgende programm schreibt den xml output auf die konsole, legt auch ein xml file an, jedoch ist das xml file dann leer.....wenn ich das ganze jedoch mit einem texfile mache, funkt es einwandfrei....
auf konsole ausgegeben, file angelegt und in file gespeichert....

hab das benoetigte tool auch upgedatet, latest cvs version....

Code: (dl )
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
#!/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;


use lib qw(/usr/local/bioperl/bioperl-1.5.1);


my $prog = 'blastp';
my $db = 'swissprot'; &n
bsp; &n
bsp;
my $e_val = '20000';
my $matrix = 'pam30'; &n
bsp; &n
bsp; my $wordSize = '2';


my @data;
my $line_dataArray;
my $rid;
my $count = 1; &nbs
p; &nbs
p;
my @params = (
'-prog' => $prog,
'-data' => $db,
'-expect' => $e_val,
'-MATRIX_NAME' => $matrix,
'-readmethod' => 'xml',
'-WORD_SIZE' => $wordSize,
);

my $seqio_obj = Bio::SeqIO->new(
-file => "aloneblosum80.txt",
-format => "raw",
);

print "entering blast....";

my $xmlFactory = Bio::Tools::Run::RemoteBlast->new(@params);

$Bio::Tools::Run::RemoteBlast::HEADER{'GAPCOSTS'} = '9 1'; &n
bsp; &n
bsp; $Bio::Tools::Run::RemoteBlast::HEADER{'DESCRIPTIONS'} = '1000';
$Bio::Tools::Run::RemoteBlast::RETRIEVALHEADER{'ALIGNMENTS'} = '1000';
$Bio::Tools::Run::RemoteBlast::RETRIEVALHEADER{'FORMAT_TYPE'} = 'XML';


print "Blast entered successfully \n";

while ( my $query = $seqio_obj->next_seq ) {
print "submit Sequence...just do it....\n";

my $r = $xmlFactory->submit_blast($query);
print $query->seq;
print "\n";


# sleep 30;

# Wait for the reply and save the output file
print "entering while loop for saving Output.... \n";

while ( my @rids = $xmlFactory->each_rid ) {
foreach my $rid (@rids) {

my $rc = $xmlFactory->retrieve_blast($rid);
if ( !ref($rc) ) {
print '$rc is not a ref!', "\n";
if ( $rc < 0 ) {
print "Remove rid ...\n";
$xmlFactory->remove_rid($rid);
}
# sleep 5;
}
else {

print "retrieved Results successfully \n";
print $rid;
print "\n";
my $filename = "$count.xml";
$xmlFactory->save_output($filename);
print "File saved successfully \n";
my $checkinput = $xmlFactory->file;
open(my $fh,"<$checkinput") or die $!;
while(<$fh>){
print;
}
close $fh;
$count++;
$xmlFactory->remove_rid($rid);
}
}
print "\n";
print "\n";

}
}


danke fuer die hilfe

View full thread xml output wird nicht gespeichert