9 Einträge, 1 Seite |
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);
1
2
if (tr/K/K/ >= 2 || tr/R/R/ >= 2 && tr/W/W/ >= 2 ||
tr/K/K/ == 1 && tr/R/R/ == 1 && tr/W/W/ >= 2) {
1
2
if ($hsp->hit_string =~ tr/K// >= 2 || $hsp->hit_string =~ tr/R// >= 2 && $hsp->hit_string =~ tr/W// >= 2 ||
$hsp->hit_string =~ tr/K// == 1 && $hsp->hit_string =~ tr/R// == 1 && $hsp->hit_string =~ tr/W// >= 2) {
9 Einträge, 1 Seite |