Thread reg. expr wird nicht aufgerufen (8 answers)
Opened by paidopoieo at 2006-02-10 22:36

paidopoieo
 2006-02-10 22:36
#62845 #62845
User since
2005-12-02
96 Artikel
BenutzerIn
[default_avatar]
Hi
folgendes Codefragment:

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
#!/usr/bin/perl -w

use Bio::SearchIO;
use strict;

print "start program\n";
my $directory = '/home/Hubert/result_1';
opendir(DIR, $directory) || die("Cannot open directory");
print "opened directory\n";

foreach my $file (readdir(DIR)) {
if ($file =~ /txt/) {
print "read file $file \n";

$file = $directory . '/' . $file;

my $search = new Bio::SearchIO (-format => 'blast',

-file => $file);



my $cutoff_len = 10;



#iterate over each query sequence
print "try to enter while loop\n";
while (my $result = $search->next_result) {
print "entered 1st while loop\n";

#iterate over each hit on the query sequence
while (my $hit = $result->next_hit) {
print "entered 2nd while loop\n";

#iterate over each HSP in the hit
while (my $hsp = $hit->next_hsp) {
print "entered 3rd while loop\n";

if ($hsp->length('sbjct') <= $cutoff_len) {
#print $hsp->hit_string, "\n";


for ($hsp->hit_string) { #$hsp->hit_string
print $hsp->hit_string,"\n";

if (tr/K// >= 2 || tr/R// >= 2 && tr/W// >= 2 ||
tr/K// == 1 && tr/R// == 1 && tr/W// >= 2) {



print "create and open to write file\n";
open (bigShot, ">>result_adv_4.txt") || die ("Could not open file. $!");
#print $result->query_name, "\t";

# print $hit->significance, "\t";
print bigShot $hit->name, "-->";
print bigShot $hit->description, "\n";
#print bigShot "Query: ", $hsp->start('query'), " ", $hsp->query_string, " ", $hsp->end('query'), "\n";
print bigShot "Seq: ", $hsp->start('hit'), " ", $hsp->hit_string, " ", $hsp->end('hit'), "\n";

# print $hsp->rank, "\t";
# print $hsp->percent_identity, "\t";
# print $hsp->evalue, "\t";
# print $hsp->hsp_length, "\n";


close (bigShot);


}#end if condition
}#end for loop
}#end if condition
}#end 3rd while loop
}#end 2nd while loop
}#end 1st while loop
}#end if condition
}#end foreach loop

closedir(DIR);


der folgende regular expression ausdruck wird beim parsen der files nicht aufgerufen:

if (tr/K// >= 2 || tr/R// >= 2 && tr/W// >= 2 ||
tr/K// == 1 && tr/R// == 1 && tr/W// >= 2) {

fuer jede erdenkliche hilfe dankbar\n\n

<!--EDIT|paidopoieo|1139609595-->

View full thread reg. expr wird nicht aufgerufen